Account and tooling
Sign in and out, see who you are, read the audit log and billing, and keep the CLI up to date.
stackblaze login
Signs the CLI in and saves the credentials to ~/.config/stackblaze/config.json (mode 600; override the path with STACKBLAZE_CONFIG). Browser sign-in prints a URL with the code filled in, opens it, and waits until you approve in the dashboard.
stackblaze login [--browser | --browserless | --password] [--token <token>]If STACKBLAZE_TOKEN is set, login saves that token instead. Without a terminal and without a token, login fails: in CI, skip login and set STACKBLAZE_TOKEN instead. Create API tokens in the dashboard under Settings, API tokens. The saved file holds a live token, so treat it as a secret.
| Flag | Description |
|---|---|
--browser | Open the one-click sign-in page (the default in a terminal) |
--browserless | Print the sign-in URL and code without opening a browser (SSH, servers) |
--token <token> | Sign in with an API token (kbr_pat_…) |
--password | Sign in with email or username and password; prompts for a 2FA code when enabled. Needs a terminal |
--api-url <url> | API to sign in to (default https://api.stackblaze.cloud) |
Also accepts the output flags (-o, --output, --json), plus --token and --api-url. Common flags
Examples
stackblaze login # browser sign-in
stackblaze login --browserless # approve on another device
stackblaze login --token kbr_pat_xxxxxxxx # API token
stackblaze login --password # email/username + password (+ 2FA code)stackblaze logout
Deletes the saved credentials file. The token itself is not revoked; revoke it in the dashboard under Settings, API tokens. STACKBLAZE_TOKEN in your environment is not affected.
stackblaze logoutAlso accepts the output flags (-o, --output, --json), plus --token and --api-url. Common flags
stackblaze whoami
Shows which API you are talking to and who you are: user, organization, the number of projects you can see, and whether Infrastructure as Code is enabled. Exit code 2 means no credentials or a rejected token.
stackblaze whoamiAlso accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags
Examples
stackblaze whoami -o json | jq -r .user.emailstackblaze audit
Prints recent audit log entries: who did what, and when. With an app in scope it shows that app's entries; otherwise your organization's. Text output shows the newest 20; -o json returns everything fetched.
stackblaze audit [options]| Flag | Description |
|---|---|
--action <keyword> | Only entries whose action contains this text, e.g. delete, scale |
--actor <user> | Only entries whose actor contains this text |
--since-minutes <n> | Only entries from the last n minutes |
-n, --limit <n> | Entries to fetch before filtering (default 100) |
Also accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags
Examples
stackblaze audit --action delete --since-minutes 1440stackblaze billing
Shows your plan, usage credit, and a breakdown of resources.
stackblaze billingAlso accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags
stackblaze completion
Prints a shell completion script to stdout. Regenerate it after upgrading to pick up new commands.
stackblaze completion bash|zsh|fishExamples
# bash
stackblaze completion bash > ~/.local/share/bash-completion/completions/stackblaze
# zsh
stackblaze completion zsh > "${fpath[1]}/_stackblaze"
# fish
stackblaze completion fish > ~/.config/fish/completions/stackblaze.fishstackblaze upgrade
Downloads the newest CLI build for your platform and replaces the running binary. If you installed with Homebrew, run brew upgrade stackblaze instead. Re-running the installer also upgrades.
stackblaze upgrade [--channel stable|dev] [--version <x.y.z>] [--install-path <file>]On Linux and macOS the old binary is kept next to the new one as stackblaze.bak. On Windows the running binary cannot be replaced, so upgrade writes stackblaze.new.exe next to it and asks you to swap the files after closing the terminal. Check the version with stackblaze --version.
| Flag | Description |
|---|---|
--channel <name> | stable (default) or dev (prereleases) |
--version <tag> | Install a specific version, e.g. 1.0.0 |
--install-path <path> | Binary to replace (default: the running binary) |
--oras | Download with the oras tool instead of the built-in client |
Examples
stackblaze upgrade
stackblaze upgrade --version 1.0.0
brew upgrade stackblaze # Homebrew installsstackblaze docs
Prints the CLI documentation URL (this reference) and opens it in your browser.
stackblaze docs [--no-browser]| Flag | Description |
|---|---|
--no-browser | Only print the URL |