Skip to content
Install the CLI

Reference CLI

export

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

kix export builds the cluster’s activation and writes each resource to its own YAML file. It does not contact a cluster. By default it writes plain Kubernetes YAML with no Kix annotations or Kix-internal resources, which kubectl, Flux, or Argo CD can apply. With --with-kix-metadata it 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>] [--with-kix-metadata] [--force]
[--flake <FLAKE>]
Argument or flagDefaultMeaning
<CLUSTER>Cluster name to build.
--out <DIR>./kix-exportDirectory to write.
--with-kix-metadataOffKeep the kix.run/* annotations and Kix’s own records. See What is kept.
--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.

kix.run/* annotationsActivation and PackageInstance resources
DefaultRemovedSkipped
--with-kix-metadataKept, including the identity hash and package stamps a deploy writesWritten

Every export drops null fields and writes keys in sorted order. Labels are written unchanged.

Each resource is written to <DIR>/<namespace>/<Kind>-<name>.yaml. Cluster-scoped resources go under <DIR>/_cluster/. An export written with --with-kix-metadata is a valid baseline for kix diff --from; a default 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 --with-kix-metadata --out evidence/ --force

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