Skip to content
Install the CLI

Reference CLI

self

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

kix self manages the versions of Kix installed in ~/.local/share/kix/ (or $XDG_DATA_HOME/kix/). Each version is an unpacked release archive in its own directory, ~/.local/share/kix/<version>/. The install script puts versions there, and so does Kix when a project’s flake.lock names a version of Kix that is not installed.

kix self always runs in the version of Kix you typed, whatever version the project’s flake.lock names. It reads no flake and contacts no cluster.

kix self install <VERSION>
kix self list
kix self prune [--keep <N>] [--dry-run]
kix self upgrade

Installs a version of Kix from kix.run. <VERSION> is a minor, such as 0.8, which installs the newest patch release of that minor, or an exact version, such as 0.8.3. A minor never installs a prerelease. Name a prerelease in full to install it, such as kix self install 0.9.0-rc.1.

Kix fetches the release index from https://kix.run/releases/index.json, verifies its Ed25519 signature against a built-in key, and checks that the index is current. Next, it verifies the release’s SHA256SUMS signature against a built-in release key, downloads the release archive for this platform, verifies its SHA-256 checksum, and unpacks it. Kix installs the version only after every check passes:

❱ kix self install 0.8
Installed Kix 0.8.4 to /home/me/.local/share/kix/0.8.4

Kix refuses to install a release when:

ConditionMessage
The release index has no signature file[K5221] the release index from <source> has no signature file (/releases/index.json.sig), so Kix cannot verify it. Kix installed nothing. If you set KIX_RELEASE_SOURCE to a mirror, copy releases/index.json.sig alongside releases/index.json
The index signature is invalid, or the index is expired, future-dated, or older than the saved copyKix refused the release index from <source> and installed nothing: <reason>
No release matches for this platformno Kix <version> release exists for <system>. The newest release is <latest>
The release has no signatureKix <version> has no release signature, so Kix cannot verify it
The signature does not verifythe release signature for Kix <version> does not verify against any key built into Kix <running>. Kix did not install it. Report this at https://github.com/kix-run/kix/issues
The archive does not match SHA256SUMSdownloaded kix-<system>.tar.gz does not match SHA256SUMS (expected <a>, got <b>)
kix.run cannot be reachedcould not reach <source>: <error>. Set KIX_AUTO_INSTALL=0 to stop Kix from installing versions, and install Kix <version> with the install script
Neither HOME nor XDG_DATA_HOME is setKix cannot find a home directory to install into. Set HOME or XDG_DATA_HOME.

A minor version such as 0.8 requires a current index and never selects a withdrawn release. An exact version such as 0.8.3 uses the index only to locate the release files, which Kix still verifies against the release’s signed SHA256SUMS. As long as the index signature is valid, an exact version installs with a warning even if the index is out of date or the version was withdrawn, so a project pinned to a withdrawn release can still run kix upgrade.

When two commands install the same version at once, the one that finishes second finds it installed and uses it.

Lists the installed versions, newest first. * marks the running Kix, and (on PATH) marks the version that the first kix on PATH runs:

❱ kix self list

Removes old versions. It keeps the newest versions (two unless you pass --keep), the running Kix, and the version that the first kix on PATH runs, and prints each version it removes.

FlagDefaultDescription
--keep <N>2How many of the newest versions to keep.
--dry-runfalsePrint the versions that would be removed, and remove nothing.

If flake.lock pins a removed version for a project or cluster, Kix installs it again automatically the next time a command needs it, unless KIX_AUTO_INSTALL=0 is set.

When the install script installed the running Kix, installs the newest release for this machine and moves the kix link the script made to it (~/.local/bin/kix, or the directory KIX_INSTALL_DIR named):

Kix 0.8.3 -> 0.8.4

When the running Kix is already the newest release, it prints Kix <version> is the newest release and changes nothing. A release never upgrades to a prerelease. A prerelease upgrades to a newer prerelease of the same release, such as 0.9.0-rc.1 to 0.9.0-rc.2, or to the newest release.

When the install script did not install the running Kix, it changes nothing, says how to upgrade instead, and exits with status 1, for example:

Kix 0.8.3 at /home/me/.nix-profile/bin/kix was not installed by the install script. Upgrade it the way you installed it, for example with nix profile upgrade kix

Kix knows the install script installed it, and which link it made, from ~/.local/share/kix/receipt.json, which the script writes.

VariableEffect
XDG_DATA_HOMEVersions are installed under $XDG_DATA_HOME/kix/ in place of ~/.local/share/kix/.
KIX_AUTO_INSTALL0, false, or no stops Kix from downloading a version on its own when a project needs one. kix self install still downloads.
KIX_RELEASE_SOURCESite with the same layout as https://kix.run, such as an internal mirror. Kix fetches the release index, SHA256SUMS, signatures, release archives, and release notes from it, and verifies every file against Kix’s built-in signing keys. Copy releases/index.json and releases/index.json.sig together and refresh both at least once a week, because each index expires seven days after kix.run signs it.
  • 0 when the command succeeds.
  • 1 when a release cannot be found, downloaded, or verified, when a version cannot be removed, or when kix self upgrade runs in a Kix the install script did not install.