Skip to content
kix /docs
Install the CLI

Reference CLI

Exit codes

What each `kix` command's exit status means, so CI jobs and scripts can branch on the result.

Every kix command exits 0 on success and 1 on an error it reports, such as an evaluation failure, a build failure, or an unreachable cluster. Some commands also use a non-zero status to report a result, listed below.

This page is hand-maintained. Check the std::process::exit calls in cli/kix-cli/src/commands/ when in doubt.

CodeMeaning
0Success. Also printed help (-h, --help) and version (-V).
1An error, printed on stderr.
2The command line could not be parsed: an unknown flag, a missing argument, or an invalid value. kix diff and kix plan also use 2, see below.
CommandNon-zero status beyond errors
kix diff2 when there is at least one difference or a stateful migration was detected. 0 means no differences.
kix plan, kix deploy --dry-run2 when the deploy would change something or the prune would delete something. 3 when it would stop: a refused write, a refused prune delete, or a stateful migration without --accept-migrations. 0 means the deploy would change and delete nothing.
kix deploy --plan4 when the reviewed plan no longer matches the plan made now; nothing is applied. With --dry-run, 3 when it matches but the deploy would stop (a refused write, or a migration not accepted), and 0 when it matches and would not. See Deploy a reviewed plan.
kix check1 when any step reports fail: cluster evaluation, which includes error-level scorecard findings, or the scorecard report. Applies with --sarif too.
kix deploy1 when a resource operation fails (under --on-error continue too, and including a prune delete) or the run is stopped or cancelled, when the plan shows a refused write under --on-error stop, when stateful migrations are detected without --accept-migrations, or when confirmation is needed on a non-interactive terminal without --yes. With --operator, a Degraded, Failed, or unexpectedly Superseded Activation and a 10-minute wait timeout also exit 1.
kix rollback1 when the rollback fails, including a failed prune delete or, with --operator, a Degraded Activation, or when confirmation is needed on a non-interactive terminal without --yes.
kix gc1 when any deletion fails, or when confirmation is needed on a non-interactive terminal without --yes.
kix migrate domain1 when confirmation is needed on a non-interactive terminal without --yes.
kix health1 when any package is not healthy.
kix drift1 when any resource has drifted. Unstamped resources do not count.
kix pin check1 when a pin fails or, with --source-rev, records a different source revision. Warnings do not fail.
kix logs, kix pfkubectl’s exit status. Kix replaces itself with kubectl once the workload is found.

Answering no to a confirmation prompt (deploy, rollback, gc, migrate domain) exits 0 without changing anything.

A kix diff or kix plan in CI cannot tell a difference from a usage error by the code alone. Check that the command line is valid in a step that does not branch on 2, or read the JSON output.