You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go install github.com/rbansal42/bitbucket-cli/cmd/bb@latest
Or clone and build:
git clone https://github.com/rbansal42/bitbucket-cli.git
cd bb
go build -o bb ./cmd/bb
Quick Start
1. Authenticate with Bitbucket
bb auth login
This will guide you through OAuth authentication or access token setup.
2. Clone a Repository
bb repo clone myworkspace/myrepo
3. Work with Pull Requests
# List open PRs in current repo
bb pr list
# Create a new PR
bb pr create --title "Add new feature" --base main
# View PR details
bb pr view 123
# Checkout a PR locally
bb pr checkout 123
# Merge a PR
bb pr merge 123
Common Workflows
Pull Request Workflow
# Create a feature branch and make changes
git checkout -b feature/my-feature
# ... make changes ...
git commit -am "Add my feature"
git push -u origin feature/my-feature
# Create a pull request
bb pr create --title "Add my feature" --body "Description of changes"# After review, merge the PR
bb pr merge 123 --merge-strategy squash --delete-branch
Code Review Workflow
# List PRs assigned to you for review
bb pr list --reviewer @me
# View PR details and diff
bb pr view 123
bb pr diff 123
# Approve or request changes
bb pr review 123 --approve
bb pr review 123 --request-changes --body "Please fix the tests"# Add a comment
bb pr comment 123 --body "Looks good, just one suggestion..."
CI/CD Pipeline Workflow
# Trigger a pipeline on current branch
bb pipeline run
# Trigger a pipeline on a specific branch
bb pipeline run --branch develop
# List recent pipelines
bb pipeline list
# View pipeline details
bb pipeline view <pipeline-uuid># Watch pipeline logs
bb pipeline logs <pipeline-uuid># Stop a running pipeline
bb pipeline stop <pipeline-uuid>
Issue Tracking Workflow
# Create an issue
bb issue create --title "Bug: Login fails" --kind bug --priority critical
# List open issues
bb issue list --state open
# View and comment on an issue
bb issue view 42
bb issue comment 42 --body "I can reproduce this on v2.0"# Close an issue
bb issue close 42
Repository Management
# List your repositories
bb repo list
# Create a new repository
bb repo create --name my-new-repo --private --description "My project"# Fork a repository
bb repo fork otherworkspace/cool-project
# View repository details
bb repo view
# Open repository in browser
bb browse
# If shell completion is not already enabled, add this to ~/.zshrc:# autoload -Uz compinit && compinit
bb completion zsh >"${fpath[1]}/_bb"
Fish
bb completion fish >~/.config/fish/completions/bb.fish
PowerShell
bb completion powershell |Out-String|Invoke-Expression# To load on startup, add to your profile:# bb completion powershell | Out-String | Invoke-Expression
Configuration
Configuration files are stored in ~/.config/bb/ (or $XDG_CONFIG_HOME/bb/ on Linux).
Files
File
Description
hosts.yml
Authentication tokens per host
config.yml
General settings
Settings
# Set preferred git protocol (https or ssh)
bb config set git_protocol ssh
# Set default editor
bb config set editor vim
# View current configuration
bb config get git_protocol
Environment Variables
Variable
Description
BB_TOKEN
Override authentication token
BITBUCKET_TOKEN
Alternative token variable
BB_REPO
Override repository (workspace/repo)
NO_COLOR
Disable colored output
Comparison with gh CLI
bb is designed to feel familiar to gh CLI users:
gh command
bb equivalent
gh auth login
bb auth login
gh pr list
bb pr list
gh pr create
bb pr create
gh repo clone
bb repo clone
gh issue create
bb issue create
gh run list
bb pipeline list
gh api
bb api
Key Differences
Workspaces: Bitbucket uses workspaces instead of organizations