Skip to Content
CLI & APICommand reference

stackblaze login

Sign in via browser (one-click device login) or --token / --password

Usage: stackblaze login [options]

Sign in via browser (one-click device login) or --token / --password

Options:
  --json                 Output JSON (same as -o json) (default: false)
  --api-url <url>        StackBlaze API base URL
  --token <token>        API token (sb_pat_... or JWT)
  --browser              Open the one-click sign-in page (default for
                         interactive login)
  --browserless          Print the sign-in URL without opening a browser (SSH /
                         headless)
  --password             Sign in with email and password (supports 2FA)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Sign in on a machine without a browser, such as a CI runner, with an API token:

stackblaze login --token "$TOKEN"
OK Logged in to https://api-dev.stackblaze.cloud
projects: 13
Infrastructure as Code: status unavailable (API reachable)
credentials saved to /tmp/ci/.config/stackblaze/config.json (treat as a secret)

Over SSH, --browserless prints the sign-in link instead of opening a browser. Open it on any device where you're signed in to the dashboard and choose Approve:

stackblaze login --browserless
  → Sign in with one click:
    https://dashboard-dev.stackblaze.com/activate?user_code=VQWC-RTPE

  → Or go to https://dashboard-dev.stackblaze.com/activate and enter this code:
    VQWC-RTPE

Waiting for sign-in...
OK Logged in to https://api-dev.stackblaze.cloud
projects: 13
Infrastructure as Code: status unavailable (API reachable)
credentials saved to /tmp/home/.config/stackblaze/config.json (treat as a secret)

On this page