Skip to main content

Installation

You can install the CLI using any of the following methods:

Download binary

Download the binary for your operating system from the releases page.

Homebrew (for macOS users)

You can install the CLI using Homebrew:
Alternatively, you can combine both steps into a single command:

Authentication

Before using any commands that interact with Nscale resources, authenticate with:
This opens a browser window to complete authentication. On success, your credentials are stored locally. To log out:

Credential precedence

The CLI resolves which credentials to use in this order, from highest to lowest priority:
  1. NSCALE_SERVICE_TOKEN environment variable — when set, the token is used directly and every source below is ignored (no keyring lookup happens at all).
  2. -u, --user flag, when explicitly passed — selects that named entry from the local keyring (the one created by nscale login) and takes precedence over any active context.
  3. Active context’s user — the user field of the context selected via --context or previously set with nscale contexts use. Used whenever -u is not passed on the command line.
  4. default keyring entry — the fallback when no context is active and -u was not passed.
If NSCALE_SERVICE_TOKEN is set in your shell, it silently overrides nscale login, --user, and any context — even if the token belongs to a different organization than you expect. When a command behaves unexpectedly (wrong org, “unauthorized”, missing resources), check this first:
Unset it with unset NSCALE_SERVICE_TOKEN to fall back to your stored credentials.

Global flags

These flags are available on every command:

Environment variables

Contexts

Contexts let you switch between different organizations and user configurations without re-specifying flags on every command.

Output formats

By default, list commands print a table and commands that return one resource print it as JSON. Most commands that return data also accept --json, which emits the full JSON payload, and -q, which extracts fields with a jq filter:
--json and -q are mutually exclusive — pick whichever fits your downstream tooling. Both take precedence over --format.

Choosing a format with --format

--format (or the NSCALE_OUTPUT_FORMAT environment variable; --format wins) sets how every command in the invocation renders its output: When --format is unset, the CLI detects the audience from the agent harness, the terminal, or the pipe. Detection only picks how output is rendered: it never implies --yes, skips a confirmation, or changes what a command does. A human table clips long values to the terminal width. Pass --no-truncate to show them in full, at the cost of a table wider than the terminal. Only tables clip: agent, json, and -q output never does.

Output streams and exit status

Data goes to stdout; diagnostics, prompts, and warnings go to stderr, so nscale ... --json | jq is always safe. Errors are printed to stderr as Error: <message> and the command exits with status 1; success exits with 0.

Input formats

create and update commands accept input from a JSON file (--file) or standard input (--stdin):
Use --dry-run to preview the request payload without making any changes:

Interactive mode

When running at a terminal outside of a CI environment, the CLI falls back to interactive prompts for any missing parameters. This means you can run commands without flags and be guided through the required inputs step by step. Commands that act on one resource take its ID either as a positional argument (nscale instances get <instance-id>) or with --id; passing both is an error unless they match. If you omit it, the CLI opens an interactive picker, so always pass it in scripts. For example, list commands will present an organization picker if --org is not provided: Instances list with interactive org picker create commands will prompt for each required field when no --file or --stdin input is given: Instances create with interactive field prompts To suppress interactive prompts (e.g. in scripts), pass --ci or set the CI environment variable. With prompts suppressed, a missing value is an error, and so is a confirmation: commands that ask before acting (most deletes and other mutations) fail unless you also pass --yes:

Shell completion

Bash

Zsh

Fish

PowerShell

Query output with -q

Most commands that return data accept -q, --query, which runs the JSON response through a jq filter so you can extract a field or reshape the output without piping into a second process. See Query output with -q for examples.

Available commands

These pages track the latest CLI release. If a command below is not recognized, check your version with nscale version and upgrade — brew upgrade nscale, or download a newer binary from the releases page.