You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh pr view --json comments does not include review comments #11477
gh pr view --json comments does not include review comments (those attached directly to the review or to a file/inline).
Affected version
gh version 2.76.2 (2025-07-30)
https://github.com/cli/cli/releases/tag/v2.76.2
Steps to reproduce the behavior
Run gh pr view https://github.com/cli/cli/pull/3 --json comments
See empty comments array in output
Expected vs actual behavior
The option is documented to "view pull request comments". Review comments are shown and marked as comments in the web view, so I would expect them to appear in the output of this command.
Logs
Paste the activity from your command line. Redact if needed.
$ GH_DEBUG=true gh pr view https://github.com/cli/cli/pull/3 --json comments⣾* Request at 2025-08-08 09:35:09.974193 -0700 PDT m=+0.186090417* Request to https://api.github.com/graphql⣻* Request took 298.693959ms{ "comments": []}
{
"reviews": [
{
"id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjk4NjU3MzE5",
"author": {
"login": "mislav"
},
"authorAssociation": "CONTRIBUTOR",
"body": "Awesome! 🎉 ",
"submittedAt": "2019-10-08T10:01:56Z",
"includesCreatedEdit": false,
"reactionGroups": [],
"state": "APPROVED",
"commit": {
"oid": "996619ea3cf9d0534e98e6a65c64688efd629d1d"
}
},
{
"id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjk5MTMzMzI4",
"author": {
"login": "tierninho"
},
"authorAssociation": "CONTRIBUTOR",
"body": "Based on the commits, it looks as if this is the change. The bold, cyan text for the branch name.\r\n\r\n\r\n\r\n",
"submittedAt": "2019-10-09T01:46:38Z",
"includesCreatedEdit": false,
"reactionGroups": [
{
"content": "THUMBS_UP",
"users": {
"totalCount": 1
}
}
],
"state": "APPROVED",
"commit": {
"oid": "996619ea3cf9d0534e98e6a65c64688efd629d1d"
}
},
{
"id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjk5NjY3OTEx",
"author": {
"login": "probablycorey"
},
"authorAssociation": "CONTRIBUTOR",
"body": "",
"submittedAt": "2019-10-09T20:12:10Z",
"includesCreatedEdit": false,
"reactionGroups": [],
"state": "COMMENTED",
"commit": {
"oid": "996619ea3cf9d0534e98e6a65c64688efd629d1d"
}
}
]
}
However, it seems like this is still missing reviewThreads 🤔 which includes comment threads made on the lines of code.
Here's an example:
gh api graphql -f query='query PullRequestByNumber($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { pullRequest(number: 3) { reviewThreads(first: 100) { nodes { id comments(first: 100) { nodes { id author { login } bodyText } } } } id number } }}' -f owner=cli -f repo=cli
{
"data": {
"repository": {
"pullRequest": {
"reviewThreads": {
"nodes": [
{
"id": "MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMjA0NTczNjk1OnYy",
"comments": {
"nodes": [
{
"id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMjQzMDc1Mg==",
"author": {
"login": "mislav"
},
"bodyText": "Should the branch name also include the OWNER: portion if the pull request is coming from a different repo? This would match how head branches are shown on GitHub web."
},
{
"id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMzIxMDA4Nw==",
"author": {
"login": "probablycorey"
},
"bodyText": "That's a good idea. When this goes into master let's do it!"
}
]
}
}
]
},
"id": "MDExOlB1bGxSZXF1ZXN0MzI1NDMzODg1",
"number": 3
}
}
}
}
So I think the request here is to add reviewThreads as a --json option, is that right @victorlin?
Thank you for your issue! We have categorized it as a feature request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the
help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
Reacted by Willaaaaaaa, Michael Martin and Sam Martin-Brown
So I think the request here is to add reviewThreads as a --json option, is that right @victorlin?
Yes, that sounds about right. I still think it's confusing that these would need to be handled separately from comments as they are described as comments in the UI and docs, but I see how that can be out of scope for the CLI.
This issue has been automatically marked as stale because it has not had any activity in the last 30 days,
and it will be closed in 30 days if no further activity occurs.
If you think this is a mistake, please comment on this issue to keep it open.
So I think the request here is to add reviewThreads as a --json option, is that right @victorlin?
Yes, that sounds about right. I still think it's confusing that these would need to be handled separately from comments as they are described as comments in the UI and docs, but I see how that can be out of scope for the CLI.
Sorry @victorlin I missed replying to this. Thanks for confirming! I put this on our list of enhancements to review and discuss in our monthly enhancement review.
The feature is also what I'm looking for. Currently, I can use gh api to get review comments, which is really inconvenient, like this: gh api repos/<org>/<repo>/pulls/<pr_id>/comments (jq is usually helpful here). But a more convenient way is always better.
I think you need reviews in addition to comments because comments made as a review aren't included in comments
I think we should consider review comments as a part of gh pr view --comments <url> outputs. This is more intuitive, I would say.
@BagToad Is there any updates that you would like to share with us? I really think this really is something that could make gh cli tool better. Hopefully, the feature is coming soon❤
Activity
BagToad commentedon Aug 12, 2025
👋 Hey @victorlin, thanks for the issue ✨
I think you need
reviewsin addition tocommentsbecause comments made as a review aren't included incomments:{ "reviews": [ { "id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjk4NjU3MzE5", "author": { "login": "mislav" }, "authorAssociation": "CONTRIBUTOR", "body": "Awesome! 🎉 ", "submittedAt": "2019-10-08T10:01:56Z", "includesCreatedEdit": false, "reactionGroups": [], "state": "APPROVED", "commit": { "oid": "996619ea3cf9d0534e98e6a65c64688efd629d1d" } }, { "id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjk5MTMzMzI4", "author": { "login": "tierninho" }, "authorAssociation": "CONTRIBUTOR", "body": "Based on the commits, it looks as if this is the change. The bold, cyan text for the branch name.\r\n\r\n\r\n\r\n", "submittedAt": "2019-10-09T01:46:38Z", "includesCreatedEdit": false, "reactionGroups": [ { "content": "THUMBS_UP", "users": { "totalCount": 1 } } ], "state": "APPROVED", "commit": { "oid": "996619ea3cf9d0534e98e6a65c64688efd629d1d" } }, { "id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjk5NjY3OTEx", "author": { "login": "probablycorey" }, "authorAssociation": "CONTRIBUTOR", "body": "", "submittedAt": "2019-10-09T20:12:10Z", "includesCreatedEdit": false, "reactionGroups": [], "state": "COMMENTED", "commit": { "oid": "996619ea3cf9d0534e98e6a65c64688efd629d1d" } } ] }However, it seems like this is still missing
reviewThreads🤔 which includes comment threads made on the lines of code.Here's an example:
{ "data": { "repository": { "pullRequest": { "reviewThreads": { "nodes": [ { "id": "MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMjA0NTczNjk1OnYy", "comments": { "nodes": [ { "id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMjQzMDc1Mg==", "author": { "login": "mislav" }, "bodyText": "Should the branch name also include the OWNER: portion if the pull request is coming from a different repo? This would match how head branches are shown on GitHub web." }, { "id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMzIxMDA4Nw==", "author": { "login": "probablycorey" }, "bodyText": "That's a good idea. When this goes into master let's do it!" } ] } } ] }, "id": "MDExOlB1bGxSZXF1ZXN0MzI1NDMzODg1", "number": 3 } } } }So I think the request here is to add
reviewThreadsas a--jsonoption, is that right @victorlin?github-actions commentedon Aug 12, 2025
Thank you for your issue! We have categorized it as a feature request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
victorlin commentedon Aug 21, 2025
Yes, that sounds about right. I still think it's confusing that these would need to be handled separately from
commentsas they are described as comments in the UI and docs, but I see how that can be out of scope for the CLI.github-actions commentedon Sep 21, 2025
This issue has been automatically marked as stale because it has not had any activity in the last 30 days,
and it will be closed in 30 days if no further activity occurs.
If you think this is a mistake, please comment on this issue to keep it open.
A4-Tacks commentedon Oct 5, 2025
I almost only use gh-cli to work, but I need to open my email when viewing reviews,
this feature is very necessary feature for me
BagToad commentedon Oct 6, 2025
Sorry @victorlin I missed replying to this. Thanks for confirming! I put this on our list of enhancements to review and discuss in our monthly enhancement review.
A4-Tacks commentedon Oct 22, 2025
I wrote a bash script to implement this feature and provide output similar to gh-cli
https://github.com/A4-Tacks/my-bash-utils/blob/main/github-reviews
Benkovichnikita commentedon Dec 9, 2025
@victorlin @A4-Tacks
You can use an extension gh extension install agynio/gh-pr-review.
To read PR comments (including inline) you can run gh pr-review review view -R owner/repo
https://github.com/agynio/gh-pr-review
A4-Tacks commentedon Dec 9, 2025
This seems inferior to my bash script, which performs certain rendering, patch highlighting, and date formatting
And gh-pr-review seems to be simply filtering the JSON returned by the API, and it needs to specify the
--repoparameter at all timesAnd I just need clean review comment output and reply to review comments, which I have already solved using bash scripts
art-shen commentedon Jan 12, 2026
Coding agents often fail to do that properly without comprehensive guidance. It's so frustrating.
lkiii commentedon Feb 20, 2026
Would be great to have option to get something similar to this via gh pr view
A4-Tacks commentedon Feb 21, 2026
At least one bash script is available that outputs something similar to
gh pr viewAdd detailed specs for 3 agent-monitoring PR commands
Willaaaaaaa commentedon Mar 16, 2026
The feature is also what I'm looking for. Currently, I can use
gh apito get review comments, which is really inconvenient, like this:gh api repos/<org>/<repo>/pulls/<pr_id>/comments(jqis usually helpful here). But a more convenient way is always better.I think we should consider review comments as a part of
gh pr view --comments <url>outputs. This is more intuitive, I would say.@BagToad Is there any updates that you would like to share with us? I really think this really is something that could make gh cli tool better. Hopefully, the feature is coming soon❤