Configuration File
The Bitbucket CLI stores configuration in a JSON file. This page documents the file format, location, and available settings.
File Location
Section titled “File Location”~/.config/bb/config.json%APPDATA%\bb\config.jsonTypically: C:\Users\<username>\AppData\Roaming\bb\config.json
Configuration Schema
Section titled “Configuration Schema”| Key | Type | Description | Set By |
|---|---|---|---|
username | string | Your Bitbucket username | bb auth login |
apiToken | string | Your API token (stored securely) | bb auth login |
defaultWorkspace | string | Default workspace | bb config set defaultWorkspace |
skipVersionCheck | boolean | Disable update notifications | bb config set |
versionCheckInterval | number | Days between update checks (default: 1) | bb config set |
Example Configuration
Section titled “Example Configuration”{ "username": "myuser", "apiToken": "ATBB_xxxxxxxxxxxxxxxxxxxx", "defaultWorkspace": "myworkspace", "skipVersionCheck": false, "versionCheckInterval": 7}Managing Configuration
Section titled “Managing Configuration”View All Settings
Section titled “View All Settings”bb config listOutput:
Configuration file: /Users/you/.config/bb/config.json
Key Valueusername myuserapiToken ********defaultWorkspace myworkspaceGet a Specific Value
Section titled “Get a Specific Value”bb config get defaultWorkspace# Output: myworkspaceSet a Value
Section titled “Set a Value”bb config set defaultWorkspace myworkspacebb config set skipVersionCheck truebb config set versionCheckInterval 7Typed key validation:
skipVersionCheckaccepts onlytrueorfalseversionCheckIntervalaccepts only positive integers (>= 1)
Values are stored as native JSON types, so bb config get <key> --json returns booleans/numbers for these keys.
Example:
bb config get skipVersionCheck --json# {"key":"skipVersionCheck","value":true}Protected Keys
Section titled “Protected Keys”Some configuration keys cannot be set directly:
| Key | Reason | How to Set |
|---|---|---|
username | Tied to authentication | Use bb auth login |
apiToken | Security-sensitive | Use bb auth login |
Update Notifications
Section titled “Update Notifications”The CLI automatically checks for updates when you run the bare bb command (without any subcommands). This helps you stay current with the latest features and bug fixes.
How It Works
Section titled “How It Works”- Checks npm registry for the latest version
- Compares with your installed version
- Shows a notification if an update is available
- Caches the check result for 24 hours (configurable)
- Skips checks in CI environments automatically
Example Notification
Section titled “Example Notification”⚠ A new version is available: 1.5.0 (you have 1.4.0) Run 'bun install -g @pilatos/bitbucket-cli' to update Or disable with 'bb config set skipVersionCheck true'Disable Notifications
Section titled “Disable Notifications”To permanently disable update notifications:
bb config set skipVersionCheck trueChange Check Frequency
Section titled “Change Check Frequency”To check less frequently (e.g., once per week):
bb config set versionCheckInterval 7Configuration Precedence
Section titled “Configuration Precedence”When determining workspace and repository, the CLI checks sources in this order:
-
Command-line flags (highest priority)
Terminal window bb pr list -w otherworkspace -r otherrepo -
Git repository remote (if in a git repo)
Terminal window cd /path/to/cloned-repobb pr list # Uses workspace/repo from git remote -
Configuration file (lowest priority)
Terminal window bb config set defaultWorkspace myworkspacebb pr list # Uses config default
See Understanding Repository Context for detailed examples.
File Permissions
Section titled “File Permissions”The configuration file contains sensitive data (API token). The CLI sets appropriate permissions automatically:
| Platform | Permissions |
|---|---|
| macOS/Linux | 0600 (owner read/write only) |
| Windows | Inherits user profile permissions |
Reset Configuration
Section titled “Reset Configuration”Clear Authentication Only
Section titled “Clear Authentication Only”bb auth logoutThis removes username and apiToken but keeps defaultWorkspace and other settings.
It does not perform a full config reset.
Full Reset
Section titled “Full Reset”Delete the configuration file entirely:
rm ~/.config/bb/config.jsonRemove-Item $env:APPDATA\bb\config.jsonThen re-authenticate:
bb auth loginTroubleshooting
Section titled “Troubleshooting””Cannot read config file”
Section titled “”Cannot read config file””The file may be corrupted. Delete and recreate it:
rm ~/.config/bb/config.jsonbb auth login“Cannot write config file”
Section titled ““Cannot write config file””Check directory permissions:
ls -la ~/.config/bb/Create the directory if it doesn’t exist:
mkdir -p ~/.config/bbConfig Not Being Used
Section titled “Config Not Being Used”Verify the CLI is reading from the expected location:
bb config list# Check the "Configuration file:" lineRemember that command-line flags and git context take precedence over config file settings.