bitbucket-cli

Drive Bitbucket from your terminal — built for coding agents, designed for humans.

Bitbucket Cloud Data Center / Server Built for agents
bitbucket-cli in a terminal
Capabilities

One CLI for the whole PR loop

Read repositories, drive PR review and merge — with output a coding agent can act on.

Pull request lifecycle

List, get, diff, comment, approve, decline and merge. Scoped reads — --scope summary|diff|commits|activity — let an agent load only what it needs.

Inline review comments

Post inline comments with --inline path:line, reply with --reply-to; Cloud and Data Center anchor shapes hidden behind one flag.

Repositories & branches

Browse, search and query repositories; list and manage branches; print HTTPS / SSH clone URLs ready to paste into git clone.

Commits & comparisons

Walk commit history with commit list, look up a single hash with commit get, or list what is reachable from to but not from with commit compare.

Multiple instancesnew

kubectl-style named contexts in one config file. Switch instance with --use-context; each context has its own credential.

Agent-first output

JSON by default, with structured errors — categories, exit codes and recovery hints a coding agent can branch on.

Secure credentials

Tokens live in the OS keychain, with a 0600 file fallback — never in the config file.

Browse files at any refv0.2

file list / get / tree read repository source at any branch, tag or commit — with optional line-range slicing. No local clone needed.

Diffstat & merge readinessv0.2

pr files returns per-file change summary; pr status aggregates mergeability, conflicts, reviewers and CI build status.

Local git bridgev0.2

pr fetch / pr checkout print the equivalent git commands; --exec runs them in your current checkout for fast local review.

Cloud & Data Center

One flavor-agnostic client; the backend — Cloud (REST 2.0) or Data Center / Server (REST 1.0) — is detected automatically.

Install

Up and running in a minute

Build from source today; prebuilt binaries follow.

install
# go install
go install github.com/angelmsger/bitbucket-cli/cmd/bitbucket-cli@latest

# from a local checkout
make install

Shell completion

Completes subcommands, flag values and live repository slugs. Load it once:

$ source <(bitbucket-cli completion bash)

Companion Skill

A bitbucket Skill is embedded in the binary. It detects your coding agent — Claude Code, Codex — and installs for each:

$ bitbucket-cli skill install
Quick start

Configure once, then drive the PR loop

Set up a server, then review and merge from the terminal.

a typical session
# interactive TUI setup, then verify connectivity
$ bitbucket-cli config init --pretty
$ bitbucket-cli doctor

# browse and read PRs
$ bitbucket-cli pr list --repo myws/myrepo --state OPEN
$ bitbucket-cli pr get myws/myrepo/42 --scope summary
$ bitbucket-cli pr get myws/myrepo/42 --scope diff

# review and merge
$ bitbucket-cli comment add --pr myws/myrepo/42 \
    --inline src/server.go:142 \
    --content "Hoist this allocation out of the loop?"
$ bitbucket-cli pr approve myws/myrepo/42
$ bitbucket-cli pr merge myws/myrepo/42 --strategy squash --yes
Commands

The command surface

Nine command groups. Every flag and example lives in the full CLI reference.

Guides

Go deeper

Longer-form documentation, embedded as the companion Skill.