Skip to content
Install the CLI

Reference CLI

check

These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.

kix check evaluates a cluster and reports the result of each validation step in a table. It does not contact a cluster. Use it as the local and CI gate before a deploy.

This page is hand-maintained. Check cli/kix-cli/src/cli.rs and cli/kix-cli/src/commands/check.rs when in doubt.

kix check <CLUSTER> [-o text|json|yaml|sarif] [--flake <FLAKE>]
[--override-input <INPUT> <URL>]... [--no-cache]
Argument or flagDefaultMeaning
<CLUSTER>Cluster name to evaluate.
-o, --outputtexttext prints a TOOL, RESULT, DETAILS table, then the scorecard findings. json and yaml print an array of { tool, result, details }. The scorecard entry also has findings, and so does the eval entry when there are library warnings or errors. sarif prints SARIF 2.1.0 JSON, described below.
--flake <FLAKE>.Flake to evaluate.
--override-input <INPUT> <URL>NoneOverride a flake input for the evaluation. Repeatable.
--no-cacheOffEvaluate from Nix instead of reading the eval cache.
ToolWhat it reports
evalpass with the number of manifests and of library warnings, or fail with the evaluation error. Evaluation runs the constructor validators, the cross-resource checks, and every error-severity scorecard rule, so a failure in any of them appears here.
scorecardThe counts of error, warning, and info findings. fail when there is at least one error, skip when the cluster does not enable the scorecard.

When eval fails, the scorecard step does not run, and the evaluation error is printed under the table.

Text output lists the error and warning findings under the table, grouped by rule. Add -v to list the info findings too.

The Kix library warns about problems that do not stop the build. For example, it warns when it skips a meta.compatibleWith check because a dependency reports no version, or when an instance cannot reach the availability you asked for. A package’s own warnings and its structural warnings are listed here too. When eval passes, text output lists these warnings under the table. Each starts with the instance it is about, such as monitoring/prometheus:, and shows the object, option, dependency, cluster option, or fix on a line of its own.

In json and yaml, the eval entry lists each warning in findings. A warning has the same fields as a library error, and severity is warning:

FieldMeaning
messageWhat is wrong.
instanceThe instance, as namespace/name. Missing for a warning about the whole cluster.
objectThe Kubernetes object, as kind, name, and an optional namespace.
option, dependency, clusterOptionWhat to change: a path in the instance’s config, the name of one of its deps, or a path in the cluster definition.
fixHow to fix it.
idThe change record id, such as K0001, for a warning about a coming change.

kix build, kix plan, kix deploy, and the other commands that build a cluster print the same warnings to stderr. A plan saved with kix plan --out or printed by kix diff -o json lists them in warnings, and kix plan -o markdown shows them in a section of their own.

Scorecard warnings are not repeated here. They appear only as scorecard findings.

kix check runs constructor validators, cross-resource checks, and scorecard rules. It does not validate rendered manifests against external Kubernetes OpenAPI schemas or check for deprecated API versions.

With -o sarif, each scorecard finding becomes a SARIF result with its rule ID, level (error, warning, or note), message, and a logical location of the form namespace/instance/resource. Each library warning becomes a warning result with the rule ID kix/library-warning. A cluster with no findings and no library warnings produces an empty run.

An error-severity finding stops evaluation, so there is no report to convert. Kix then writes the evaluation failure as one error result. Its rule ID is scorecard/<rule> when the error message names a scorecard rule, and kix/eval-failure otherwise.

❱ kix check demo
❱ kix check demo -o sarif > kix-results.sarif
CodeMeaning
0No step reported fail
1A step reported fail, or the cluster was not found. With -o sarif, a failed step exits 1 after printing the SARIF document, whereas an unknown cluster errors on stderr before printing any SARIF.