Reference
What scripts and CI jobs can rely on: output streams, each command’s --json payload, exit codes,
and what an unattended job can reach in Helix Cloud.
Output
- stdout carries only the result; stderr carries progress, warnings, hints, and errors.
--jsonprints one compact JSON value and a newline on stdout, nothing else. It never prompts, skips the startup update checks, and conflicts with--quietand--verbose.- Without a terminal on stdin or stderr, or with
--json, commands never prompt: they use a default (dev, or the only candidate) or fail and list the candidates. - Destructive commands (
delete,prune --all,project delete,database delete,database key revoke,service-credential revoke) that cannot prompt fail before acting unless you pass-y/--yes.prune <instance>never asks. - Output that is not a terminal is never colored;
NO_COLOR=1drops colors in a terminal. - Set
HELIX_NO_UPDATE_CHECK=1so the first command of the day does not wait up to 10 seconds on GitHub. See Environment variables.
Exit codes
The codes are the same with and without
--json. Exceptions:
helix doctorprints its whole report, then exits1if any check fails; warnings alone exit0.helix shellprints a failed request’s error, keeps reading, and exits0at end of input. Use onehelix queryper request when each result must set the exit code.helix stopexits0when the instance was not running, andhelix prune <instance>when there was nothing to remove.
--json, an error is one JSON object on stderr; without it, the same error prints as text.
Only message is always present. candidates lists what you can pass when the CLI could not choose:
context and caused_by.
JSON results
Cloud results are the API’s JSON field for field. Only
database list and database get add
"kind" ("dedicated" or "tenant"); owners the human view resolves, such as a project’s
workspace, are not added. Cloud lists follow pagination up to 50 pages of 200 items, then fail with
more than 50 pages; narrow the request.
These commands have no JSON result:
Run in CI
Local instances
Local commands need only Docker or Podman, no login, so they run in CI as on your machine. Give each job its own CLI state withHELIX_HOME="$(mktemp -d)". In-memory data does not survive a restart;
use --disk or S3 storage when it must.
Helix Cloud
The CLI has no unattended login:helix auth login needs an interactive terminal, and neither a
service credential nor an application key can log the CLI in. Run Cloud commands such as
helix query production, helix database, and helix api on a developer machine, and do not copy
your session file into CI. From an unattended job, use:
helix database get <database> --json prints the gateway host as connectionEndpoint; the
dashboard’s database page shows it too. Create the key once with
helix database key create --access read-only and store it as a CI secret.
A service credential:
- can use only the MCP query and administration tools its project grants allow;
- cannot list workspaces, projects, or databases, so give it a
tenant:<id>orcluster:<id>target; - cannot call the Helix Cloud API the CLI uses, so it cannot run
helix api, a Cloudhelix query, or other Cloud commands; - cannot create, change, or revoke service credentials.
Related
- Targets and resolution: how commands pick instances and Cloud resources.
- CLI configuration:
helix.toml, state files, and environment variables. - CLI troubleshooting: the CLI’s error messages and fixes.