The essentials
- Authenticate with
SABAOTH_API_KEY, notsabaoth login. Store the key in your CI provider’s secret store. See Authentication. - Pass
--jsonand parse stdout. - Pass
--yestopostgres create,postgres deleteandbackup create. Without a terminal they refuse to run unconfirmed. - Branch on the exit code, and on the error
codewhen you need detail.
Output streams
This means
sabaoth postgres list --json > services.json always produces a clean file, and confirmation prompts never end up in captured output.
JSON output
With--json, a successful command prints exactly one JSON document on stdout.
- Keys are
snake_case. - Within a major version, fields are only ever added, never renamed or removed. Ignore fields you don’t recognize so your scripts keep working as new ones appear.
- Every list command puts its results in
items. - JSON output isn’t altered for terminal safety. Values round-trip exactly as the API sent them.
sabaoth postgres logs --json is the exception: it prints newline-delimited JSON, one record per line. See JSON output for logs.
Warnings
In human mode, warnings print on stderr asWarning: .... In --json mode they’re added to the success document instead, so stderr stays clean:
Errors
A failed command prints exactly one error. In--json mode the error is a single line of JSON on stderr, and stdout stays empty:
In human mode the error goes to stderr as:
Request ID: line when there is one, and This failure may be temporary; retrying is safe. when retryable is true.
Exit codes
Exit codes are part of the CLI’s stable interface and won’t change within a major version.
Retrying safely
Only retry whenretryable is true. That covers network failures (NETWORK_UNAVAILABLE), rate limiting (RATE_LIMITED) and temporary API outages (API_UNAVAILABLE).
The CLI never retries a create, delete or backup request on its own. If one of them gets no response, it fails with UNKNOWN_MUTATION_OUTCOME and retryable: false, because the change may already have happened. Check before trying again, or you risk a second billable service or duplicate backup. See the “If the result is unknown” section on each command’s page.
Colors
Colors are turned off when stdout isn’t a terminal. To turn them off everywhere, setNO_COLOR to any value: