Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Update Command

nia update upgrades your nia installation to the latest published release (or a specific version you request) in place, using the same verified, atomic path that automatic updates use. It never leaves your existing installation in a broken state, and it never asks you to delete anything by hand.

Usage

nia update                    # install the latest stable release
nia update --check            # report current vs. latest, change nothing
nia update --version 4.5.0    # install a specific published version
nia update --force             # reinstall even if already current

How It Works

  1. Detect install method — determines whether nia was installed as a standalone binary, via the install script, or through a package manager (Homebrew, apt, dnf, winget, Scoop, Chocolatey).
  2. Resolve the release — looks up the latest (or requested) release and the matching platform asset from GitHub Releases. By default only stable releases are considered; set include_prerelease = true in [update_check] to install the newest release even when it’s a pre-release (see Update Check Configuration). Requesting an exact --version always installs that version regardless of this setting.
  3. Download — fetches the release asset into a temporary staging file alongside the current binary.
  4. Verify — checks the downloaded asset’s SHA-256 checksum against the published value.
  5. Smoke test — runs the staged binary with --version to confirm it starts correctly before it replaces anything.
  6. Atomic swap — renames the verified, smoke-tested binary into place.

If any step fails, your existing nia installation is left completely unchanged.

Package Manager Installations

If nia was installed by a package manager, nia update does not attempt to replace the binary itself — it tells you the exact command to run instead:

Installed viaUpdate with
Install script / standalone binarynia update
.deb (apt)sudo apt update && sudo apt install --only-upgrade nia
.rpm (dnf)sudo dnf upgrade nia
Homebrewbrew upgrade nia

Permissions

If the install directory (commonly /usr/local/bin) is not writable by your user, run sudo nia update. Alternatively, reinstall to a directory you own, for example with --install-dir "$HOME/.local/bin" on the install script.

Exit Codes

CodeMeaning
0Update succeeded, or the installation was already current
non-zeroThe update failed; the previous installation is untouched

Troubleshooting

Integrity check failed

The downloaded asset’s checksum did not match the published value. Re-run nia update. If the problem persists, download the release manually from the GitHub Releases page and verify the checksum yourself before installing.

Permission denied

The install directory is not writable by the current user. Re-run with sudo nia update, or reinstall to a user-writable directory (see Permissions above).

Rate limited

GitHub’s API returned a rate-limit response. Wait a few minutes and try again, or install using the install script, which uses the same public release assets.