Skip to Content
CLI & APICommand reference

stackblaze agent

Chat with the StackBlaze agent (interactive REPL, or one-shot with a prompt)

Usage: stackblaze agent [options] [prompt...]

Chat with the StackBlaze agent (interactive REPL, or one-shot with a prompt)

Options:
  --api-url <url>                 StackBlaze API base URL (env
                                  STACKBLAZE_API_URL)
  --token <token>                 API token, sb_pat_... (env STACKBLAZE_TOKEN)
  --prompt <text>                 send a single prompt and exit (or pass it
                                  positionally)
  --json                          output the final response + tool calls as
                                  JSON (one-shot only) (default: false)
  --plain                         plain text output without enhanced streaming
                                  UI (default: false)
  -y, --yes                       auto-approve destructive tool confirmations
  --list                          list saved agent sessions on this machine
                                  (default: false)
  --thread-id, --session-id <id>  resume a saved agent session
  -a, --app <name>                scope the conversation to an app
  -p, --project <name>            scope the conversation to a project
  -e, --env <name>                scope the conversation to an environment
  -o, --output <format>           Output format: text or json (choices: "text",
                                  "json")
  -h, --help                      Print help

Example

Ask the agent a one-off question about an app. -p, -e and -a tell it which app you mean:

stackblaze agent -p github-demo-kpw0 -e dev -a nginx-unprivileged --plain "Is this app running, and which image and tag does it use? Don't change anything."
  ⚙ get_app
Yes, it's running. The app is ready with 1/1 pods up, 0 restarts, and the URL is https://nginx-unprivileged-mi0u.cloud-dev-central-1.stackblaze.app.

It uses the image `ghcr.io/nginxinc/nginx-unprivileged` with tag `stable-alpine`.

One event is odd: the pod's events include `busybox:1.36` being pulled and started for the same pod. The app spec only lists the nginx image. This could be an init step, but I didn't confirm it. I made no changes.

Every prompt is saved as a session on this machine. List them, then carry on in one with --thread-id:

stackblaze agent --list
┌──────────────────────────────────────┬──────────────────────────┬────────────────────────────────────────────────────────────────────────┐
│ ID                                   │ Updated                  │ Preview                                                                │
├──────────────────────────────────────┼──────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ 306ff0df-aea1-4b98-97e4-02160e69a047 │ 2026-11-25T14:44:07.423Z │ Is this app running, and which image and tag does it use? Don't chang… │
├──────────────────────────────────────┼──────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ 8f6b3c80-858d-4eb2-84f1-d291e43d8613 │ 2026-11-25T14:43:43.425Z │ Which add-ons does this environment have? Don't change anything.       │
…
└──────────────────────────────────────┴──────────────────────────┴────────────────────────────────────────────────────────────────────────┘
stackblaze agent --thread-id 306ff0df-aea1-4b98-97e4-02160e69a047 -p github-demo-kpw0 -e dev -a nginx-unprivileged --plain "How many replicas does it run? One sentence."
  ⚙ get_app
It runs 1 replica (web `replicaCount` 1, currently 1/1 ready), with autoscaling set to scale between 1 and 3 based on 70% CPU.

On this page