Skip to content

stackblaze login

Signs the CLI in and saves the credentials to ~/.config/stackblaze/config.json (mode 600; override with STACKBLAZE_CONFIG). The credentials are checked against the API before they are saved.

stackblaze login [options]
Flag Description
--browser Open the one-click sign-in page (the default in an interactive terminal)
--browserless Print the sign-in URL and code without opening a browser (SSH, headless machines)
--token <token> Sign in with an API token (kbr_pat_…) instead of the browser
--password Sign in with email or username and password; prompts for a 2FA code when enabled. Needs an interactive terminal
--api-url <url> API to sign in to (default: STACKBLAZE_API_URL, then the saved URL, then https://api.stackblaze.cloud)
-o, --output <text|json>, --json Output format

Use only one of --browser, --browserless and --password.

Terminal window
stackblaze login # browser sign-in
stackblaze login --browserless # print the URL and code, approve on another device
stackblaze login --token kbr_pat_xxxxxxxx # API token
stackblaze login --password # email/username + password (+ 2FA code)
  • Browser sign-in prints a URL with the code filled in, plus the code on its own. Approve it in the dashboard; the CLI polls until you do.
  • If STACKBLAZE_TOKEN is set, login saves that token instead of starting the browser flow.
  • Without a terminal and without a token, login fails. In CI, do not run login; set STACKBLAZE_API_URL and STACKBLAZE_TOKEN instead.
  • Create API tokens in the dashboard under Settings → API tokens.

stackblaze up starts this sign-in automatically when you run it in a terminal without credentials.

The saved file holds a live token: treat it as a secret. logout deletes it.