Reference / CLI
doctor
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 Kix version the project names in kix.toml and the versions of Kix 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 ignores -o / --output.
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 diff, 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 pf). |
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. A Kix minor release can change a Helm version in the Kix runtime. A patch release can only add one, so it still renders charts for a Kix library of an earlier patch in the same minor. After you upgrade Kix to a new minor release, runkix lib updateto alignflake.lockwith your installed Kix. 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 the kix setting.
After the builder checks, kix doctor reports the Kix version the project names and the versions installed in ~/.local/share/kix/ (or $XDG_DATA_HOME/kix/). Only the ✗ line changes the exit status:
| Line | Meaning |
|---|---|
✓ Project needs Kix 0.8 (<path>/kix.toml) | kix.toml sets kix = "0.8", and the running Kix matches. |
✗ Project needs Kix 0.9 (<path>/kix.toml), and this is Kix 0.8.4 | The running Kix does not match. Kix normally runs a matching version in its place, so this appears only when KIX_SELECTED_BY is set. |
! This project has no kix.toml. Add one with kix = "0.8" so everyone runs a matching Kix | The directory has a flake.nix and no kix.toml. |
! kix.toml sets no kix version. Add kix = "0.8" so everyone runs a matching Kix | kix.toml exists and does not name a Kix version. |
✓ 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. |
The two ! lines that suggest a kix value name the running Kix’s minor. A Kix older than 0.8 prints neither, since the setting cannot name it.
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.8.0 (/home/me/.local/share/kix/0.8.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 needs Kix 0.8 (/home/me/project/kix.toml)6✓ Installed versions: 0.8.0, 0.7.0 (/home/me/.local/share/kix)Verify 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 or sets an unsupported builder, or (whenbuilder = "nix")nixonPATHis missing, older than2.24, or Lix.