Skip to content
kix /docs
Install the CLI

Reference CLI

export

Build a cluster and write every manifest as plain Kubernetes YAML, one file per resource, either without Kix annotations or with them kept for audit.

kix export builds the cluster’s activation and writes each resource to its own YAML file. It does not contact a cluster. The default exit mode produces YAML with no Kix annotations or Kix-internal resources, which kubectl, Flux, or Argo CD can apply. The audit mode keeps everything as evidence of what Kix would deploy.

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

kix export <CLUSTER> [--out <DIR>] [--for exit|audit] [--force]
[--flake <FLAKE>]
Argument or flagDefaultMeaning
<CLUSTER>Cluster name to build.
--out <DIR>./kix-exportDirectory to write.
--for <MODE>exitexit or audit. See Modes.
--forceOffReplace an existing output directory. See Overwriting.
--flake <FLAKE>.Flake to build.

-o has no effect. Progress and the summary line go to stderr; -q hides them. See Global flags for --override-input.

Modekix.run/* annotationsActivation and PackageInstance resources
exitRemovedSkipped
auditKept, including the identity hash and package stamps a deploy writesWritten

Both modes drop null fields and write keys in sorted order. Labels are written unchanged in both modes.

Each resource is written to <DIR>/<namespace>/<Kind>-<name>.yaml. Cluster-scoped resources go under <DIR>/_cluster/. An audit export is a valid old side for kix diff --from; an exit export is not, because the diff needs the Kix annotations.

Without --force, an existing output directory is an error. With --force, Kix deletes the directory and writes it again, so files from an earlier export do not linger. It refuses when the directory holds anything other than subdirectories and .yaml files, or a symlink, and names the first such entry.

❱ kix export demo --out handoff/
❱ kubectl diff --server-side -R -f handoff/
❱ kix export demo --for audit --out evidence/ --force

0 on success, 1 when the build fails or the output directory cannot be written or replaced.