PR Commands
Manage pull requests in Bitbucket repositories.
Global options available on all PR commands: --json [fields], --jq <expression>, --no-color, -w, --workspace, -r, --repo.
--json accepts an optional comma-separated field list to project the output, and --jq filters the JSON in-process — see JSON Output for the full reference.
Choose a Workflow Task-based
Section titled “Choose a Workflow ” Create, edit, and view Open pull requests, update metadata, and inspect details with JSON output support.
Activity and checks Inspect activity history and CI/build status before approving or merging.
Diff and checkout Review patch output, fetch PR branches locally, and open browser diffs.
Review and merge Approve, decline, mark drafts ready, and merge with explicit strategy control.
Comments List, add, edit, and delete general or inline review comments.
Reviewers Assign and remove reviewers with clear behavior in idempotent cases.
Most-Used Commands
Section titled “Most-Used Commands”| Task | Command |
|---|---|
| Create a PR | bb pr create -t "Add feature" |
| Create a PR with the repo’s default reviewers | bb pr create -t "Add feature" --default-reviewers |
| List open PRs | bb pr list |
| List all PRs (ignore the default limit) | bb pr list --all |
| List PRs where you are a reviewer | bb pr list --mine |
| View PR details | bb pr view 42 |
| View checks | bb pr checks 42 |
| Review diff | bb pr diff 42 --stat |
| Checkout PR locally | bb pr checkout 42 |
| Approve PR | bb pr approve 42 |
| Merge PR | bb pr merge 42 --strategy squash |
JSON for Automation
Section titled “JSON for Automation”Use --json when scripting. The optional field list (--json id,title,state) projects to just those fields, and --jq filters in-process — no external jq binary required:
# Project to specific fields (returns a flat array)bb pr list --json id,title,author.display_name
# Filter with built-in --jqbb pr list --json --jq '.pullRequests[] | select(.state == "OPEN") | .title'
# Combine projection + filter (jq runs after projection)bb pr list --json id,title,state --jq '.[] | select(.state == "OPEN") | .title'
# Grab a PR URL from view outputbb pr view 42 --json --jq '.links.html.href'
# Capture diffstat totalsbb pr diff 42 --stat --json --jq '{filesChanged, totalAdditions, totalDeletions}'