Skip to content

Configuration File

The Bitbucket CLI stores configuration in a JSON file. This page documents the file format, location, and available settings.

~/.config/bb/config.json

KeyTypeDescriptionSet By
usernamestringYour Bitbucket usernamebb auth login
apiTokenstringYour API token (stored securely)bb auth login
defaultWorkspacestringDefault workspacebb config set defaultWorkspace
skipVersionCheckbooleanDisable update notificationsbb config set
versionCheckIntervalnumberDays between update checks (default: 1)bb config set
{
"username": "myuser",
"apiToken": "ATBB_xxxxxxxxxxxxxxxxxxxx",
"defaultWorkspace": "myworkspace",
"skipVersionCheck": false,
"versionCheckInterval": 7
}

Terminal window
bb config list

Output:

Configuration file: /Users/you/.config/bb/config.json
Key Value
username myuser
apiToken ********
defaultWorkspace myworkspace
Terminal window
bb config get defaultWorkspace
# Output: myworkspace
Terminal window
bb config set defaultWorkspace myworkspace
bb config set skipVersionCheck true
bb config set versionCheckInterval 7

Typed key validation:

  • skipVersionCheck accepts only true or false
  • versionCheckInterval accepts only positive integers (>= 1)

Values are stored as native JSON types, so bb config get <key> --json returns booleans/numbers for these keys.

Example:

Terminal window
bb config get skipVersionCheck --json
# {"key":"skipVersionCheck","value":true}

Some configuration keys cannot be set directly:

KeyReasonHow to Set
usernameTied to authenticationUse bb auth login
apiTokenSecurity-sensitiveUse bb auth login

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.

  • 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
⚠ 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'

To permanently disable update notifications:

Terminal window
bb config set skipVersionCheck true

To check less frequently (e.g., once per week):

Terminal window
bb config set versionCheckInterval 7

When determining workspace and repository, the CLI checks sources in this order:

  1. Command-line flags (highest priority)

    Terminal window
    bb pr list -w otherworkspace -r otherrepo
  2. Git repository remote (if in a git repo)

    Terminal window
    cd /path/to/cloned-repo
    bb pr list # Uses workspace/repo from git remote
  3. Configuration file (lowest priority)

    Terminal window
    bb config set defaultWorkspace myworkspace
    bb pr list # Uses config default

See Understanding Repository Context for detailed examples.


The configuration file contains sensitive data (API token). The CLI sets appropriate permissions automatically:

PlatformPermissions
macOS/Linux0600 (owner read/write only)
WindowsInherits user profile permissions

Terminal window
bb auth logout

This removes username and apiToken but keeps defaultWorkspace and other settings.

It does not perform a full config reset.

Delete the configuration file entirely:

Terminal window
rm ~/.config/bb/config.json

Then re-authenticate:

Terminal window
bb auth login

The file may be corrupted. Delete and recreate it:

Terminal window
rm ~/.config/bb/config.json
bb auth login

Check directory permissions:

Terminal window
ls -la ~/.config/bb/

Create the directory if it doesn’t exist:

Terminal window
mkdir -p ~/.config/bb

Verify the CLI is reading from the expected location:

Terminal window
bb config list
# Check the "Configuration file:" line

Remember that command-line flags and git context take precedence over config file settings.