Key points
- The CLI drives the same authenticated REST API as the UI. It has no private path.
- First-time installs download the latest GitHub Release archive from
https://github.com/nopsai/nopsai/releases/latest, extractnopsaiornopsai.exeontoPATH, and remove the archive. - Contexts hold the API URL and credentials so one binary can target several installations.
- The interactive console exposes API catalog calls, raw API requests, route listing and descriptions, context management, token login and logout, install generation, platform doctor, platform release, platform upgrade, completion generation, guide topics, help, and exit.
nopsai install docker-composeandnopsai install kubernetesgenerate version-pinned install files.- After the first install,
nopsai update --version <x.y.z>downloads the exact OCI archive andSHA256SUMS, verifies the checksum, then replaces the local binary. nopsai platform upgrade docker-compose|kubernetes --version <x.y.z>upgrades an installed platform. It keeps the secrets install generated, is forward-only, and prints the verified release changelog with the required actions before applying.- Interactive actions show the equivalent
nopsai ...command as a final preview before anything is sent or changed.
Examples
version="$(curl -fsSL https://api.github.com/repos/nopsai/nopsai/releases/latest | sed -nE 's/.*"tag_name": *"v?([^"]+)".*/\1/p' | head -1)"
[ -n "$version" ] || { echo "Could not resolve latest NopsAI release" >&2; exit 1; }
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
arch="$(uname -m)"
case "$os" in linux|darwin) ;; *) echo "Unsupported OS: $os" >&2; exit 1 ;; esac
case "$arch" in x86_64|amd64) arch=amd64 ;; arm64|aarch64) arch=arm64 ;; *) echo "Unsupported architecture: $arch" >&2; exit 1 ;; esac
archive="nopsai-cli_${version}_${os}_${arch}.tar.gz"
base_url="https://github.com/nopsai/nopsai/releases/download/v${version}"
curl -fL "$base_url/$archive" -o "$archive"
curl -fL "$base_url/SHA256SUMS" -o SHA256SUMS
checksum_line="$(awk -v asset="$archive" '{ name=$2; sub(/^\*/, "", name); sub(/^\.\//, "", name); if (name == asset) print $0 }' SHA256SUMS)"
[ -n "$checksum_line" ] || { echo "Missing checksum for $archive" >&2; exit 1; }
if command -v sha256sum >/dev/null 2>&1; then
printf '%s\n' "$checksum_line" | sha256sum -c -
else
printf '%s\n' "$checksum_line" | shasum -a 256 -c -
fi
tar -xzf "$archive" nopsai
sudo install -m 0755 nopsai /usr/local/bin/nopsai
rm -f "$archive" SHA256SUMS nopsai
nopsai --versionnopsai context add prod --api https://nopsai.example.com
nopsai context use prod
NOPSAI_TOKEN=nopat_<secret> nopsai login --token
nopsai platform doctornopsai install docker-compose --version 1.4.2nopsai update --version 1.5.0
nopsai platform upgrade docker-compose --version 1.5.0 --plan
nopsai platform upgrade docker-compose --version 1.5.0 --runHow it works
The live terminal layout uses centered screens with fixed header and footer chrome, breadcrumb text above nested menus, a fixed 20-row menu viewport, and a pinned guide and details section beneath it. Every feature menu, result viewer, wizard, and platform screen shares that layout.
API request parameter lists follow the wizard step order, expand the active item inline with its required marker and value, and render an empty active value as a cursor rather than a blank placeholder. Blank optional parameters, including multiline ones, advance with Enter.
UI release gates print UTC start and finish timestamps and durations for each npm stage so local-time log rendering cannot look like a loop.
Implementation evidence
doc/cli.mdContexts, credentials, interactive REST access, installs, and diagnostics.
internal/cli/commandCommand implementations, including the interactive console.

