cmd upgrade - nself-org/cli GitHub Wiki
Upgrade the ɳSelf CLI (detects install method).
nself upgrade [flags]
nself upgrade upgrades the CLI binary. It detects the install method (Homebrew, direct download, or system package manager) and applies the appropriate strategy: Homebrew users get a brew upgrade instruction (or the canary tap for the canary channel), system-package users are pointed at their package manager, and direct-install users get an in-place binary swap with rollback support.
Use --check to inspect current version, install method, and channel without installing. Use --channel to switch between stable and canary; the choice is persisted in ~/.config/nself/channel.json. Use --version 1.2.3 to pin a specific release. Use --rollback to restore the previously installed binary from ~/.nself/bin/nself.prev.
Before swapping the binary, the command warns about installed Pro plugins that may be incompatible with the new version. After a successful upgrade, the previous binary is preserved for one-shot rollback.
Operators running air-gapped environments, staging mirrors, or custom build pipelines can use --binary-url to bypass the GitHub releases API entirely and install a specific binary directly.
nself upgrade --binary-url https://install.nself.org/builds/v1.0.13-rc1/nself-linux-amd64.tar.gzThe command:
- Validates the URL is HTTPS and the host is on the allowed list (see below).
- Derives the checksum file URL from the same directory (
checksums.txtin the same path). - Downloads the binary or archive.
- Verifies the SHA-256 checksum against
checksums.txt. The install is aborted if the checksum does not match. - Backs up the current binary to
~/.nself/bin/nself.prev. - Atomically swaps the running binary with the new one.
If the install fails for any reason, run nself upgrade --rollback to restore the previous binary.
Allowed hosts for --binary-url:
-
github.comand subdomains -
objects.githubusercontent.comand subdomains -
install.nself.organd subdomains -
ping.nself.organd subdomains
URLs from any other host are rejected. Plain http:// URLs are never accepted, only https://.
Checksum file convention: the checksum file must live in the same URL directory as the binary and be named checksums.txt. Each line follows the standard sha256sum format:
<sha256hex> <filename>
| Flag | Default | Description |
|---|---|---|
--check |
false | Check for updates without installing |
--channel |
"" |
Release channel: stable or canary
|
--version |
"" |
Upgrade to a specific version (e.g. 1.2.3) |
--rollback |
false | Revert to the previously installed version |
--binary-url |
"" |
Install from a specific HTTPS binary URL (operator use) |
--help, -h
|
— | Show help |
# Check current version, channel, and install method
nself upgrade --check
# Upgrade to the latest stable
nself upgrade
# Switch to the canary channel and upgrade
nself upgrade --channel canary
# Pin to a specific version
nself upgrade --version 1.0.6
# Roll back to the previously installed binary
nself upgrade --rollback
# Install a specific binary from a staging mirror (operator)
nself upgrade --binary-url https://install.nself.org/builds/v1.0.13-rc1/nself-linux-amd64.tar.gz
# Install a specific binary from a GitHub release asset
nself upgrade --binary-url https://github.com/nself-org/cli/releases/download/v1.0.13/nself-darwin-arm64.tar.gz- cmd-update, update CLI and admin Docker image
- cmd-version, show current version and system info
- cmd-doctor, diagnose CLI/install issues
- Commands, full command index