CLI
The CLI is a thin client over the same REST API as the dashboard. It cannot do more than your token allows.
Infrastructure as Code (plan / apply) is opt-in per organization. Run stackblaze status to see if it is on.
Install
Section titled “Install”Linux and macOS:
curl -fsSL https://stackblaze.com/install.sh | shnpm:
npm install -g @stackblaze/cliUpgrade in place:
stackblaze upgradestackblaze loginThis opens a one-click sign-in page and stores a token in ~/.config/stackblaze/config.json.
CI / scripts — pass a dashboard PAT (kbr_pat_…):
export STACKBLAZE_TOKEN=kbr_pat_…export STACKBLAZE_API_URL=https://api.stackblaze.cloudstackblaze whoamistackblaze logout clears saved credentials.
Deploy this directory
Section titled “Deploy this directory”stackblaze initstackblaze upstackblaze logs -fup --ci streams NDJSON and exits when the git build finishes (exit 1 on failure). Add --wait to also poll until the service is running.
Global options
Section titled “Global options”Most commands accept:
| Flag | Purpose |
|---|---|
--pipeline / -p |
Project (API: pipeline) |
--phase |
Environment (API: phase) |
--app / -a |
Service (API: app) |
--token |
Override saved / env token |
--api-url |
Override API host |
--json |
Machine-readable output |
-y / --yes |
Skip confirmations on destructive commands |
If the current directory is linked, pipeline / phase / app default from .stackblaze/project.json.
Command index
Section titled “Command index”Auth and project: login, logout, whoami, init, link, unlink, context, list, status, open.
Deploy: up, down, wait, restart, redeploy, scale, inspect.
Runtime: logs, metrics, run, shell, ssh, connect, diagnose.
Topology: apps, pipelines, phases, builds, deployments, domain, variables, env, addons, templates, functions, waf, volume, snapshots, files.
IaC: plan, apply, export, destroy.
Agent: agent, mcp, skills, setup.
Other: billing, audit, completion, upgrade, docs.
The REST surface is in the API reference.