Skip to content
Install the CLI

How-to guide Debug dependency wiring

Inspect an instance's deps, parts, and out

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

Use the CLI for the rendered resource inventory and dependency graph. Use nix eval when you need the package author’s raw parts or exported out attributes.

Start with kix list resources:

kix-examples/ offline capture
❱ kix list resources how-to-application
Show outputHide output · 37 lines
Cluster: how-to-application
Total resources: 15

Namespaces (3):
  (cluster-scoped) (3 resources)
  how-to-app (10 resources)
  kube-system (2 resources)

Resource kinds:
 Kind                     Count 
 PackageInstance.kix.run  4     
 ConfigMap                3     
 Deployment.apps          2     
 Namespace                2     
 Service                  2     
 Activation.kix.run       1     
 Job.batch                1     

Resources:
  (cluster-scoped):
    Activation.kix.run/how-to-application-6n94gibgl7zv
    Namespace/how-to-app
    Namespace/kube-system
  how-to-app:
    ConfigMap/preview
    ConfigMap/production
    ConfigMap/production-health-script
    Deployment.apps/preview
    Deployment.apps/production
    Job.batch/production-health
    PackageInstance.kix.run/preview
    PackageInstance.kix.run/production
    Service/preview
    Service/production
  kube-system:
    PackageInstance.kix.run/platform-dns
    PackageInstance.kix.run/platform-storage

This output lists resources by namespace and kind. It does not show package parts, resolved dependency bindings, or out values.

Use kix graph to see the dependencies that affect deployment ordering:

kix-examples/ offline capture
❱ kix graph 08-namespace-deps -o tree
Show outputHide output · 55 lines
Namespace/app
├── Service/gateway@app
│   └── PackageInstance.kix.run/gateway@app
│       └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
├── ConfigMap/gateway@app
│   └── Deployment.apps/gateway@app
│       └── Service/gateway@app
│           └── PackageInstance.kix.run/gateway@app
│               └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
├── PackageInstance.kix.run/gateway@app
│   └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
└── Deployment.apps/gateway@app
    └── Service/gateway@app
        └── PackageInstance.kix.run/gateway@app
            └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
Namespace/kube-system
├── PackageInstance.kix.run/platform-storage@kube-system (import)
│   └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
└── PackageInstance.kix.run/platform-dns@kube-system (import)
    ├── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
    └── Deployment.apps/gateway@app
        └── Service/gateway@app
            └── PackageInstance.kix.run/gateway@app
                └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
Namespace/platform
├── Service/backend@platform
│   ├── ConfigMap/gateway@app
│   │   └── Deployment.apps/gateway@app
│   │       └── Service/gateway@app
│   │           └── PackageInstance.kix.run/gateway@app
│   │               └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
│   └── PackageInstance.kix.run/backend@platform
│       └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
├── ConfigMap/backend@platform
│   └── Deployment.apps/backend@platform
│       └── Service/backend@platform
│           ├── ConfigMap/gateway@app
│           │   └── Deployment.apps/gateway@app
│           │       └── Service/gateway@app
│           │           └── PackageInstance.kix.run/gateway@app
│           │               └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
│           └── PackageInstance.kix.run/backend@platform
│               └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
├── PackageInstance.kix.run/backend@platform
│   └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
└── Deployment.apps/backend@platform
    └── Service/backend@platform
        ├── ConfigMap/gateway@app
        │   └── Deployment.apps/gateway@app
        │       └── Service/gateway@app
        │           └── PackageInstance.kix.run/gateway@app
        │               └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
        └── PackageInstance.kix.run/backend@platform
            └── Activation.kix.run/08-namespace-deps-ym98x1qqrw9z
14 resources, 22 dependencies

The graph is built from rendered manifests. It includes references carried by resource values and explicit requires or extraDeps edges. A package build argument by itself does not create an edge; the edge appears when a resource uses an output from that dependency.

Use -o json when you need the machine-readable list of nodes and edges:

kix-examples/
❱ kix graph how-to-application -o json

kix.mkFlake exposes evaluated clusters under legacyPackages.<system>.kixClusters (flakes that call buildCluster directly without mkFlake do not define this output unless they export the evaluated cluster themselves). The instance’s raw attribute is the parts attrset returned by its package build function.

List the parts without forcing every resource into JSON:

kix-examples/
❱ system=$(nix eval --impure --raw --expr builtins.currentSystem)
❱ nix eval --json ".#legacyPackages.${system}.kixClusters.how-to-application" --apply 'cluster: builtins.attrNames cluster.instances."how-to-app".production.raw'

For the example instance, the result includes content, deployment, service, healthCheck, and root. Use a quoted attribute name whenever a namespace or instance name contains a hyphen.

List the public values on the package root:

kix-examples/
❱ system=$(nix eval --impure --raw --expr builtins.currentSystem)
❱ nix eval --json ".#legacyPackages.${system}.kixClusters.how-to-application" --apply 'cluster: builtins.attrNames cluster.instances."how-to-app".production.out'

Then evaluate one serializable value directly:

kix-examples/
❱ system=$(nix eval --impure --raw --expr builtins.currentSystem)
❱ nix eval --raw ".#legacyPackages.${system}.kixClusters.how-to-application" --apply 'cluster: cluster.instances."how-to-app".production.out.name'

Some out attributes are functions or carry Nix string context, so the whole attrset may not serialize. List its keys first, then evaluate the scalar value you need.