Reference / CLI
list
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
kix list reads the flake and prints what it defines: its clusters, its
packages, or the resources and container images one cluster renders. It does
not contact a cluster. Use it to find the names other commands accept, to
confirm what a cluster contains before reading the full manifests with
kix build, and to collect the images an
environment without registry access needs.
This page is hand-maintained. Check cli/kix-cli/src/cli.rs and
cli/kix-cli/src/commands/list/ when in doubt.
Synopsis
Section titled “Synopsis”1kix list clusters [-o text|json|yaml] [--flake <FLAKE>] [--no-cache]2kix list packages [<CLUSTER>] [-o text|json|yaml]3 [--flake <FLAKE>] [--no-cache]4kix list resources <CLUSTER> [-o text|json|yaml]5 [--flake <FLAKE>] [--no-cache]6kix list images <CLUSTER> [--sources] [-o text|json|yaml]7 [--flake <FLAKE>] [--no-cache]| Argument or flag | Default | Meaning |
|---|---|---|
<CLUSTER> | Cluster name to evaluate. Optional for list packages, where it adds a status column. | |
--sources | Off | list images only. In text output, list under each image the resources that reference it. |
-o, --output | text | text prints a table or summary. json and yaml print the same data as one document. |
--flake <FLAKE> | . | Flake to read. |
--no-cache | Off | Read from Nix instead of the eval cache. |
list clusters
Section titled “list clusters”Prints a NAME column with every cluster registered with kix.lib.mkFlake,
read from legacyPackages.<system>.kixClusters.
When the project’s kix.toml
has a [versions] table, text output adds KIX and INPUT columns:
1 NAME KIX INPUT2 dev - not listed in [versions]3 prod 0.12.3 kix-stable4 staging 0.14.2 kixKIX shows the release version pinned for the cluster’s input in flake.lock,
development when the input points to a local folder or branch, or unknown
when flake.lock has no version for that input. A cluster missing from
[versions] shows - and not listed in [versions].
JSON and YAML output are unchanged: an array of cluster names. A flake with no
clusters prints No clusters found in this flake. on stderr.
list packages
Section titled “list packages”Without a cluster, lists every package the flake exposes in
legacyPackages.<system>.kixPackages, with NAME and VERSION columns.
Experimental packages are listed as experimental.<name>.
With a cluster, lists the cluster’s instances and the packages it could
install, with a STATUS column:
| Status | Meaning |
|---|---|
installed [<namespace>] | An instance declared in the cluster |
installed (auto) [<namespace>] | An instance added by auto-instantiation |
import [<namespace>] | An instance that stands for resources Kix does not manage |
available | A package the cluster can use but has not instantiated |
Rows are sorted by name, then by namespace. Each cluster instance gets its own
row, so two instances with the same name in different namespaces appear
separately. An OWNER column appears when any package declares an owner; the
rest show -. JSON entries have name, version, owner, and package,
plus status and isImport with a cluster. For built-in Kix packages,
package is the package ID used in release notes, such as harbor or
experimental/coredns. For custom packages and imports, package is null.
An empty result prints No packages found. on stderr.
list resources
Section titled “list resources”Evaluates the cluster and prints an inventory of its rendered resources. Text output has four parts:
- The cluster name and total resource count.
- Each namespace with its resource count. Cluster-scoped resources are
listed as
(cluster-scoped). - A table of resource kinds, most frequent first.
- Every resource as
Kind.group/name(orKind/namefor corev1kinds), grouped by namespace and sorted by kind, group, and name.
JSON and YAML output is an object with cluster, totalResources,
namespaces (each { name, resources: [{ kind, group, name }] }, omitting
group for core v1 kinds), and kindCounts (counts keyed by Kind.group,
or Kind for core v1 kinds). Cluster-scoped resources are under the
namespace name _cluster.
kix list resources reports rendered resources only. To see dependency
edges, use kix graph.
list images
Section titled “list images”Evaluates the cluster and lists the container images it needs. Use the list to pull, mirror, or preload images before deploying to an environment without registry access.
Kix reads the image of every container, init container, and ephemeral
container in Pods and in the pod templates of Deployments, StatefulSets,
DaemonSets, ReplicaSets, Jobs, and CronJobs. It adds the images a package
declares in out.extraImages, which cover pods an operator creates at run
time.
Text output prints one image reference per line. Each reference appears
once, sorted, exactly as written in the manifests: a tag, a digest, or both.
With --sources, the resources that reference each image follow it, as
Kind namespace/name (container: <name>). A cluster with no images prints
No container images found.
JSON and YAML output is an array of { image, sources }, whatever
--sources says. Each entry in sources has kind, namespace, name, and
container. Cluster-scoped sources have the namespace _cluster.
Examples
Section titled “Examples”❱ kix list clusters❱ kix list packages demo❱ kix list resources demo -o json❱ kix list images demo --sources❱ kix list images demo | xargs -n1 docker pull❱ kix --flake ../infra list clusters -o json Exit status
Section titled “Exit status”0 on success, including an empty list. 1 when the flake cannot be
evaluated or the cluster does not exist.