Executing Commands
The exec
command allows you to execute commands in a remote terminal session for your applications. This is useful for running commands directly on your application's environment, such as debugging, maintenance, or running one-off commands. Here is a list of Shopware console commands.
Usage
sh
sw-paas exec [flags]
Description
The exec
command provides two main functionalities:
- List existing terminal sessions
- Start a new terminal session.
By default, the command will show existing sessions if there are any or start a new session if no existing sessions are found.
INFO
See this FAQ section for the main difference between exec
and command
Flags
--application-id string
: The ID of the application you want to execute commands in--new
: Force creation of a new terminal session--organization-id string
: The ID of the organization--project-id string
: The ID of the project-h, --help
: Show help for the exec command
Examples
List existing terminal sessions:
shsw-paas exec
Force creation of a new terminal session:
shsw-paas exec --new
Execute commands in a specific application:
shsw-paas exec --project-id my-project --application-id my-app
Notes
- When using the command without any flags, it will automatically handle the session management based on existing sessions
- The
--new
flag is useful when you want to ensure you're starting a fresh session - Make sure to provide the necessary IDs (application, project, organization) when working with specific resources
- To exit the remote shell, type
exit
and press Enter - You can reuse existing terminal sessions instead of creating new ones each time, which can be more efficient for ongoing work