Skip to content

Bitbucket CLI

Work with Bitbucket from your terminal. Clone repos, manage PRs, and automate workflows — all without leaving the command line.

If you’ve used GitHub’s gh CLI and loved it, you’ve probably wished for something similar for Bitbucket. Now you have it.

Stay in Your Terminal

No more context-switching to the browser. Clone repos, create PRs, and review code without leaving your workflow.

Automate Everything

JSON output, scriptable commands, and CI/CD integration. Build automated workflows with ease.

Familiar Patterns

Inspired by GitHub CLI, so if you know gh, you’ll feel right at home with bb.

Smart Context Detection

Automatically detects workspace and repo from your git directory. Less typing, more doing.


Get productive in 60 seconds (requires Bun runtime):

Terminal window
npm install -g @pilatos/bitbucket-cli
Terminal window
# Authenticate
bb auth login
# Clone a repo
bb repo clone myworkspace/myrepo
# Create a PR
bb pr create -t "My awesome feature"
# List open PRs
bb pr list

Full Quick Start Guide →


Use task-focused guides when you want the shortest path to a result:

Browse PR command workflows

Repository Management

Clone, create, list, view, and delete repositories. Full control over your Bitbucket repos.

Terminal window
bb repo clone workspace/repo
bb repo create my-new-project
bb repo list -w myworkspace

Pull Request Workflows

Complete PR lifecycle management — create, review, approve, merge, and more.

Terminal window
bb pr create -t "Add feature"
bb pr view 42
bb pr checks 42
bb pr approve 42
bb pr merge 42 --strategy squash

Code Review

View diffs, checkout PR branches locally, and review code efficiently.

Terminal window
bb pr diff 42
bb pr checkout 42
bb pr diff --stat

Scripting & Automation

JSON output for all commands. Perfect for CI/CD pipelines and automation scripts.

Terminal window
bb pr list --json | jq '.pullRequests[].title'

FeatureDescription
Smart ContextAuto-detects workspace/repo from git remote
JSON OutputMachine-readable output for scripting
Shell CompletionTab completion for Bash, Zsh, and Fish
Secure AuthAPI token authentication with local storage
Cross-PlatformWorks on macOS, Linux, and Windows
Update NotificationsAutomatic update checks to keep you current

Command Reference

Complete documentation for all commands and options.

View Commands →

Troubleshooting

Common issues and how to solve them.

Get Help →


This is an unofficial, community-maintained CLI. Not affiliated with Atlassian.