Nyzhi can update itself. It checks for new versions periodically, downloads the latest binary, backs up the old one, and verifies the new version works — all without leaving your terminal.
Checking for Updates
Nyzhi checks for updates automatically every 4 hours (configurable). To check manually:
nyz update
If a new version is available, it downloads and installs it.
Forcing an Update
Skip the version check and reinstall:
nyz update --force
Configuration
[update]
enabled = true # enable auto-update checks
check_interval_hours = 4 # how often to check (hours)
release_url = "https://get.nyzhi.com" # update server
Security:
release_urlcan only be set in the global config (~/.config/nyzhi/config.toml). Project configs cannot override it — this prevents supply chain attacks via repository config files.
How Updates Work
When an update runs:
- Throttle check — skips if checked recently (based on
update-check.json) - URL validation — ensures the release URL is HTTPS and not a cloud metadata endpoint
- Fetch version — downloads version metadata from
<release_url>/version - Compare — compares semantic versions
- Download — downloads the platform-specific binary
- Backup — saves the current binary before replacing it
- Replace — installs the new binary
- Verify — runs
nyz --versionto confirm the new binary works - Integrity checks — validates config, data directories, and provider tokens are intact
Backups and Rollback
Every update creates a backup of the previous binary:
# List available backups (newest first)
nyz update --list-backups
# Rollback to the most recent backup
nyz update --rollback latest
# Rollback to a specific backup
nyz update --rollback /path/to/backup/nyz
Backups are stored at ~/.local/share/nyzhi/backups/ and auto-pruned to keep the 3 most recent.
Integrity Checks
After updating, Nyzhi verifies:
- Config and data directories still exist
- Config file hash hasn’t drifted unexpectedly
- Provider tokens are still accessible
If anything looks wrong, you’ll see a warning. Use nyz update --rollback latest to revert if needed.
Disabling Updates
[update]
enabled = false
Note:
enableduses AND merge semantics — both global and project config must have it enabled for updates to run. Setting it tofalsein either location disables updates.
Uninstalling
Remove Nyzhi completely:
nyz uninstall
This removes:
- The
nyzbinary - Config directory (
~/.config/nyzhi/) - Data directory (
~/.local/share/nyzhi/) - Backups
- Shell PATH entries added by the install script
Add --yes to skip the confirmation prompt:
nyz uninstall --yes
Next Steps
- Building — build from source
- Configuration — update config reference