Skip to main content
CLI v3.0 is currently in alpha. Commands and flags may change before the stable release.

Authentication

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

Global Flags

These flags are available on every command:
FlagDescription
--ciIndicates the CLI is running in a CI environment (also set via CI env var)
--context stringSpecify the context to use
-u, --user stringSpecify the user credentials to use (default: "default")
-h, --helpShow help for any command

Environment Variables

VariableDescription
CIOverride the --ci flag
NSCALE_SERVICE_TOKENService token for authorization — bypasses stored credentials, useful for CI/CD

Contexts

Contexts let you switch between different organizations and user configurations without re-specifying flags on every command.
# Create or update a context
nscale contexts set --name my-context --org <org-id>

# Switch to a context
nscale contexts use my-context

# List all contexts
nscale contexts list

Output Formats

Most list and get commands support a --json flag for machine-readable output:
nscale instances list --org <org-id> --json

Input Formats

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

Interactive Mode

When running 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. 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.

Shell Completion

Bash

# Load completions for current session
source <(nscale completion bash)

# To load completions for every new session, execute once:

# Linux:
sudo nscale completion bash > /etc/bash_completion.d/nscale

# macOS:
# First, ensure bash-completion is installed
# brew install bash-completion
nscale completion bash > $(brew --prefix)/etc/bash_completion.d/nscale
# Then add to ~/.bash_profile:
# [[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && . "$(brew --prefix)/etc/profile.d/bash_completion.sh"

Zsh

# Load completions for current session
source <(nscale completion zsh)

# To load completions for every session, execute once:
# First, check your fpath directories to find the right location:
echo $fpath

# Then, create a directory for completions if it doesn't exist:
mkdir -p ~/.zsh/completions
nscale completion zsh > ~/.zsh/completions/_nscale

# If shell completion is not already enabled in your environment,
# you will need to enable it. You can execute the following once:
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc

# You will need to source your ~/.zshrc or start a new shell for this setup to take effect.
source ~/.zshrc

Fish

# Load completions for current session
nscale completion fish | source

# To load completions for every session, execute once:
mkdir -p ~/.config/fish/completions
nscale completion fish > ~/.config/fish/completions/nscale.fish

PowerShell

# Load completions for current session
nscale completion powershell | Out-String | Invoke-Expression

# To load completions for every new session, run:
nscale completion powershell > nscale.ps1
# and source this file from your PowerShell profile.

Available Commands

CommandDescription
contextsManage CLI contexts
filestorageManage file storage resources
flavorsList available compute flavors
groupsManage groups
imagesManage compute images
instancesManage compute instances
loginAuthenticate with Nscale
logoutLog out of the Nscale CLI
networksManage VPC networks
organizationsList organizations
projectsManage projects
regionsList available regions
securitygroupsManage security groups
serviceaccountsManage service accounts
versionDisplay the CLI version