PR Commands
Manage pull requests in Bitbucket repositories.
Global options available on all PR commands: --json, --no-color, -w, --workspace, -r, --repo.
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" |
| List open PRs | bb pr list |
| 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:
# List open PR titlesbb pr list --json | jq -r '.pullRequests[].title'
# Grab a PR URL from view outputbb pr view 42 --json | jq -r '.links.html.href'
# Capture diffstat totalsbb pr diff 42 --stat --json | jq '{filesChanged, totalAdditions, totalDeletions}'