Skip to main content

CLI Installation

Install

npm install -g @nanoterm/cli

pnpm

pnpm add -g @nanoterm/cli

One-off via npx

npx @nanoterm/cli ws list

Node 20+ is required.

Sign in

nanoterm auth login

This opens your browser, signs you in, and saves a CLI API key scoped to the machine you're on. The key is stored in ~/.nanoterm/config.json with 0600 permissions.

Manual (for CI / scripts)

nanoterm auth set-key nt_your_api_key

Use this when there's no browser available — headless servers, CI jobs, etc. Create the key from the dashboard's API Keys page.

Verify

nanoterm auth status
# Authenticated
# API: https://api.nanoterm.dev
# Key: nt_a1b2c3d4e5f6...

Configuration file

The CLI stores credentials in ~/.nanoterm/config.json:

{
"apiKey": "nt_..."
}

That's it for normal use. nanoterm auth login writes this file for you.

Optional: point at a different API

If you're running the API locally (via pnpm --filter @nanoterm/api dev) or hitting a staging environment, override the URL. Not needed for hosted NanoTerm — the CLI uses https://api.nanoterm.dev by default.

{
"apiUrl": "http://localhost:3000",
"apiKey": "nt_..."
}

Or via env var:

export NANOTERM_API_URL=http://localhost:3000

Auto-update

Once a day (cached in ~/.nanoterm/update-check.json), the CLI asks npm if there's a newer version and prints a one-line notice when one exists. The check runs in the background and is silent on network failure — it never blocks the command you typed.

If the API ever raises the minimum required CLI version, you'll get a 426 CLI_VERSION_TOO_OLD response from the server, including the exact upgrade command. Run it and retry:

npm install -g @nanoterm/cli@latest