Skip to Content
CLI & APICommand reference

stackblaze builds

Git build jobs

Usage: stackblaze builds|build [options] [command]

Git build jobs

Options:
  -h, --help              Print help

Commands:
  list [options]          List build jobs for a git-strategy app
  trigger [options]       Trigger a new build
  logs [options] [build]  Stream logs for a build job (latest or named build)
                          until it finishes
  help [command]          Print this message or the help of the given
                          subcommand(s)

builds list

Usage: stackblaze builds list [options]

List build jobs for a git-strategy app

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

List a git app's builds, newest first, with their state and the image tag each one produced.

stackblaze builds list -p github-demo-cw8z -e stage -a vite-starter
vite-starter-5tjx-github-demo-cw-20261125-150350-e709  Succeeded  tag=main-20261125-150350-e709  2026-11-25T15:03:51.000Z
vite-starter-5tjx-github-demo-cw-20261125-150148-59ba  Succeeded  tag=main-1795618908110-20261125-150148-59ba  2026-11-25T15:01:49.000Z

builds trigger

Usage: stackblaze builds trigger [options]

Trigger a new build

Options:
  --api-url <url>           StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>           API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>      Project name
  -e, --env <name>          Environment name (default: production)
  -a, --app <name>          App name
  --json                    Output JSON (same as -o json) (default: false)
  --buildstrategy <s>       buildpacks, dockerfile, railpack, or plain
  --repository <url>        Git repository URL override
  --reference <ref>         Git branch or tag override
  --dockerfile-path <path>  Dockerfile path for dockerfile strategy
  --commit-sha <sha>        Pin build to a commit SHA
  -o, --output <format>     Output format: text or json (choices: "text",
                            "json")
  -h, --help                Print help

Example

Start a new build of a git app from the head of main, then follow it with builds logs -f.

stackblaze builds trigger -p github-demo-cw8z -e stage -a vite-starter --reference main
OK Build triggered for github-demo-cw8z/stage/vite-starter-5tjx

builds logs

Usage: stackblaze builds logs [options] [build]

Stream logs for a build job (latest or named build) until it finishes

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -f, --follow           Follow live over WebSocket (lines as they are written;
                         falls back to polling on older servers) (default:
                         false)
  --ci                   Output NDJSON log lines (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Without -f the build is watched by polling its logs every 2s. With -f the
server pushes each line as the build container writes it (fetch → build →
push → deploy), late joins replay earlier lines, and dropped connections
reconnect on their own. Exit code is 1 when the build fails.

NDJSON (--ci / --json): {"type":"build",...} state changes, {"type":"log",
"build","container","message"} lines, {"type":"error","message"} on failure.
Set STACKBLAZE_BUILD_STREAM=poll to force polling.

Examples:
  stackblaze builds logs -f              # follow the latest build
  stackblaze builds logs web-x7k2 -f     # follow a named build
  stackblaze builds logs -f --ci         # NDJSON for CI

Example

Follow a build (a name from builds list) live, from cloning the repository to pushing the image. The command exits when the build finishes, with 1 if it failed.

stackblaze builds logs vite-starter-5tjx-github-demo-cw-20261125-150148-59ba -f -p github-demo-cw8z -e stage -a vite-starter
Streaming logs for build vite-starter-5tjx-github-demo-cw-20261125-150148-59ba (Active)
[fetch] ========== clone https://github.com/stackblaze/react-vite-starter.git (ref main)
[fetch] Cloning into '.'...
…
[fetch] HEAD is now at 92fdae6 Remove build artifacts and pnpm workspace file from starter.
                   
╭─────────────────╮
│ Railpack 0.39.0 │
╰─────────────────╯
  ↳ Detected Node
  ↳ Using pnpm package manager
  ↳ Deploying as vite static site
  ↳ Output directory: dist
…
[push] #25 exporting to image
[push] #25 pushing layers 5.1s done
…
[push] #25 DONE 6.3s
…
build vite-starter-5tjx-github-demo-cw-20261125-150148-59ba → Succeeded
OK Build vite-starter-5tjx-github-demo-cw-20261125-150148-59ba finished (Succeeded)

Leave out the build name to follow the latest build; leave out -f to poll instead of streaming.

On this page