Skip to content

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.

Linux and macOS:

Terminal window
curl -fsSL https://stackblaze.com/install.sh | sh

npm:

Terminal window
npm install -g @stackblaze/cli

Upgrade in place:

Terminal window
stackblaze upgrade
Terminal window
stackblaze login

This opens a one-click sign-in page and stores a token in ~/.config/stackblaze/config.json.

CI / scripts — pass a dashboard PAT (kbr_pat_…):

Terminal window
export STACKBLAZE_TOKEN=kbr_pat_
export STACKBLAZE_API_URL=https://api.stackblaze.cloud
stackblaze whoami

stackblaze logout clears saved credentials.

Terminal window
stackblaze init
stackblaze up
stackblaze logs -f

up --ci streams NDJSON and exits when the git build finishes (exit 1 on failure). Add --wait to also poll until the service is running.

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.

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.