Account & tooling

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.

usage
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.

FlagDescription
--browserOpen the one-click sign-in page (the default in a terminal)
--browserlessPrint the sign-in URL and code without opening a browser (SSH, servers)
--token <token>Sign in with an API token (kbr_pat_…)
--passwordSign 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

terminal
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.

usage
stackblaze logout

Also 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.

usage
stackblaze whoami

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

terminal
stackblaze whoami -o json | jq -r .user.email

stackblaze 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.

usage
stackblaze audit [options]
FlagDescription
--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

terminal
stackblaze audit --action delete --since-minutes 1440

stackblaze billing

Shows your plan, usage credit, and a breakdown of resources.

usage
stackblaze billing

Also 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.

usage
stackblaze completion bash|zsh|fish

Examples

terminal
# 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.fish

stackblaze 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.

usage
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.

FlagDescription
--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)
--orasDownload with the oras tool instead of the built-in client

Examples

terminal
stackblaze upgrade
stackblaze upgrade --version 1.0.0
brew upgrade stackblaze      # Homebrew installs

stackblaze docs

Prints the CLI documentation URL (this reference) and opens it in your browser.

usage
stackblaze docs [--no-browser]
FlagDescription
--no-browserOnly print the URL