Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/cliPublic

Retrieving pull request reviews...#3993

Answeredbymislav
mestebangutierrez asked this question inQ&A
Discussion options

I've been playing recently with the pull requests and the CLI (v1.12.1) and haven't figured out how to show all the reviews for a given PR and the comments that may have been added for each of them.

Obviously you can retrieve the raw data leveraging the API, and enhance developer experience by adding an alias... but in the end, the solution would be a JSON excerpt (regardless you use ajq expression or aGo template).

Has anybody figured out how to do this?

You must be logged in to vote

Right now there are no built-in features to fetch all reviews together with review comments from gh. You can do thisgh pr view --json reviews to get JSON data about all reviews on a PR, but that only fetches the main review body plus its state and author, but not the line comments itself.

You can usegh api to manually make the API request to fetch all review comments, but to do that you will have to study GitHub's API documentation a bit and then, after fetching all information about line comments, you will have to decide how to present them. (That last part is not trivial and it's the large reason why we haven't built this ourselves.)

Replies: 2 comments 5 replies

Comment options

Right now there are no built-in features to fetch all reviews together with review comments from gh. You can do thisgh pr view --json reviews to get JSON data about all reviews on a PR, but that only fetches the main review body plus its state and author, but not the line comments itself.

You can usegh api to manually make the API request to fetch all review comments, but to do that you will have to study GitHub's API documentation a bit and then, after fetching all information about line comments, you will have to decide how to present them. (That last part is not trivial and it's the large reason why we haven't built this ourselves.)

You must be logged in to vote
2 replies
@Benkovichnikita
Comment options

You can use an extensiongh extension install agynio/gh-pr-review.

To read PR comments (including inline) you can rungh pr-review review view <pr-number> -R owner/repo

@AmberLee2427
Comment options

It'sgh extension install agynio/gh-pr-review, perthis page.

Answer selected bymislav
Comment options

Sorry to resurrect a dead thread, but it might be interesting to re-evaluate this in the context of copilot chat/claude/etc. If we had the opportunity for these tools to leveragegh to read pull request comments, we could create commands that are along the lines of "evaluate each comment and implement suggested changes" or some such

You must be logged in to vote
3 replies
@ShaggO
Comment options

This is also highly relevant when getting follow-up reviews from LLM-based agents: Being able to ignore aspects already addressed or deemed not relevant/incorrect by resolved comments.

@manu29d
Comment options

I am not sure it's directly relevant but I usually feed something of the following sort to the cli for checking review comments (it's a bit manual at the moment)

 gh api repos/{owner}/{repo}/pulls/{pr-number}/reviews/{review-id}/comments --jq'.[] | "\(.path):\(.position)\n\n\(.body)\n\n"'

you can fetch the{review-id} by clicking on the... on the right of the thread andCopy link

@Benkovichnikita
Comment options

@abhishekmukherg@ShaggO@manu29d You can use an extensiongh extension install agynio/gh-pr-review.

To read PR comments (including inline) you can rungh pr-review review view <pr-number> -R owner/repo

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
7 participants
@mestebangutierrez@mislav@abhishekmukherg@ShaggO@manu29d@Benkovichnikita@AmberLee2427

[8]ページ先頭

©2009-2026 Movatter.jp