Skip to content

Open source · Not affiliated with Atlassian

A command-line interface for Bitbucket Cloud

Fast, scriptable, and honest about its output. Fourteen command groups over the full 2.0 REST API — every command outputs JSON, --json projects exactly the fields you name, --jq filters in-process.

$npm install -g @pilatos/bitbucket-cli

Requires Bun 1.0+·macOS, Linux, Windows·MIT

Principleswhy it's built this way
01Machines are users too--json id,title projects exactly the fields you name; dotted paths keep their full key as the object key.
02No jq dependency--jq evaluates in-process. It works in the most minimal CI image you can build.
03Error codes you can branch onEvery failure carries a numeric code in the JSON payload — the process exit status stays 1. All codes are documented in the reference.
04Types can't driftThe API client is generated from one pinned OpenAPI spec; CI fails if the generated code drifts from it.
05Secrets stay putCredentials are stored with 0600 permissions in your platform's config directory. Never logged, never printed.
example — run from any Bitbucket checkoutcontext is automatic
# workspace and repo resolved from your git remote
$bb pr list --state OPEN
#47 feat: streaming pipeline logs OPEN
#46 fix: retry on 429 rate limits OPEN
$bb pr merge 47 --strategy squash
✓ Merged pull request #47 into main (squash)
$bb pipeline run --branch main --json --jq '.build_number'
313

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