Skip to content

Open source · Not affiliated with Atlassian

A command-line interface for Bitbucket Cloud

Manage pull requests, repositories, and pipelines from your terminal. Use --json for structured output and --jq to filter it without an external jq binary.

$npm install -g @pilatos/bitbucket-cli

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

Windows --jq requires Bun 1.4.2+. Installation details

Principleswhy it's built this way
01Machines are users tooUse --json for structured output and --jq to select values. See the JSON reference for command shapes and projection limits.
02No jq dependency--jq evaluates in-process without an external jq binary. Windows requires Bun 1.4.2+.
03Error codes you can branch onCommand errors under --json include a numeric code. Argument-parser errors can remain plain text; interrupted prompts exit with 130.
04Generated API clientThe API client is generated from one pinned OpenAPI spec; CI fails if the generated code drifts from it.
05Local credential storageCredentials are stored with 0600 permissions in your platform's config directory. The file holds plaintext credentials. bb auth token deliberately prints credentials for scripts.
example, run from any Bitbucket checkoutcontext is automatic
# workspace and repo resolved from your git remote
$bb pr list --json --jq '.pullRequests[].title'
"feat: streaming pipeline logs"
"fix: retry on 429 rate limits"
$bb pr merge 47 --strategy squash
✓ Merged pull request #47: feat: streaming pipeline logs
$bb pipeline run --branch main --json --jq '.pipeline.build_number'
313

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