The nsp CLI

Generate AI images, manage projects, and check credits from your terminal. Pure Node.js, zero dependencies, single file. Installs in one command.

Install

curl -fsSL https://nanostudiopro.com/cli/nsp -o /usr/local/bin/nsp \
  && sudo chmod +x /usr/local/bin/nspbash

macOS, Linux, and WSL. Requires Node.js 18+. The binary is the same JavaScript file served from https://nanostudiopro.com/cli/nsp — feel free to inspect it before installing.

Log in

nsp loginbash

Opens your browser, asks you to confirm, and saves a token to ~/.config/nsp/credentials.json (mode 0600). Same OAuth 2.0 Device Authorization flow gh and vercel use — full protocol at /docs/device-auth.

Generate an image

nsp gen "a red dress on a windswept rooftop"bash

First run shows a numbered list of your projects with an option to create a new one. Your pick is saved as the default. Subsequent runs skip the picker.

In iTerm2, WezTerm, or Ghostty the result is shown inline in the terminal. In other terminals you get a polaroid-frame summary and the saved file path.

With a reference image

nsp gen "swap the jacket for navy linen" --ref ./jacket.pngbash

--ref is repeatable, up to 14 reference images.

With explicit flags

nsp gen "studio shot of sneakers, dramatic lighting" \
  --aspect 1:1 --res 2K -o sneakers.pngbash

Manage your default project

nsp projects               # list, * marks the default
nsp use proj_abc123        # set the default
nsp gen "your prompt"      # uses the default automaticallybash

The default is stored next to your token in ~/.config/nsp/credentials.json. Pass --project <id> to override for one call.

All commands

login                     Authorize this device (opens browser).
logout                    Forget the saved token.
whoami                    User identity, plan, credits.
credits                   Wallet balance + daily-cap status.
pricing                   List operation costs.
projects                  List projects (default marked with *).
use <id|number>           Set the default project.
gen "prompt" [flags]      Generate an image. Picks/creates project on first run.
token                     Print the saved token (for piping into curl).bash

nsp gen flags

--project, -p <id>        Target project (otherwise default or picker).
--ref <file>              Reference image (repeatable, up to 14).
--aspect, -a <ratio>      1:1, 4:5, 3:4, 9:16, 16:9, 3:2, 2:3   (default 4:5)
--res, -r <size>          1K, 2K, 4K                            (default 1K)
-o, --out <path>          Output file path                      (default ./<id>.png)bash

Environment

NSP_SERVER overrides the API host (default https://nanostudiopro.com) — useful for staging or local development.

Building an LLM agent instead? Use the MCP server — same auth, same operations, exposed as Claude-compatible tools.