Reference
CLI
stackblaze is the official command-line client: deploy from your terminal, tail logs, manage apps and add-ons, and keep your whole project as code. It is a thin client over the same authenticated, tenant-scoped REST API the dashboard uses, so it can never do more than your kbr_pat_ token is allowed to.
# Install the standalone binary (no Node.js required)
$ curl -fsSL https://stackblaze.com/install.sh | sh
# One-click browser sign-in
$ stackblaze login
# Create a pipeline, link this directory, deploy it
$ stackblaze init -y && stackblaze up
Install & authenticate
| curl -fsSL https://stackblaze.com/install.sh | sh | Install the standalone binary to ~/.local/bin — no Node.js required. Or: npm install -g @stackblaze/cli (Node 18+). |
| stackblaze login | One-click browser sign-in. For CI, pass --token kbr_pat_… or set STACKBLAZE_TOKEN. |
| stackblaze whoami | Show the authenticated user and pipeline count. |
| stackblaze context | Show the resolved API URL and scope. |
| stackblaze upgrade | Self-update to the latest release. |
Projects and apps
| stackblaze init [-y] | Create a pipeline and link the current directory in one step. |
| stackblaze link / unlink | Link the cwd to a pipeline, phase, and app (writes .stackblaze/project.json). |
| stackblaze pipelines list|create|delete | Manage pipelines (projects). |
| stackblaze phases list|create|delete | Manage phases (environments); switch defaults with phase use <name>. |
| stackblaze apps list|get|create|update|delete | Manage apps: spec, status, pods, branch, image, port, pod size, domain. |
| stackblaze open | Print the dashboard URL for the linked pipeline or app. |
Deploy
| stackblaze up | Deploy the cwd; streams build logs. --path for monorepos, --ci for NDJSON output, --detach to skip streaming, --wait to poll until running. |
| stackblaze builds list|trigger|logs | List, trigger, or stream git build jobs. |
| stackblaze deployments list|rollback | List builds or roll back to a prior image tag. |
| stackblaze apps restart|redeploy|scale | Rolling restart, redeploy (optional --tag), or scale replicas (--replicas 0 pauses). |
| stackblaze down | Pause the app (scale web to 0). |
| stackblaze templates search|deploy | Browse the template catalog or deploy a template by name. |
| stackblaze inspect [url] | Deployment plan from the cwd or a public git URL. |
stackblaze init creates and links the project; stackblaze up builds from git and streams the rollout.
Observe & debug
| stackblaze logs [-f] [--search] | App logs: -f streams live over WebSocket; --search queries history (-q, --level, --minutes). |
| stackblaze metrics / events | CPU and memory snapshot; recent Kubernetes events. |
| stackblaze diagnose | Performance diagnosis with findings and hints. |
| stackblaze ssh | Interactive shell in the app pod over a WebSocket console. |
| stackblaze run <cmd> / shell | Run a local command (or open a subshell) with the remote app env injected. |
| stackblaze env pull | Write remote env vars to .env.local. |
| stackblaze connect postgres | Open a database or Redis client in the app pod (--local optional). |
| stackblaze audit / billing | Who did what and when; plan, usage credit, and resource breakdown. |
Add-ons, variables, domains
| stackblaze addons list|add|delete | Browse the catalog, attach an add-on to the linked app, or detach it (-y). |
| stackblaze variables list|set|delete | Manage environment variables (delete supports -y). |
| stackblaze snapshots list|create|restore | Volume snapshots; restore asks for confirmation. |
| stackblaze domain [add] | List or set custom domains on the app. |
Infrastructure as Code
| stackblaze export [--out DIR] | Write current pipelines and apps as YAML manifests — the easiest way to author them. |
| stackblaze plan <path> | Show what apply would create or change. No writes. |
| stackblaze apply <path> | Create or update the declared resources. Idempotent. |
| stackblaze destroy <path> | Delete the declared resources (asks for confirmation; -y to skip). |
| stackblaze status | Platform and IaC status — IaC is opt-in per organization. |
export pulls the live project down as YAML; plan shows the diff and apply is idempotent.
AI agent & MCP
| stackblaze agent [-p "…"] | Chat with the StackBlaze agent in your terminal — interactive REPL, one-shot with -p, or --json for scripting. Scope with --pipeline, --phase, --app. |
| stackblaze setup mcp | Wire the StackBlaze MCP server into Cursor or Claude. |
The agent uses the same tools as the dashboard chat: it reads your apps and logs, then proposes the fix.
CI and exit codes
| stackblaze up --ci -y | Non-interactive deploy: streams NDJSON build events (deploy, build, log, status, error) and exits when the build finishes. |
| exit 0 / 1 / 2 / 3 | Success / usage, validation, or build failure / missing or invalid credentials / StackBlaze API error. |
| -y, --yes | Skips confirmation on destructive commands (apps delete, pipelines delete, destroy, snapshots restore, down, variables delete). |
CI/CD
Store STACKBLAZE_TOKEN (and STACKBLAZE_API_URL) as CI secrets, install with the one-liner, then stackblaze up --ci -y deploys without prompts and fails the job on build failure. Precedence is flags, then environment, then the saved config from stackblaze login.