Authentication
Set up and manage your BuildBear API key
The BuildBear CLI authenticates all API requests with your personal API key. You can provide it through an environment variable or save it to a local config file.
auth setup
Interactive three-step wizard that guides you through creating an account and storing your API key.
What it does:
- Prompts you to create a BuildBear account at app.buildbear.io/signup
- Guides you to generate an API key at app.buildbear.io/settings/api-keys
- Asks for your API key (input is masked) and saves it to
~/.config/buildbear/config.json
[!NOTE] If the
BUILDBEAR_API_KEYenvironment variable is already set, this command exits immediately — no wizard is shown.
auth login
Store or replace your API key without the guided wizard.
Prompts for your API key (masked) and saves it to the config file. Use this to rotate a key or switch accounts.
auth logout
Clear your stored credentials.
Deletes ~/.config/buildbear/config.json. Subsequent commands will fail with an authentication error until you log in again.
auth status
Show your current authentication state.
Options:
| Flag | Description |
|---|---|
--json | Output as JSON |
Example output (human-readable):
Example output (--json):
Using an environment variable
Set BUILDBEAR_API_KEY in your shell or CI environment to bypass the config file entirely:
The environment variable takes precedence over the config file. This is the recommended approach for CI/CD pipelines.
Authentication priority
BUILDBEAR_API_KEYenvironment variable ← checked first~/.config/buildbear/config.json← fallback
If neither is set you will see: