Skip to content
Install the CLI

Reference CLI

Output formats

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

The global -o/--output flag takes text, json, yaml, markdown, sarif, dot, or tree. Each command prints some of these formats and has its own default. A format the command does not print is an error: Kix stops before the command runs, exits 1, and lists the formats the command prints. The --help of a command lists the same formats, and names the flags a format needs, such as --read-only for kix plan -o json.

Error: × [K2184] `kix list clusters` cannot print sarif output.
help: Use -o text, -o json, or -o yaml.

Add -q when a script parses the result, so that progress lines do not mix with it.

The first format listed is the default.

CommandFormats
buildyaml (one document per manifest), json (one array)
checktext, json, yaml, sarif (SARIF 2.1.0, for code scanning)
graphtree, dot (Graphviz), json, yaml
diff, plan --read-onlytext, json, yaml (the Plan document), markdown (for pull request comments)
plan, deploy --dry-runtext, markdown. A plan kept as data is a plan file (--out).
deploy --plan FILE --dry-runtext, json, yaml (the comparison with the saved plan)
list clusters, list packages, list resources, list imagestext, json, yaml
statustext, json, yaml
historytext, json, yaml
pin set, pin rm, pin check, pin listtext, json, yaml
compliance sbom, compliance attestjson, yaml
Every other commandtext

A plugin (kix NAME) gets the format as its first two arguments, --output FORMAT, and decides for itself.

deploy without --dry-run prints its progress as text. Its --log-format pretty|line|json|tui flag picks how; see kix deploy.

The JSON and YAML output of most commands has a JSON Schema in cli/kix-cli/schema/ in the Kix repository, one file per command, such as check.schema.json and list-packages.schema.json. kix diff and kix plan --read-only print the document plan.schema.json describes. A new release may add fields, so a program that reads the output must skip fields it does not know. compliance sbom prints CycloneDX and compliance attest prints an in-toto statement, which their own specifications describe.

Text output is coloured when stdout is a terminal. --no-color, a set NO_COLOR, or TERM=dumb turns it off. JSON and YAML output are never coloured. Deploy and gc progress lines currently still contain terminal clear-line control sequences with --no-color; redirecting stderr may therefore preserve those sequences.