Reference / CLI
lib
kix lib manages the Kix library locked in your project’s flake.lock. Its update subcommand moves your locked Kix library revision to match the version of Kix you are running.
Synopsis
Section titled “Synopsis”1kix lib update [--dry-run] [--flake <FLAKE>]Why the Kix library and Kix versions stay aligned
Section titled “Why the Kix library and Kix versions stay aligned”When a cluster uses Helm charts (kix.helmChart, scope.helm.importChart, or scope.helm.importChartCrds), both the Kix library and Kix record the exact Helm 3 and Helm 4 versions used to render templates (kix/lib/helm-versions.json in the Kix library, and cli/kix-core/runtime/programs.json in Kix). Keeping those versions identical guarantees that helm template produces the same resource hashes on every machine.
If you upgrade Kix (or update flake.lock) and the two sides disagree on a Helm version, Kix stops before rendering the chart and prints a mismatch error telling you how to align them:
- If your installed Kix is newer than the Kix library revision in
flake.lock, runkix lib updateto moveflake.locktov<kix-version>. - If your
flake.lockis already ahead of your installed Kix, upgrade Kix to match the version reported in the error.
Flags (kix lib update)
Section titled “Flags (kix lib update)”| Flag | Default | Description |
|---|---|---|
--dry-run | false | Resolve github:kix-run/kix/v<version> and print the lockfile change that would occur without writing flake.lock. |
--flake <FLAKE> | . | Path to the flake directory containing flake.nix and flake.lock (also read from KIX_FLAKE). |
Global flags -v / --verbose, -q / --quiet, and --no-color also apply. -o / --output is ignored.
How kix lib update updates flake.lock
Section titled “How kix lib update updates flake.lock”kix lib update reads flake.lock and finds the input locked to github:kix-run/kix (or named kixpkgs or kix). If an input uses follows, Kix updates the declaring input. It then locks that input to github:kix-run/kix/v<version>.
It modifies only flake.lock and never edits flake.nix.
For this lockfile update to work cleanly, your flake.nix should declare kixpkgs as an unpinned GitHub input:
1{2 inputs.kixpkgs.url = "github:kix-run/kix";3}When kix lib update asks you to edit flake.nix instead
Section titled “When kix lib update asks you to edit flake.nix instead”kix lib update refuses to overwrite inputs that are pinned or non-standard in flake.nix, and prints instructions instead:
- Pinned tag, branch, or commit in
flake.nix(for example,github:kix-run/kix/v0.6.0):kix lib updatewill not silently override a ref written inflake.nix. Change the input URL inflake.nixtogithub:kix-run/kix/v<version>(or remove the/v...ref fromflake.nixsokix lib updatecan manage the version inflake.lock) and runkix lib updateagain. - Custom fork or Git URL: Point the input in
flake.nixatgithub:kix-run/kix/v<version>, or move that copy of Kix to thev<version>release. - The former address
github:kix-run/kixpkgs: the Kix library moved togithub:kix-run/kix, and the old repository gets no new releases. Point the input inflake.nixatgithub:kix-run/kix, then runkix lib updateagain. - Local
path:input: Point the input inflake.nixatgithub:kix-run/kix/v<version>, or check out thev<version>release in that local directory.
Examples
Section titled “Examples”Preview the lockfile change without writing flake.lock:
❱ kix lib update --dry-run 1Kix library: 0.6.0 -> 0.7.0. This was a dry run, so flake.lock is unchanged.Update flake.lock in the current directory:
❱ kix lib update 1Kix library: 0.6.0 -> 0.7.0. Commit flake.lock to share this with your team.When flake.lock already matches the installed Kix:
1Kix library is already 0.7.0.Exit status
Section titled “Exit status”0whenflake.lockis updated (or already at the target revision, or--dry-runsucceeds).1when the flake has nokixpkgsinput, whenflake.nixpins a ref, fork, orpath:input thatkix lib updatecannot update on its own, or when Kix cannot fetch the target release tag.