Skip to content

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.

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

List comments on a pull request.

Terminal window
bb pr comments list [id] [options]

Use the identifiers described above.

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
Terminal window
# List comments on PR #42
bb pr comments list 42
# Only comments that still need attention
bb pr comments list 42 --unresolved
# List more comments
bb pr comments list 42 --limit 50
# List every comment
bb pr comments list 42 --all
# Show full comment content (not shortened)
bb pr comments list 42 --no-truncate

Output:

ID Author Content Status Date
--------- -------- ------------------------------- -------- -----------
486512301 Jane Doe Consider renaming this variable resolved 2 days ago
486512477 Sam Ali Good catch, fixed. open 2 days ago
486513002 Jane Doe Why was this removed? open 5 hours ago
  • Long comment content is shortened to fit the terminal width. Use --no-truncate for the full text
  • The Status column shows resolved, pending, or open. Bitbucket records resolution on the comment that was resolved, so a reply inside a resolved thread shows open (or pending if it is an unpublished draft)
  • --resolved and --unresolved filter on the same resolution state and cannot be combined
  • With --resolved/--unresolved the filter is applied client-side after each page is fetched, so --limit counts comments that survive the filter, --unresolved --limit 25 keeps 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 --limit or --all to see the rest (suppressed with --json)

Add a general comment, or an inline comment anchored to a file line.

Terminal window
bb pr comments add <id> [message] [options]

Use the identifiers described above.

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)
Terminal window
# Add a general comment to PR #42
bb pr comments add 42 "LGTM! This looks great."
# Inline comment on a line in the new file
bb 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 file
bb pr comments add 42 "Why was this removed?" --file src/utils.ts --line-from 10
# Inline comment spanning old and new lines
bb 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.md
bb 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-file is the comment text; --file is the diff path an inline comment anchors to
  • --file is required when using --line-to or --line-from
  • At least one of --line-to or --line-from is required when using --file
  • Line numbers must be positive integers

View a single comment, including whether it is resolved.

Terminal window
bb pr comments view <pr-id> <comment-id>

Use the identifiers described above.

Terminal window
# View comment #486512301 on PR #42
bb 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]
  • --json prints the raw comment object returned by the API

Edit a comment on a pull request.

Terminal window
bb pr comments edit <pr-id> <comment-id> <message>

Use the identifiers described above.

Option Description
--dry-run Print the write request instead of sending it (details)
Terminal window
# Replace the body of comment #486512301 on PR #42
bb pr comments edit 42 486512301 "Updated: I noticed something else..."

Reply to an existing comment. The reply is attached to the parent comment, so it lands in the same thread.

Terminal window
bb pr comments reply <pr-id> <comment-id> [message] [options]

Use the identifiers described above.

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)
Terminal window
# Reply to comment #486512301 on PR #42
bb pr comments reply 42 486512301 "Good catch, fixed."
# Reply with multi-line markdown from stdin
bb 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

Resolve a comment thread on a pull request.

Terminal window
bb pr comments resolve <pr-id> <comment-id>

Use the identifiers described above.

Option Description
--dry-run Print the write request instead of sending it (details)
Terminal window
# Resolve comment thread #486512301 on PR #42
bb pr comments resolve 42 486512301
  • Resolving is reversible with bb pr comments unresolve
  • --json returns { success, pullRequestId, commentId, resolution }; the API returns the resolution record, not the full comment, use bb pr comments view to read the comment back

Reopen a resolved comment thread on a pull request.

Terminal window
bb pr comments unresolve <pr-id> <comment-id>

Use the identifiers described above.

Option Description
--dry-run Print the write request instead of sending it (details)
Terminal window
# Reopen comment thread #486512301 on PR #42
bb pr comments unresolve 42 486512301
  • The API returns no body, so --json reports only { success, pullRequestId, commentId }

Delete a comment from a pull request. Asks for confirmation unless --yes is passed.

Terminal window
bb pr comments delete <pr-id> <comment-id> [options]

Use the identifiers described above.

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)
Terminal window
# Delete comment #486512301 from PR #42
bb pr comments delete 42 486512301 --yes
  • Without --yes, bb pr comments delete asks Continue? (y/N) in an interactive terminal. Anywhere else (see --no-input) it exits with a validation error ending in Use --yes to confirm.
  • Deleting a comment is permanent and cannot be undone