Skip to content

Bitbucket CLI

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

Why Bitbucket CLI?

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.


Quick Start

Get productive in 60 seconds:

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 →


What Can You Do?

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 approve 42
bb pr merge 42 --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 '.[].title'

Feature Highlights

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

Explore the Docs

Command Reference

Complete documentation for all commands and options.

View Commands →

Troubleshooting

Common issues and how to solve them.

Get Help →


Community

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