Quick Start
Get productive with the Bitbucket CLI in under a minute.
npm install -g @pilatos/bitbucket-clibb auth loginbb repo clone myworkspace/myrepobb pr create -t "My feature"Prerequisites
Section titled “Prerequisites”Before you begin, you’ll need:
- Bun runtime 1.0+ installed (required to run the CLI)
- A Bitbucket Cloud account
Step-by-Step Setup
Section titled “Step-by-Step Setup”-
Install the CLI
Terminal window npm install -g @pilatos/bitbucket-cliVerify the installation:
Terminal window bb --version -
Authenticate
Terminal window bb auth loginThis opens your browser to authorize the CLI with your Bitbucket account. No token setup needed.
For CI/CD or headless environments, use an API token instead:
Terminal window bb auth login -u your-username -p your-api-tokenVerify it worked:
Terminal window bb auth statusSee the Authentication guide for full details.
-
Clone a Repository
Terminal window bb repo clone myworkspace/myrepocd myrepo -
Create Your First PR
Terminal window git checkout -b feature/my-feature# Make some changes...git add .git commit -m "Add my feature"git push -u origin feature/my-featurebb pr create -t "Add my feature"
Common Commands
Section titled “Common Commands”Here are the commands you’ll use most often:
| Command | Description |
|---|---|
bb pr list | List open pull requests |
bb pr view 42 | View PR #42 details |
bb pr activity 42 | View PR #42 activity log |
bb pr create -t "Title" | Create a new PR |
bb pr merge 42 | Merge PR #42 |
bb pr checkout 42 | Checkout PR #42 locally |
bb pr diff 42 | View PR #42 diff |
bb repo list | List repositories |
bb browse 42 | Open PR #42 in your browser |
bb browse src/cli.ts:20 | Open a file at a specific line in your browser |
Set a Default Workspace
Section titled “Set a Default Workspace”If you work primarily in one workspace, set it as default:
bb config set defaultWorkspace myworkspaceNow commands will use this workspace automatically:
bb repo list # Lists repos in "myworkspace"bb pr list -r myrepo # Lists PRs in "myworkspace/myrepo"Enable Tab Completion
Section titled “Enable Tab Completion”Get intelligent tab completion for commands and options:
bb completion installRestart your shell, then try:
bb pr <Tab> # Shows: activity, approve, checkout, create, decline, diff, list, merge, ready, viewbb pr create -<Tab> # Shows available flagsbb <Tab> # Shows: auth, repo, pr, snippet, browse, config, completionScripting with JSON
Section titled “Scripting with JSON”Every command accepts --json for machine-readable output. You can project to a comma-separated field list and filter results through a built-in jq engine — no external jq binary required:
# Project to specific fieldsbb pr list --json id,title,state
# Filter through built-in jqbb pr list --json --jq '.pullRequests[] | select(.state == "OPEN") | .title'Update notifications
Section titled “Update notifications”When a newer version is available on npm, bb prints a one-time nudge after
the next command finishes:
⚠ A new version is available: 1.14.0 (you have 1.13.0) Run 'npm install -g @pilatos/bitbucket-cli' to update Or disable with 'bb config set skipVersionCheck true'The check runs at most once per versionCheckInterval (default: 24 hours) and
is skipped automatically in CI environments. Disable it permanently with:
bb config set skipVersionCheck trueSee the Configuration File reference for related settings.
Next Steps
Section titled “Next Steps”You’re all set! Here’s where to go next:
- Command Reference - Full documentation for all commands
- Repository Context - How the CLI detects your workspace/repo
- Scripting & Automation - Use bb in scripts and CI/CD
- JSON Output Reference - Field projection,
--jqfiltering, output shapes - AI Agent Integration - Wire the CLI into Claude Code, Cursor, or Windsurf
- Changelog - What’s new in recent releases
- Troubleshooting - Common issues and solutions