A CLI tool to extract and filter review comments from GitHub pull requests. Works both as a gh CLI extension and as a standalone binary.
Installation
gh extension
gh extension install ikawaha/gh-pr-comments
go install
go install github.com/ikawaha/gh-pr-comments@latest
Usage
gh pr-comments <pr-number> [flags]
gh-pr-comments <pr-number> [flags] # standalone
Examples
# List review comments
gh pr-comments 123
# Specify a repository
gh pr-comments 123 -R owner/repo
# Show only unresolved threads
gh pr-comments 123 --unresolved
# Filter by thread starter
gh pr-comments 123 --author octocat
# Filter by any participant in thread
gh pr-comments 123 --involves octocat
# Filter by file path (glob)
gh pr-comments 123 --path "*.go"
# Filter by date
gh pr-comments 123 --since 2024-01-01
# Select display fields
gh pr-comments 123 --fields path,author,body,url
# JSON output
gh pr-comments 123 --json
# Include general PR comments
gh pr-comments 123 --issue-comments
Flags
| Flag |
Short |
Description |
--repo |
-R |
Repository in OWNER/REPO format (default: auto-detected from git remote) |
--author |
|
Filter by thread starter |
--involves |
|
Filter by any participant in thread |
--resolved |
|
Show only resolved threads |
--unresolved |
|
Show only unresolved threads |
--outdated |
|
Show only outdated threads |
--path |
|
Filter by file path (glob pattern) |
--since |
|
Show comments since date (YYYY-MM-DD or RFC3339) |
--until |
|
Show comments until date |
--issue-comments |
|
Include general PR comments |
--fields |
|
Comma-separated list of display fields |
--json |
|
Output as JSON |
Fields
Available fields for --fields:
path, line, startLine, author, resolved, outdated, body, url, diffHunk, commitOID, state, createdAt, updatedAt, diffSide, resolvedBy
Default: path,line,author,resolved,body,url
MIT