Configuration File
All persistent settings live in one JSON file, written by bb auth login and
bb config set. This page documents the file itself; for the commands that read
and write it, see the Config command reference.
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 |
|---|---|---|---|
authMethod |
"basic" | "oauth" |
Active authentication method | bb auth login |
username |
string | Your Bitbucket username (API token auth) | bb auth login -u |
apiToken |
string | Your API token (API token auth) | bb auth login -p |
oauthAccessToken |
string | OAuth access token | bb auth login (OAuth) |
oauthRefreshToken |
string | OAuth refresh token | bb auth login (OAuth) |
oauthExpiresAt |
number | OAuth token expiry (Unix timestamp) | bb auth login (OAuth) |
oauthClientId |
string | Custom OAuth consumer client ID | bb auth login --client-id |
oauthClientSecret |
string | Custom OAuth consumer client secret | bb auth login --client-secret |
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 |
prCreateIncludeDefaultReviewers |
boolean | Auto-add the repository’s default reviewers on bb pr create (default: false) |
bb config set |
lastVersionCheck |
string | Timestamp of last update check | Automatic |
Example configuration (OAuth)
Section titled “Example configuration (OAuth)”{ "authMethod": "oauth", "oauthAccessToken": "xxxxxxxxxxxxxxxx", "oauthRefreshToken": "xxxxxxxxxxxxxxxx", "oauthExpiresAt": 1711036800, "defaultWorkspace": "myworkspace"}Example configuration (API token)
Section titled “Example configuration (API token)”{ "authMethod": "basic", "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:
Config file: /Users/you/.config/bb/config.json
KEY VALUE---------------- -----------username myuserdefaultWorkspace myworkspaceapiToken ********skipVersionCheck false
Settable keys: defaultWorkspace, skipVersionCheck, versionCheckInterval, prCreateIncludeDefaultReviewers. Run 'bb config set --help' for details.The API token is masked. Use bb auth token to see the real value.
Get a specific value
Section titled “Get a specific value”bb config get defaultWorkspace# Output: myworkspaceValues are stored as native JSON types, so for the typed keys --json returns
a real boolean or number rather than a quoted string:
bb config get skipVersionCheck --json# {"key":"skipVersionCheck","value":true}Set a value
Section titled “Set a value”bb config set defaultWorkspace myworkspacebb config set skipVersionCheck truebb config set versionCheckInterval 7Settable keys
Section titled “Settable keys”bb config set accepts these four keys; bb config list prints the current
list as a footer. Everything else is written by bb auth login or by the CLI
itself.
| Key | Type | Example |
|---|---|---|
defaultWorkspace |
string | bb config set defaultWorkspace myworkspace |
skipVersionCheck |
boolean | bb config set skipVersionCheck true |
versionCheckInterval |
integer (days, ≥ 1) | bb config set versionCheckInterval 7 |
prCreateIncludeDefaultReviewers |
boolean | bb config set prCreateIncludeDefaultReviewers true |
skipVersionCheck and prCreateIncludeDefaultReviewers accept only true or
false. versionCheckInterval accepts only positive integers (>= 1).
Readable keys
Section titled “Readable keys”bb config get has its own allowlist, and it is not the same one:
username, defaultWorkspace, skipVersionCheck, versionCheckInterval, prCreateIncludeDefaultReviewersusername is readable but not settable — change it with bb auth login -u.
bb config get apiToken refuses:
Cannot display 'apiToken' - it is part of your authentication credentials, not config. Use 'bb auth token' to retrieve credentials, or run 'bb config list' to see readable keys.Any other key throws Unknown config key '<key>' with the valid list and a
suggestion, e.g. (Did you mean defaultWorkspace?).
prCreateIncludeDefaultReviewers and the --default-reviewers flag
Section titled “prCreateIncludeDefaultReviewers and the --default-reviewers flag”| Config | Flag | Result |
|---|---|---|
unset / false |
(none) | Default reviewers are not added |
true |
(none) | Default reviewers are added |
unset / false |
--default-reviewers |
Default reviewers are added |
true |
--no-default-reviewers |
Default reviewers are not added |
Protected keys
Section titled “Protected keys”These keys cannot be set with bb config set:
| Key | Reason | How to set |
|---|---|---|
username |
Tied to authentication | Use bb auth login -u |
apiToken |
Security-sensitive | Use bb auth login -p |
authMethod |
Managed by login flow | Use bb auth login |
oauthAccessToken |
Managed by OAuth flow | Use bb auth login |
oauthRefreshToken |
Managed by OAuth flow | Use bb auth login |
oauthExpiresAt |
Managed by OAuth flow | Use bb auth login |
Update notifications
Section titled “Update notifications”After every command the CLI checks npm for a newer version, at most once per
versionCheckInterval days (default 1). The notice goes to stderr, and only
when stderr is a TTY, so --json and piped output stay clean. It is skipped
entirely in CI and when skipVersionCheck is true.
Example notification
Section titled “Example notification”──────────────────────────────────────────────────A new version is available: <latest> (you have <current>) Run 'bun install -g @pilatos/bitbucket-cli' to update Or disable with 'bb config set skipVersionCheck true'──────────────────────────────────────────────────There is no warning glyph. The separator rules are 50 box-drawing dashes, or
50 ASCII hyphens under --no-unicode.
Disable notifications
Section titled “Disable notifications”bb config set skipVersionCheck trueChange check frequency
Section titled “Change check frequency”versionCheckInterval is in days. Once per week:
bb config set versionCheckInterval 7Configuration precedence
Section titled “Configuration precedence”Command-line flags beat the git remote, which beats BB_WORKSPACE, which beats
the config file:
bb pr list -w otherworkspace -r otherrepo # flags wincd /path/to/cloned-repo && bb pr list # git remoteBB_WORKSPACE=myworkspace bb repo list # env varbb config set defaultWorkspace myworkspace # config fileThe full order, including which commands skip the git-remote step, is in Environment Variables. Understanding Repository Context has worked examples.
Some runtime behavior is tuned only with environment variables, not config
keys — BB_HTTP_TIMEOUT for the API request timeout, for example.
File permissions
Section titled “File permissions”The config file holds your API token, so the CLI creates the directory 0700
and the file 0600, and writes atomically (temp file, then rename).
| Platform | Directory | File |
|---|---|---|
| macOS/Linux | 0700 (owner only) |
0600 (owner read/write only) |
| Windows | Inherits user profile permissions | Inherits user profile permissions |
On macOS and Linux the CLI also verifies both on every read. If any group or other bit is set, every command fails with error 4001 until you fix it:
Config file has insecure permissions (644); expected 600. Run: chmod 600 /Users/you/.config/bb/config.jsonConfig directory has insecure permissions (755); expected 700. Run: chmod 700 /Users/you/.config/bbWindows skips the check, and a path that does not exist yet is not checked, so a fresh install never hits this.
Reset configuration
Section titled “Reset configuration”Clear authentication only
Section titled “Clear authentication only”bb auth logoutThis removes authentication credentials (OAuth tokens or API token) but keeps
defaultWorkspace and other settings. For OAuth, it also revokes the token on
Bitbucket’s side.
Full reset
Section titled “Full reset”Delete the config file entirely:
rm ~/.config/bb/config.jsonRemove-Item $env:APPDATA\bb\config.jsonThen re-authenticate:
bb auth loginTroubleshooting
Section titled “Troubleshooting”“Config file is not valid JSON”
Section titled ““Config file is not valid JSON””Fix the file by hand, or delete it and log in again:
rm ~/.config/bb/config.jsonbb auth login“Config file has insecure permissions”
Section titled ““Config file has insecure permissions””chmod 700 ~/.config/bbchmod 600 ~/.config/bb/config.json“Failed to read config file”
Section titled ““Failed to read config file””The path exists but is unreadable. Check ownership and permissions:
ls -la ~/.config/bb/“Failed to write config file” / “Failed to create config directory”
Section titled ““Failed to write config file” / “Failed to create config directory””The parent directory is missing or not writable:
mkdir -p ~/.config/bbls -ld ~/.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 "Config file:" lineCommand-line flags, git context and BB_WORKSPACE all take precedence over
config file settings.