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
- Detect install method — determines whether
niawas installed as a standalone binary, via the install script, or through a package manager (Homebrew, apt, dnf, winget, Scoop, Chocolatey). - 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 = truein[update_check]to install the newest release even when it’s a pre-release (see Update Check Configuration). Requesting an exact--versionalways installs that version regardless of this setting. - Download — fetches the release asset into a temporary staging file alongside the current binary.
- Verify — checks the downloaded asset’s SHA-256 checksum against the published value.
- Smoke test — runs the staged binary with
--versionto confirm it starts correctly before it replaces anything. - 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 via | Update with |
|---|---|
| Install script / standalone binary | nia update |
.deb (apt) | sudo apt update && sudo apt install --only-upgrade nia |
.rpm (dnf) | sudo dnf upgrade nia |
| Homebrew | brew 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
| Code | Meaning |
|---|---|
0 | Update succeeded, or the installation was already current |
| non-zero | The 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.
Related
- Update Check Configuration — the
auto_updateandinclude_prereleasesettings and the automatic update-availability notice - Installation Guide