Skip to main content

start

start a run now

⏱️ Start a run now.

Give a command after -- to run it once in the service's image, with the service's variables and size: a task run, such as a database migration or a one-off script. The command runs without a shell: quoting groups words into one argument, but pipes, && and $VARIABLES are passed as plain text. To use them, run a shell yourself: -- sh -c '<command>'.

Without a command, a scheduled job runs its own command, alongside the schedule: the next scheduled run is not moved or replaced, and a paused job can still be run. Any other service needs a command.

The command returns as soon as the run is accepted. Add --wait to follow it until it succeeds or fails: progress goes to stderr and the final run to stdout, in any --output format. With --wait the exit code says how it ended:

0 succeeded 1 failed 8 still running when --wait-timeout ran out

Read what the run wrote with csph deployment runs logs <run-id> --deployment <deployment-id>, and stop a run that is still going with csph deployment runs cancel <deployment-id> <run-id>.

Usage​

csph deployments runs start <deployment-id> [-- <command>...] [flags]

Aliases​

deployments runs start, deployments runs now, deployments runs trigger, deployments run start, deployments run now, deployments run trigger, deployment runs start, deployment runs now, deployment runs trigger, deployment run start, deployment run now, deployment run trigger, deploys runs start, deploys runs now, deploys runs trigger, deploys run start, deploys run now, deploys run trigger

Options​

Command Specific​

--account <string>
account ID
--wait
wait for the run to succeed or fail; progress goes to stderr

--wait-timeout <duration> (default "30m0s")

how long --wait waits before giving up (exit code 8: still running)

Formatting​

For more information about formatting options, see Formatting.

--fields <strings>
output JSON with the specified fields
--jq <string>
filter JSON output with jq expression

-o, --output <string>

output format: [table|plain|csv|json|yaml]
--template <string>
format JSON using a Go template

Available Fields​

command, deployment_id, duration_ms, exit_code, finished_at, id, job_name, line_count, message, object, started_at, status, triggered_by

Inherited​

--config <string>
config file (default is $HOME/.config/computesphere/configuration.yaml)
--debug
enable debug logging

-h, --help

show this help message

-i, --interactive

run interactively (prompts, pickers, table browser)
--log-level <string>
log level: [trace|debug|info|warn|error|fatal|panic|disabled||api]
--no-color
disable color output
--no-input
disable interactive mode

Examples​

# run a database migration and wait for it to finish
> csph deployment runs start <deployment-id> --wait -- npm run migrate

# run a shell command
> csph deployment runs start <deployment-id> --wait -- sh -c 'echo "$APP_ENV"'

# run a scheduled job now
> csph deployment runs start <deployment-id>

# in CI: wait up to 15 minutes, then print the final run as JSON
> csph deployment runs start <deployment-id> --wait --wait-timeout 15m --output json -- ./bin/seed

# pick the deployment interactively (a scheduled job)
> csph deployment runs start

See also​