Skip to content
Install the CLI

Reference CLI

Exit codes

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 doctor1 when the runtime directory cannot be found, manifest.json does not match the compiled-in program versions, any file fails its SHA-256 check, kix.toml is invalid or sets an unsupported builder, or (when builder = "nix") nix on PATH is missing, older than 2.24, or Lix. Warnings and info lines do not fail.
kix lib update1 when the flake has no kixpkgs input, when flake.nix pins a ref, fork, or path: input that kix lib update cannot update on its own, or when Kix cannot fetch the target release tag.
kix upgrade2 when a cluster does not build, with the version the project used or with a release the upgrade tried. 3 when the project builds with the target and a person should read what changed: an object that changed in any cluster, a sensitive object change, a behavior or data change, or a release that every cluster must deploy first. See kix upgrade.
kix deploy (before it starts)1 when kix-upgrade.json lists a change to stored data that no one has acknowledged with kix upgrade --ack.
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.

When a project’s kix setting makes Kix run another installed version in its place, the exit status is that version’s. When no matching version is installed and Kix cannot install one, or KIX_AUTO_INSTALL=0 is set, Kix exits 1 before it runs the command. kix --version is the exception: it never installs, and exits 0 after it prints the running version and says the project’s version is not installed.

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.