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]Options
Section titled “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.
Examples
Section titled “Examples”stackblaze login # browser sign-instackblaze login --browserless # print the URL and code, approve on another devicestackblaze login --token kbr_pat_xxxxxxxx # API tokenstackblaze login --password # email/username + password (+ 2FA code)How it works
Section titled “How it works”- 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_TOKENis set,loginsaves that token instead of starting the browser flow. - Without a terminal and without a token,
loginfails. In CI, do not runlogin; setSTACKBLAZE_API_URLandSTACKBLAZE_TOKENinstead. - 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.