Comments
Manage pull request comments.
See Global flags for JSON output, workspace/repository selection, and display options.
<id> and <pr-id> identify the pull request. list takes it as an optional [id] and falls back to the open PR for your current branch. <comment-id> identifies a
comment; find it with bb pr comments list <id>. view, edit, reply,
resolve, and unresolve take only global flags.
bb pr comments
Section titled “bb pr comments”Subcommands
Section titled “Subcommands”| Subcommand | Description |
|---|---|
list [id] |
List comments on a pull request |
add <id> <message> |
Add a comment to a pull request |
view <pr-id> <comment-id> |
View a single comment on a pull request |
edit <pr-id> <comment-id> <message> |
Edit a comment on a pull request |
reply <pr-id> <comment-id> <message> |
Reply to a comment on a pull request |
resolve <pr-id> <comment-id> |
Resolve a comment thread on a pull request |
unresolve <pr-id> <comment-id> |
Reopen a resolved comment thread on a pull request |
delete <pr-id> <comment-id> |
Delete a comment on a pull request |
bb pr comments list
Section titled “bb pr comments list”List comments on a pull request.
bb pr comments list [id] [options]Arguments
Section titled “Arguments”Use the identifiers described above.
Options
Section titled “Options”| Option | Description | Default |
|---|---|---|
--limit <number> |
Maximum number of comments | 25 |
--all |
List all comments (overrides --limit) |
|
--resolved |
Only show resolved comments | |
--unresolved |
Only show unresolved comments | |
--no-truncate |
Global flag. Show full comment content, never shortened |
Examples
Section titled “Examples”# List comments on PR #42bb pr comments list 42
# Only comments that still need attentionbb pr comments list 42 --unresolved
# List more commentsbb pr comments list 42 --limit 50
# List every commentbb pr comments list 42 --all
# Show full comment content (not shortened)bb pr comments list 42 --no-truncateOutput:
ID Author Content Status Date--------- -------- ------------------------------- -------- -----------486512301 Jane Doe Consider renaming this variable resolved 2 days ago486512477 Sam Ali Good catch, fixed. open 2 days ago486513002 Jane Doe Why was this removed? open 5 hours ago- Long comment content is shortened to fit the terminal width. Use
--no-truncatefor the full text - The
Statuscolumn showsresolved,pending, oropen. Bitbucket records resolution on the comment that was resolved, so a reply inside a resolved thread showsopen(orpendingif it is an unpublished draft) --resolvedand--unresolvedfilter on the same resolution state and cannot be combined- With
--resolved/--unresolvedthe filter is applied client-side after each page is fetched, so--limitcounts comments that survive the filter,--unresolved --limit 25keeps fetching pages until 25 unresolved comments are found or the list is exhausted - When the result is capped by
--limit, a hint shows how many were listed; use a higher--limitor--allto see the rest (suppressed with--json)
bb pr comments add
Section titled “bb pr comments add”Add a general comment, or an inline comment anchored to a file line.
bb pr comments add <id> [message] [options]Arguments
Section titled “Arguments”Use the identifiers described above.
Options
Section titled “Options”| Option | Description |
|---|---|
-F, --body-file <file> |
Read the comment text from a file, or - for stdin (instead of <message>) |
--file <path> |
File path for an inline comment (requires --line-to and/or --line-from) |
--line-to <number> |
Line number in the new version of the file (requires --file) |
--line-from <number> |
Line number in the old version of the file (requires --file) |
--dry-run |
Print the write request instead of sending it (details) |
Examples
Section titled “Examples”# Add a general comment to PR #42bb pr comments add 42 "LGTM! This looks great."
# Inline comment on a line in the new filebb pr comments add 42 "Consider renaming this variable" --file src/index.ts --line-to 15
# Inline comment on a line in the old (removed) version of the filebb pr comments add 42 "Why was this removed?" --file src/utils.ts --line-from 10
# Inline comment spanning old and new linesbb pr comments add 42 "This logic changed" --file src/app.ts --line-from 5 --line-to 8
# Multi-line markdown from a file, or from stdin with -bb pr comments add 42 -F review.mdbb pr comments add 42 -F - <<'EOF'Nit: prefer `const` here.EOF- Pass the text as
<message>or with-F/--body-file, not both. Blank text is rejected before anything is sent -F/--body-fileis the comment text;--fileis the diff path an inline comment anchors to--fileis required when using--line-toor--line-from- At least one of
--line-toor--line-fromis required when using--file - Line numbers must be positive integers
bb pr comments view
Section titled “bb pr comments view”View a single comment, including whether it is resolved.
bb pr comments view <pr-id> <comment-id>Arguments
Section titled “Arguments”Use the identifiers described above.
Examples
Section titled “Examples”# View comment #486512301 on PR #42bb pr comments view 42 486512301- The header shows
[resolved]or[unresolved]for that specific comment. Bitbucket records the resolution on the comment that was resolved, so a reply inside a resolved thread still shows[unresolved] - Unpublished draft review comments show
[pending]instead - Deleted comments render their content as
[deleted] --jsonprints the raw comment object returned by the API
bb pr comments edit
Section titled “bb pr comments edit”Edit a comment on a pull request.
bb pr comments edit <pr-id> <comment-id> <message>Arguments
Section titled “Arguments”Use the identifiers described above.
Options
Section titled “Options”| Option | Description |
|---|---|
--dry-run |
Print the write request instead of sending it (details) |
Examples
Section titled “Examples”# Replace the body of comment #486512301 on PR #42bb pr comments edit 42 486512301 "Updated: I noticed something else..."bb pr comments reply
Section titled “bb pr comments reply”Reply to an existing comment. The reply is attached to the parent comment, so it lands in the same thread.
bb pr comments reply <pr-id> <comment-id> [message] [options]Arguments
Section titled “Arguments”Use the identifiers described above.
Options
Section titled “Options”| Option | Description |
|---|---|
-F, --body-file <file> |
Read the reply text from a file, or - for stdin (instead of <message>) |
--dry-run |
Print the write request instead of sending it (details) |
Examples
Section titled “Examples”# Reply to comment #486512301 on PR #42bb pr comments reply 42 486512301 "Good catch, fixed."
# Reply with multi-line markdown from stdinbb pr comments reply 42 486512301 -F - <<'EOF'Fixed in `a1b2c3d`: retries are capped at 3.EOF- Pass the text as
<message>or with-F/--body-file, not both. Blank text is rejected before anything is sent - Use
bb pr comments list <id>to find the comment ID to reply to - How Bitbucket anchors a reply to an inline comment is decided server-side
bb pr comments resolve
Section titled “bb pr comments resolve”Resolve a comment thread on a pull request.
bb pr comments resolve <pr-id> <comment-id>Arguments
Section titled “Arguments”Use the identifiers described above.
Options
Section titled “Options”| Option | Description |
|---|---|
--dry-run |
Print the write request instead of sending it (details) |
Examples
Section titled “Examples”# Resolve comment thread #486512301 on PR #42bb pr comments resolve 42 486512301- Resolving is reversible with
bb pr comments unresolve --jsonreturns{ success, pullRequestId, commentId, resolution }; the API returns the resolution record, not the full comment, usebb pr comments viewto read the comment back
bb pr comments unresolve
Section titled “bb pr comments unresolve”Reopen a resolved comment thread on a pull request.
bb pr comments unresolve <pr-id> <comment-id>Arguments
Section titled “Arguments”Use the identifiers described above.
Options
Section titled “Options”| Option | Description |
|---|---|
--dry-run |
Print the write request instead of sending it (details) |
Examples
Section titled “Examples”# Reopen comment thread #486512301 on PR #42bb pr comments unresolve 42 486512301- The API returns no body, so
--jsonreports only{ success, pullRequestId, commentId }
bb pr comments delete
Section titled “bb pr comments delete”Delete a comment from a pull request. Asks for confirmation unless --yes is passed.
bb pr comments delete <pr-id> <comment-id> [options]Arguments
Section titled “Arguments”Use the identifiers described above.
Options
Section titled “Options”| Option | Description |
|---|---|
-y, --yes |
Skip the confirmation prompt (required when not in an interactive terminal) |
--dry-run |
Print the write request instead of sending it (details) |
Examples
Section titled “Examples”# Delete comment #486512301 from PR #42bb pr comments delete 42 486512301 --yes- Without
--yes,bb pr comments deleteasksContinue? (y/N)in an interactive terminal. Anywhere else (see--no-input) it exits with a validation error ending inUse --yes to confirm. - Deleting a comment is permanent and cannot be undone