Reference / CLI
doctor
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
kix doctor inspects the Kix runtime that Kix uses to run Nix, Helm, kubectl, and sops, and checks the project’s builder setting in kix.toml. It confirms that every program in the Kix runtime matches the version compiled into Kix, checks the SHA-256 hash of every file and symlink target in manifest.json, and, when the project uses builder = "nix", verifies the machine’s nix installation. It also reports the project’s Kix version from flake.lock, checks each input in [versions] when kix.toml defines that table, and lists the Kix versions installed for kix self.
Synopsis
Section titled “Synopsis”1kix doctor [--flake <FLAKE>]kix doctor takes no command-specific flags, reads --flake (default .) to find kix.toml, and prints only text: any -o value other than text is refused.
How Kix locates its runtime
Section titled “How Kix locates its runtime”When kix starts, it resolves its runtime directory (libexec/kix) using the first match in this order:
KIX_RUNTIME_DIR, when set to a non-empty value. (An emptyKIX_RUNTIME_DIR=""is ignored.)KIX_RUNTIME_DIRis used even if the directory has nomanifest.json, so you can test custom tool builds.../libexec/kixnext to thekixcommand (after resolving symlinks to the binary), when that directory containsmanifest.json. Because Kix resolves symlinks on thekixexecutable first, symlinking~/.local/bin/kixto an unpackedbin/kixstill finds the siblinglibexec/kix/.- The compiled-in runtime path (
KIX_BUILTIN_RUNTIME_DIR), when that directory containsmanifest.json. This is used whenkixis built through Nix (nix runornix profile install).
On normal commands (kix check, kix plan, kix deploy), kix reads <runtime>/manifest.json (when present) and verifies that the program set and version strings match what the binary expects. kix doctor goes further and hashes every file and symlink target listed in manifest.json to detect corrupted or incomplete installations.
Programs in the Kix runtime
Section titled “Programs in the Kix runtime”Each build of Kix is compiled against the exact tool versions in cli/kix-core/runtime/programs.json:
| Program | Version(s) in the Kix runtime | Used by Kix for |
|---|---|---|
nix | 2.35.4 | Evaluating cluster flakes and storing rendered manifests in Kix’s local store ($XDG_CACHE_HOME/kix/store or ~/.cache/kix/store, overridden by KIX_STORE_ROOT). |
helm | 4.3.1 (default), 3.19.1 | Fetching Helm chart tarballs (fetchHelmChart) and rendering templates (importChart). |
kubectl | 1.37.2 | Streaming workload logs (kix logs) and forwarding local ports (kix port-forward). |
sops | 3.12.1 | Decrypting SOPS-encrypted secrets (kix.mkSopsSecret) during kix deploy. |
Version update policy
Section titled “Version update policy”- Patch and minor updates: A patch update of a program in the Kix runtime (for example,
2.35.3to2.35.4) can ship in a Kix patch release. A minor update of a program in the Kix runtime ships in a Kix minor release. - Helm version alignment: Kix ships both Helm 4 (
4.3.1, the default) and Helm 3 (3.19.1, upstream security fixes until 10 February 2027). Becausehelm templateoutput feeds into resource identity hashes (kix.run/identity-hash), the Kix library and Kix both name the exact Helm versions. Each cluster runs the version of Kix that matches its Kix library, so the two always agree.kix upgradeupdates the Kix library tag inflake.nixandflake.lockso Kix and the Kix library stay on the same version. See Helm and imports.
Third-party licenses and LGPL components
Section titled “Third-party licenses and LGPL components”The release archive ships libexec/kix/THIRD_PARTY_LICENSES alongside the programs in the Kix runtime, and each GitHub release publishes a companion kix-<version>-third-party-sources.tar.zst archive containing the exact upstream source tarballs and nixpkgs patches for the LGPL components (nix, libseccomp, libidn2, libunistring, acl, attr, and gettext / libintl, plus the nix-*-c shared libraries on macOS).
On Linux, the nix in the Kix runtime is statically linked against musl, so the runtime contains no shared libraries. On macOS, nix links against private .dylib files in libexec/kix/nix-<version>/lib/ via @loader_path.
To run kix with your own build of an LGPL component:
- Copy
libexec/kix/to a writable directory and replace the binary (or on macOS, the.dylibfile insidenix-<version>/lib/). - Point
KIX_RUNTIME_DIRat your modified directory.
Normal kix commands check only the program names and versions in manifest.json (or skip the check if you remove manifest.json), so your modified build will run as expected. kix doctor reports the replaced file as changed if manifest.json is still present with the original hashes.
Kix version checks
Section titled “Kix version checks”The first line names the running Kix and its path. When another Kix chose it for a project (KIX_SELECTED_BY is set), the line also names that Kix. See Choose the version of Kix for a project.
After the builder checks, kix doctor reports the version of Kix the project uses, from the tag of the kix input in flake.lock, and the versions installed in ~/.local/share/kix/ (or $XDG_DATA_HOME/kix/). Only the ✗ lines change the exit status:
| Line | Meaning |
|---|---|
✓ Project uses Kix 0.10.0 (flake.lock) | The kix input in flake.lock pins v0.10.0, and the running Kix is 0.10.0. |
✗ Project uses Kix 0.10.1 (flake.lock), and this is Kix 0.10.0 | The running Kix does not match. The detail line says to run kix self install 0.10.1, then kix doctor again. Kix normally runs the project’s version in its place, so this appears only when KIX_SELECTED_BY is set. |
✓ Project uses a development Kix library (<what>) | The kix input is a local folder, a branch, or an input replaced with --override-input kix, or the project is the Kix repository. Kix compares no versions. |
✗ Project's version of Kix: unknown | Kix cannot read the project’s version from flake.lock. The detail line gives the reason, such as a missing flake.lock or a kix input with no tag. |
✓ Input <input> pins Kix <version>, used by <clusters> | Printed for each input when kix.toml defines [versions]. If the input is a local folder or follows a branch, prints uses a development Kix library (<what>). When no clusters use the input, ends with used by no clusters. |
✗ kix.toml [versions] does not match flake.lock | An input in [versions] is missing from flake.nix, not locked in flake.lock, or pins a newer release than kix. The detail line shows how to fix it. |
✗ kix.toml [versions] is invalid | The [versions] table breaks a rule in kix.toml, such as listing a cluster under two inputs. The detail line shows how to fix it. |
! Git does not track flake.lock, so other clones of this project can run another version of Kix. Run git add flake.lock and commit it. | The project is in Git, and Git does not track flake.lock. |
✓ Installed versions: 0.8.4, 0.8.0 (<directory>) | The versions that kix self list shows. |
! No versions installed under <directory> | The running Kix was not installed there, for example because it was installed with Nix or unpacked from a release archive by hand. |
! No versions installed. Kix cannot find a home directory to install into. Set HOME or XDG_DATA_HOME. | Neither HOME nor XDG_DATA_HOME is set. |
Project builder checks
Section titled “Project builder checks”After checking the Kix runtime, kix doctor reads kix.toml in the directory named by --flake (default .) and reports which builder the project uses (kix or nix) and where that setting came from.
If kix.toml cannot be read, contains invalid TOML, sets an unknown key or builder name, or sets builder = "remote", kix doctor prints a ✗ line and exits 1.
When the project uses builder = "nix", kix doctor also inspects the nix installation on PATH:
- Nix version (
✓or✗): Runsnix --versionand verifies thatnixis upstream Nix (not Lix) at version2.24or later. A missingnix, a version older than2.24, or Lix prints✗and exits1. - Helm charts (
✓or!): Runsnix config showand checks thatallow-import-from-derivationistrue, so Nix can render Helm charts. If it isfalseor cannot be read,kix doctorprints a!line with the fix, and the exit status does not change.
Examples
Section titled “Examples”Verify a healthy installation in a project using the default kix builder:
❱ kix doctor 1✓ Kix 0.10.0 (/home/me/.local/share/kix/0.10.0/bin/kix)2✓ Kix runtime: helm 3.19.1, helm 4.3.1, kubectl 1.37.2, nix 2.35.4, sops 3.12.13✓ Kix runtime is intact4✓ Builder: kix (default)5✓ Project uses Kix 0.10.0 (flake.lock)6✓ Installed versions: 0.10.0, 0.9.2 (/home/me/.local/share/kix)In a project with a [versions] table in kix.toml, kix doctor adds one line for each input:
1✓ Project uses Kix 0.14.2 (flake.lock)2✓ Input kix pins Kix 0.14.2, used by staging3✓ Input kix-stable pins Kix 0.12.3, used by prodVerify a project that sets builder = "nix" in kix.toml:
❱ kix doctor 1✓ Kix 0.6.02✓ Kix runtime: helm 3.19.1, helm 4.3.1, kubectl 1.37.2, nix 2.35.4, sops 3.12.13✓ Kix runtime is intact4✓ Builder: nix (set in ./kix.toml)5✓ Nix 2.28.3 (from PATH)6✓ Nix can render Helm chartsA changed or missing file fails the check, and the fix follows the list:
1✓ Kix 0.6.02✓ Kix runtime: helm 3.19.1, helm 4.3.1, kubectl 1.37.2, nix 2.35.4, sops 3.12.13✗ Kix runtime is damaged: 1 file changed since install4 sops-3.12.1/bin/sops (contents changed)5 Reinstall Kix from its release archive, unless you changed these files yourself.6✓ Builder: kix (default)7Error: × 1 check failedEach line starts with ✓ (passed), ! (a warning that does not fail the command), or ✗ (failed). The runtime’s location appears only when KIX_RUNTIME_DIR sets it.
Exit status
Section titled “Exit status”0when the runtime directory andkix.tomlare valid (including whenKIX_RUNTIME_DIRpoints to a custom runtime directory with nomanifest.json, which prints a!line) and, forbuilder = "nix"projects,nixonPATHis upstream Nix2.24or later. Warnings (!lines, such asallow-import-from-derivationbeing off) do not change the exit status.1when the runtime directory cannot be found,manifest.jsonis unreadable or disagrees with the programs Kix expects, any file listed inmanifest.jsonis missing or fails its SHA-256 or symlink check,kix.tomlis invalid, sets an unsupported builder, or has an invalid or mismatched[versions]table, Kix cannot read the project’s version of Kix fromflake.lockor is not that version, or (whenbuilder = "nix")nixonPATHis missing, older than2.24, or Lix.