Automate with the Coolify CLI
The CLI supports multiple Coolify instances, structured output, and nonzero exit statuses for failed commands. These features let scripts and CI jobs inspect resources and start deployments without parsing human-readable tables.
Configure separate contexts
Save a context for each Coolify instance:
coolify context add production https://coolify.example.com <production-token>
coolify context add staging https://staging-coolify.example.com <staging-token>
coolify context use productionUse another context for one command without changing the default:
coolify --context staging resource listVerify every context before using it in automation:
coolify --context production context verify
coolify --context staging context verifyRequest structured output
Use compact JSON for scripts:
coolify --format json resource listUse formatted JSON while developing or debugging a script:
coolify --format pretty deploy listtable is the default for interactive terminal use. Do not parse table columns in automation because their display can change.
Deploy several resources
Start a batch deployment with comma-separated resource names:
coolify --context production deploy batch api,worker,frontendAdd --force only when every named resource must deploy without detected changes:
coolify --context production deploy batch api,worker,frontend --forceVerify the resulting deployments:
coolify --context production --format json deploy listHandle failures safely
A failed CLI command returns a nonzero exit status, so shell scripts and CI jobs can stop immediately:
set -e
coolify --context production context verify
coolify --context production deploy name apiKeep these restrictions in automated environments:
- Store API tokens in the CI secret manager, not in repository files or command arguments.
- Do not use
--show-sensitivein shared logs. - Use
--debugonly during diagnosis because it adds operational details to output. - Give the context token only the permissions required by the job.
