Skip to content

Nittarab/gh-pr-reviews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-pr-reviews

A GitHub CLI extension that fetches and displays PR reviews, inline comments, and conversation comments. Designed for LLM-optimized output -- minimal tokens, maximum signal.

Installation

gh extension install Nittarab/gh-pr-reviews

Agent Skill (for Claude Code / OpenCode)

Give your AI coding agent the ability to fetch PR reviews:

npx skills add Nittarab/gh-pr-reviews@skills

Usage

# Auto-detect repo and PR from current branch
gh pr-reviews

# Explicit repo and PR number
gh pr-reviews owner/repo 42

# List all reviewers
gh pr-reviews --reviewers owner/repo 42

# Filter to a specific reviewer's last review
gh pr-reviews --reviewer copilot-pull-request-reviewer --last 1 owner/repo 42

# Hide conversation comments (keep only reviews + inline comments)
gh pr-reviews --no-comments owner/repo 42

# Include resolved threads (hidden by default)
gh pr-reviews --resolved owner/repo 42

Flags

Flag Type Default Description
--reviewer string (none) Show only reviews/comments from this reviewer
--last int 0 (all) Show only the N most recent reviews per reviewer
--reviewers bool false List reviewers summary table and exit
--no-comments bool false Suppress conversation-level comments
--resolved bool false Include resolved threads (hidden by default)

Output Format

Output is compact markdown optimized for LLM context windows:

# PR #42: Fix error handling (owner/repo)

## @alice [CHANGES_REQUESTED] 2024-01-15
Please fix the error handling.

- file1.go:42 — Rename this variable to be more descriptive
- pkg/api.go:10-15 [RESOLVED by @bob] — This function needs error handling
  - @bob: Fixed in latest commit

## @alice [APPROVED] 2024-01-17
LGTM!

## Conversation
@alice (2024-01-14): Created this PR to refactor the API layer...
@bob (2024-01-15): Can you add benchmarks?

Design choices for token efficiency

  • file:line notation instead of verbose file (line X)
  • State in brackets [APPROVED] on same line as author
  • No redundant headers or horizontal rules
  • Inline comments as flat dash lists with reply threading
  • Resolved threads marked with [RESOLVED] suffix

Use with LLMs

Pipe PR reviews directly into your LLM workflow:

# Feed reviews into an AI assistant
gh pr-reviews owner/repo 42 | llm "Summarize the review feedback"

# Get only the last review from each reviewer
gh pr-reviews --last 1 --no-comments owner/repo 42 | llm "What changes are requested?"

# Check what Copilot found
gh pr-reviews --reviewer copilot-pull-request-reviewer owner/repo 42

Development

# Build locally
go build -o gh-pr-reviews

# Install locally for testing
gh extension install .

# Test
gh pr-reviews owner/repo 42

How it works

Uses the GitHub GraphQL API to fetch reviews, review threads (with resolved status), and conversation comments in a single paginated query. The GraphQL API is required because the REST API has no concept of thread resolution status.

License

MIT

About

A github gh extension to get the pr reviews comments

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages