A powerful command-line interface for Bitbucket that brings repository management, pull requests, pipelines, and team collaboration directly to the terminal. Supports both Bitbucket Cloud and Bitbucket Server/Data Center.
- Repository Management - Clone, create, fork, list, and manage repositories
- Pull Requests - Create, review, merge, approve, and manage PRs with full workflow support
- Pipelines - Trigger, monitor, and view CI/CD pipeline logs (Bitbucket Cloud)
- Issues - Create and manage issues with Jira integration
- Workspaces & Projects - Navigate and manage organizational structures
- Interactive & Scriptable - Rich terminal UI with JSON output for automation
- Multi-Platform - First-class support for both Cloud and Server/Data Center
- Secure - Credentials stored securely in system keychain
macOS/Linux:
curl -fsSL https://raw.githubusercontent.com/iamngoni/bitbucket-cli/master/install.sh | shWindows (PowerShell):
iwr -useb https://raw.githubusercontent.com/iamngoni/bitbucket-cli/master/install.ps1 | iexHomebrew (macOS/Linux):
brew install iamngoni/tap/bbDebian/Ubuntu:
# Download the latest .deb package
curl -LO https://github.com/iamngoni/bitbucket-cli/releases/latest/download/bb_amd64.deb
sudo dpkg -i bb_amd64.debChocolatey (Windows):
choco install bb# Requires Rust 1.75+
cargo install --git https://github.com/iamngoni/bitbucket-cliDownload the appropriate binary for your platform from the Releases page.
| Platform | Architecture | Download |
|---|---|---|
| Linux | x86_64 | bb-linux-x86_64.tar.gz |
| Linux | ARM64 | bb-linux-aarch64.tar.gz |
| macOS | Intel | bb-darwin-x86_64.tar.gz |
| macOS | Apple Silicon | bb-darwin-aarch64.tar.gz |
| Windows | x86_64 | bb-windows-x86_64.zip |
Bitbucket Cloud:
bb auth login --cloudBitbucket Server/Data Center:
bb auth login --server --host bitbucket.yourcompany.com# List your repositories
bb repo list
# Clone a repository
bb repo clone myworkspace/myrepo
# View repository details
bb repo view# List open PRs
bb pr list
# Create a new PR
bb pr create --title "My feature" --base main
# Review and approve
bb pr approve 123
# Merge
bb pr merge 123# List pipeline runs
bb pipeline list
# Trigger a pipeline
bb pipeline run --branch main
# View logs
bb pipeline logs 12345 --followbb auth Authentication management
bb repo Repository operations
bb pr Pull request operations
bb issue Issue tracker operations
bb pipeline CI/CD pipeline operations (Cloud)
bb workspace Workspace management (Cloud)
bb project Project management (Server/DC)
bb browse Open resources in browser
bb api Direct API calls
bb config CLI configuration
bb alias Command aliases
bb extension CLI extensions
bb completion Shell completions
For detailed help on any command:
bb <command> --helpConfiguration is stored in:
- Linux:
~/.config/bb/config.toml - macOS:
~/Library/Application Support/bb/config.toml - Windows:
%APPDATA%\bb\config.toml
| Variable | Description |
|---|---|
BB_TOKEN |
Authentication token (overrides keychain) |
BB_HOST |
Default host for Server/DC |
BB_WORKSPACE |
Default workspace (Cloud) |
BB_PAGER |
Pager for output (default: system pager) |
BB_EDITOR |
Editor for text input |
BB_NO_PROMPT |
Disable interactive prompts |
NO_COLOR |
Disable colored output |
# Bash
bb completion bash >> ~/.bashrc
# Zsh
bb completion zsh >> ~/.zshrc
# Fish
bb completion fish > ~/.config/fish/completions/bb.fish
# PowerShell
bb completion powershell >> $PROFILECreate shortcuts for frequently used commands:
# Create an alias
bb alias set prs "pr list --state open"
# Use the alias
bb prs
# List all aliases
bb alias listAll commands support --json for scriptable output:
# Get PR data as JSON
bb pr list --json
# Use with jq
bb pr view 123 --json | jq '.title'| Feature | Cloud | Server/DC |
|---|---|---|
| Pipelines | Yes | No |
| Workspaces | Yes | No |
| Projects | Limited | Yes |
| OAuth 2.0 | Yes | Limited |
| Personal Access Tokens | No | Yes |
| Native Issues | Yes | No |
| Jira Integration | Yes | Yes |
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
# Clone the repository
git clone https://github.com/iamngoni/bitbucket-cli
cd bitbucket-cli
# Build
cargo build
# Run tests
cargo test
# Run the CLI
cargo run -- --helpMIT License - see LICENSE for details.
Ngonidzashe Mangudya - @iamngoni
Inspired by GitHub CLI (gh)