qc exec
Run commands server-side on an environment. Unlike qc ssh --command, which dies with your terminal session, an exec run executes in a one-off container on the platform — it keeps going if your laptop sleeps, your network drops, or you close the terminal. The CLI only watches progress, and you can reattach at any time. For a task-oriented walkthrough, see the remote commands guide.
Subcommands
Section titled “Subcommands”| Command | Description |
|---|---|
qc exec run |
Run a command and watch it until it completes. |
qc exec status |
Show status and output for a run, or reattach with --watch. |
qc exec list |
List command runs for the environment. |
All exec subcommands accept --org, --app, --env, and --platform overrides.
qc exec run
Section titled “qc exec run”Create a server-side run and poll it until it reaches a terminal state. The remote command’s exit code becomes the CLI’s exit code, so qc exec run is safe to use in scripts and CI.
Synopsis
Section titled “Synopsis”qc exec run "<command>" [options]Options
Section titled “Options”| Flag | Description | Default |
|---|---|---|
--container <name> |
Target a specific container. | First container in the task definition |
--detach |
Start the run and return immediately (prints the run ID). | — |
--interval <sec> |
Poll interval in seconds (minimum 5). | 15 |
--org <org> |
Override organization. | — |
--app <app> |
Override application. | — |
--env <env> |
Override environment. | — |
--platform <platform> |
Override platform. | — |
Examples
Section titled “Examples”# Run a long task and watch it — safe to sleep the laptop mid-runqc exec run "drush cron"
# Target a specific containerqc exec run "php artisan queue:work --once" --container php
# Fire and forgetqc exec run "./import.sh" --detachCommands containing shell operators (&&, ;, |, …) are automatically run through /bin/sh -c on the server — write them flat rather than nesting your own sh -c '...' quoting:
# Goodqc exec run "echo start && ./migrate.sh"
# Avoid — nested quoting gets mangledqc exec run "sh -c 'echo start && ./migrate.sh'"Pressing Ctrl+C while watching only detaches the CLI — the run continues on the server and the CLI prints the qc exec status command to reattach.
qc exec status
Section titled “qc exec status”Show the current status, metadata, and output for a run. With --watch, reattach and poll until the run completes — the accumulated output is reprinted from the beginning, then new lines stream as they arrive.
Synopsis
Section titled “Synopsis”qc exec status <runId> [options]Options
Section titled “Options”| Flag | Description | Default |
|---|---|---|
--watch |
Poll until the run completes (reattach). | — |
--interval <sec> |
Poll interval in seconds (minimum 5). | 15 |
--org <org> |
Override organization. | — |
--app <app> |
Override application. | — |
--env <env> |
Override environment. | — |
--platform <platform> |
Override platform. | — |
Examples
Section titled “Examples”# One-shot status checkqc exec status 411fc62f-b8d5-4d7c-b8af-5a53f371d222
# Reattach after a detach, laptop sleep, or from another machineqc exec status 411fc62f-b8d5-4d7c-b8af-5a53f371d222 --watchqc exec list
Section titled “qc exec list”List command runs for the environment.
Synopsis
Section titled “Synopsis”qc exec list [options]