Skip to Content
CLI Referencenkapp update

nkapp update

Updates the Nanokit CLI to the latest version published on npm.

nkapp update # check + install the latest @nkapp/cli nkapp update --check # only report whether a newer version exists

Aliases: nkapp upgrade, nkapp self-update.

Under the hood it queries the npm registry, and if a newer version exists runs npm install -g @nkapp/cli@latest. If it’s already current, it says so.

Update notifier

Every command also runs a non-blocking update check: it never delays your command (the registry lookup happens in a detached background process and only a small local cache is read on the hot path). When a newer version is known, a short notice is printed to stderr:

Update available 1.2.0 → 1.3.0 Run `nkapp update` to upgrade (or `npm i -g @nkapp/cli`).

The notifier is silent in non-interactive contexts: CI, inside Nanokit containers (NANOKIT_CONTAINER), local development builds of the CLI, non-TTY output, and when explicitly disabled.

Auto-update (on by default)

The CLI auto-updates by default: when a newer version is already known from the cache (no network on the hot path), it installs it automatically before running your command. Auto-update is skipped for local development builds, in CI, inside Nanokit containers, and during tests. Opt out with:

export NANOKIT_AUTO_UPDATE=0 # or NANOKIT_NO_AUTO_UPDATE=1

With auto-update off, you still get the notice and can run nkapp update manually.

Configuration

VariableEffect
NANOKIT_AUTO_UPDATE0/false/offdisable the default auto-update (notice still shown).
NANOKIT_NO_AUTO_UPDATEAny value → disable auto-update.
NANOKIT_NO_UPDATE_NOTIFIER1 → disable the update notice too.
NO_UPDATE_NOTIFIERStandard opt-out, also honored.

nkapp doctor also reports whether your CLI is up to date (using the same cache).

[!NOTE] The check is cached for 24h in ~/.nanokit/update-cache.json, so at most one background registry lookup per day.