CLI
Terminal workflows and automation with the official NineTwo's CLI.
Install
npm install --global @ninetwos-/cliNode.js 22 or newer is required.
Authentication
For headless and CI use, prefer the environment:
export NINETWOS_API_KEY="ntw_..."
export NINETWOS_BASE_URL="https://api.ninetwos.com" # optional
ninetwos auth verify --jsonOn a workstation, ninetwos auth configure stores the key in the operating
system credential store: macOS Keychain, Windows Credential Manager, or Linux
Secret Service. The CLI never prints the key. If no OS store exists, use the
environment or explicitly select the 0600 file backend:
printenv NINETWOS_API_KEY | ninetwos auth configure --storage file --api-key-stdin--storage auto and --storage keychain fail closed rather than silently
writing plaintext credentials.
Common commands
# Discover models and dynamic limits
ninetwos models list --json
ninetwos models retrieve zuv-0.5 --json
# Non-interactive completion
ninetwos completion --model zuv-0.5 \
--max-completion-tokens 200 \
'Explain CAP theorem.'
# Streaming chat
ninetwos chat --model zuv-0.5 --stream 'Write a short poem.'
# Explicit-input security review; no directory or repository discovery
ninetwos review --model zuv-0.5 --file src/auth.ts --file src/session.ts
# Durable logical identity and recovery state
ninetwos completion --model zuv-0.5 \
--idempotency-key order-123 \
--operation-file ./order-123.operation.json \
'Process order 123.'When --max-completion-tokens is omitted, the CLI uses the selected model's
dynamic recommended limit. There is no built-in model name or output-cap
fallback. --json emits machine-readable output, and automation exit codes are
deterministic.
Input files and stdin are explicit, bounded, and never recursively discovered. See Authentication for key scopes and handling.