Manage repositories, pull requests, pipelines, issues, and more — all without leaving the command line.
A powerful CLI that brings the full Bitbucket Cloud workflow to your terminal with a familiar, intuitive interface.
Create, review, approve, merge, and comment on PRs. Add inline comments on specific files and lines. View diffs and activity logs.
bb pr create --title "Feature" --reviewer @bobFull issue lifecycle management. Create, edit, vote, watch, comment, and delete issues from the command line.
bb issue list --state openTrigger pipelines, view step logs, stop running builds, and watch pipeline status in real-time from your terminal.
bb pipeline trigger --branch mainList, create, fork, clone, and delete repositories. Browse commits and view diffs across branches.
bb repo clone workspace/repoCreate and delete branches, manage tags, and view branch restrictions. Full branch lifecycle management.
bb branch list workspace/repoLogin via browser OAuth or app passwords. Tokens auto-refresh when expired. Credentials stored securely via XDG conventions.
bb auth loginHuman-readable tables by default, JSON output for scripting. Pipe results into jq, awk, or any tool you like.
bb pr list --jsonBuilt-in Model Context Protocol server with per-user OAuth, stdio and HTTP transports. Deploy as a shared Docker service — each user authenticates with their own Bitbucket account.
bb mcp serve --transport httpTab completion for Bash, Zsh, Fish, and PowerShell. Dynamic suggestions for workspaces, repositories, branches, and PR numbers.
bb completion zshMultiple installation methods to fit your workflow. Pick whichever suits you best.
curl -fsSL https://raw.githubusercontent.com/PhilipKram/Bitbucket-CLI/main/install.sh | sh
brew install PhilipKram/tap/bb
# Requires Go 1.22+ go install github.com/PhilipKram/bitbucket-cli@latest
Download pre-built binaries for Linux, macOS, and Windows from the releases page.
Available for amd64 and arm64.
Authenticate with Bitbucket Cloud. OAuth is the default — just run bb auth login and it opens your browser.
The CLI starts a local server, opens your browser for authorization, and exchanges the code for a token using PKCE — no client secret needed.
# OAuth login (default) — opens your browser bb auth login # Check current auth status bb auth status # Print stored token bb auth token # Refresh an expired token bb auth refresh # Logout bb auth logout
Comprehensive coverage of Bitbucket Cloud features organized into intuitive command groups.
Repository Argument:
Most commands accept a workspace/repo-slug positional argument.
When omitted, bb auto-detects the repository from the current git remote.
Use --json on any list command for machine-readable output.
Common patterns for day-to-day Bitbucket usage, straight from the terminal.
Create, review, comment on, and merge a pull request — all without leaving the terminal.
# Create a pull request from current branch bb pr create --title "Add user authentication" \ --description "Implements OAuth2 login flow" \ --reviewer @bob # List open PRs bb pr list --state OPEN # View PR details and diff bb pr view 42 bb pr diff 42 # Leave an inline comment on the diff bb pr comment 42 --body "Consider refactoring this" \ --file "src/auth.go" --line 57 # Approve and merge bb pr approve 42 bb pr merge 42
Trigger, monitor, and debug CI/CD pipelines without opening the Bitbucket web UI.
# Trigger a pipeline on main bb pipeline trigger --branch main # List recent pipelines bb pipeline list # Watch pipeline progress in real-time bb pipeline watch 187 # Debug a failed step bb pipeline steps 187 bb pipeline log 187 --step 3 # Stop a running pipeline bb pipeline stop 187
Manage bugs, features, and tasks from the command line — create, edit, comment, and close issues.
# Create a bug report bb issue create --title "Login page broken on Safari" \ --kind bug --priority critical # List open issues bb issue list --state open # Add a comment and vote bb issue comment 42 --body "Fixed in PR #99" bb issue vote 42 # Edit and close bb issue edit 42 --state resolved
Work with workspaces, manage branches, JSON output for scripting, and AI agent integration.
# Target a specific workspace/repo bb pr list myteam/backend-api bb repo view myteam/frontend # JSON output for scripting bb pr list --json | jq '.[].title' # Branch management bb branch create feature/auth --target main bb branch tags myteam/backend-api # MCP server with per-user OAuth (team deployment) bb mcp serve --transport http --client-id KEY --client-secret SECRET claude mcp add --transport http bitbucket http://localhost:8080/mcp # Self-update to latest version bb upgrade
Configuration stored in ~/.config/bb/ following XDG conventions.
| Command | Description |
|---|---|
| bb config view | Show current configuration |
| bb config set-default-workspace | Set your default workspace |
| bb config set-format | Set output format (table/json) |
| File | Description |
|---|---|
| token.json | OAuth access & refresh tokens |
| config.json | Default workspace & preferences |
| Shell | Setup |
|---|---|
| Bash | source <(bb completion bash) |
| Zsh | source <(bb completion zsh) |
| Fish | bb completion fish | source |
| PowerShell | bb completion powershell | Out-String | Invoke-Expression |