Create, Edit, and View PRs
Create and inspect pull requests.
Global options available on all PR commands: --json, --no-color, -w, --workspace, -r, --repo.
bb pr create
Section titled “bb pr create”Create a new pull request.
bb pr create [options]Options
Section titled “Options”| Option | Description |
|---|---|
-t, --title <title> | Pull request title (required) |
-b, --body <body> | Pull request description |
-s, --source <branch> | Source branch (default: current branch) |
-d, --destination <branch> | Destination branch (default: main) |
-w, --workspace <workspace> | Workspace |
-r, --repo <repo> | Repository |
--close-source-branch | Close source branch after merge |
--draft | Create the pull request as draft |
--json | Output as JSON |
Examples
Section titled “Examples”# Create a PR from current branch to mainbb pr create -t "Add new feature"
# Create a PR with full detailsbb pr create -t "Add login page" -b "Implements user login functionality" -d develop
# Create a PR that will close the source branch after mergingbb pr create -t "Hotfix: Critical bug" --close-source-branch
# Create a draft PRbb pr create -t "WIP: Add feature" --draftbb pr edit
Section titled “bb pr edit”Edit an existing pull request’s title or description.
bb pr edit [id] [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
id | Pull request ID (optional - auto-detects from current branch) |
Options
Section titled “Options”| Option | Description |
|---|---|
-t, --title <title> | New pull request title |
-b, --body <body> | New pull request description |
-F, --body-file <file> | Read description from file |
-w, --workspace <workspace> | Workspace |
-r, --repo <repo> | Repository |
--json | Output as JSON |
Examples
Section titled “Examples”# Edit PR title by IDbb pr edit 42 -t "Updated: Add new feature"
# Edit PR descriptionbb pr edit 42 -b "This PR implements the new login flow"
# Edit both title and descriptionbb pr edit 42 -t "New title" -b "New description"
# Auto-detect PR from current branch and update titlebb pr edit -t "Updated title"
# Read description from a filebb pr edit 42 -F description.md
# Get updated PR as JSONbb pr edit 42 -t "New title" --json- When no ID is provided, the command searches for an open PR where the source branch matches your current git branch
- At least one of
--title,--body, or--body-filemust be provided - The
--body-fileoption reads the entire file contents as the new description
bb pr list
Section titled “bb pr list”List pull requests.
bb pr list [options]Options
Section titled “Options”| Option | Description |
|---|---|
-w, --workspace <workspace> | Workspace |
-r, --repo <repo> | Repository |
-s, --state <state> | Filter by state: OPEN, MERGED, DECLINED, SUPERSEDED (default: OPEN) |
--limit <number> | Maximum number of PRs (default: 25) |
--json | Output as JSON |
Examples
Section titled “Examples”# List open PRs in current repositorybb pr list
# List merged PRsbb pr list -s MERGED
# List declined PRsbb pr list -s DECLINED
# List PRs in specific repositorybb pr list -w myworkspace -r myrepo
# List with JSON output for scriptingbb pr list --json
# List more resultsbb pr list --limit 50- Draft PRs are shown with a
[DRAFT]prefix in the title --limitis enforced across paginated API responses
bb pr view
Section titled “bb pr view”View pull request details.
bb pr view <id> [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
id | Pull request ID |
Options
Section titled “Options”| Option | Description |
|---|---|
-w, --workspace <workspace> | Workspace |
-r, --repo <repo> | Repository |
--json | Output as JSON |
Examples
Section titled “Examples”# View PR #42 in current repositorybb pr view 42
# View PR in specific repositorybb pr view 42 -w myworkspace -r myrepo
# Get PR details as JSONbb pr view 42 --json