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.
1Error: × [K2184] `kix list clusters` cannot print sarif output.2 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.
Formats each command prints
Section titled “Formats each command prints”The first format listed is the default.
| Command | Formats |
|---|---|
build | yaml (one document per manifest), json (one array) |
check | text, json, yaml, sarif (SARIF 2.1.0, for code scanning) |
graph | tree, dot (Graphviz), json, yaml |
diff, plan --read-only | text, json, yaml (the Plan document), markdown (for pull request comments) |
plan, deploy --dry-run | text, markdown. A plan kept as data is a plan file (--out). |
deploy --plan FILE --dry-run | text, json, yaml (the comparison with the saved plan) |
list clusters, list packages, list resources, list images | text, json, yaml |
status | text, json, yaml |
history | text, json, yaml |
pin set, pin rm, pin check, pin list | text, json, yaml |
compliance sbom, compliance attest | json, yaml |
| Every other command | text |
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.
JSON Schemas
Section titled “JSON Schemas”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.
Colour
Section titled “Colour”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.