ghpr comment list
ghpr comment list - list comment threads on a pull request
SYNOPSIS
Section titled “SYNOPSIS”ghpr comment list <pr> [options]DESCRIPTION
Section titled “DESCRIPTION”List all review comment threads on a pull request. By default, shows all threads; use --unresolved to filter to only unresolved threads. Supports multiple output formats and can write each thread to a separate file for batch processing.
ARGUMENTS
Section titled “ARGUMENTS”| Argument | Required | Description |
|---|---|---|
<pr> | Yes | Pull request number |
OPTIONS
Section titled “OPTIONS”| Option | Default | Description |
|---|---|---|
-t, --token <token> | - | GitHub personal access token |
-r, --repo <owner/repo> | - | Repository in owner/repo format |
--unresolved | false | Show only unresolved threads |
-f, --format <format> | text | Output format: text, json, markdown |
--write-each <directory> | - | Write each thread to a separate JSON file |
EXIT CODES
Section titled “EXIT CODES”| Code | Meaning |
|---|---|
0 | Success |
3 | Error (API error, auth error, PR not found) |
OUTPUT
Section titled “OUTPUT”Each thread includes:
- Thread ID -
PRRT_prefixed ID for use withcomment resolve - Comment ID - Numeric ID for use with
comment reply - Author - GitHub username of the commenter
- Body - Comment text
- Resolution status - Whether the thread is resolved
- Outdated flag - Whether the comment is on outdated code
- File path and line - Location in the code (if applicable)
Write-Each Mode
Section titled “Write-Each Mode”When using --write-each:
- Creates the directory if it doesn’t exist
- Generates one JSON file per thread:
{commentId}.json - Files contain full thread data including all metadata
- Will not overwrite existing files
- Only writes threads that have comments
- Incompatible with
--format jsonor--format markdown
EXAMPLES
Section titled “EXAMPLES”List All Comments
Section titled “List All Comments”ghpr comment list 123List Only Unresolved Comments
Section titled “List Only Unresolved Comments”ghpr comment list 123 --unresolvedJSON Output
Section titled “JSON Output”ghpr comment list 123 --format jsonMarkdown Output
Section titled “Markdown Output”ghpr comment list 123 -f markdownWrite Threads to Directory
Section titled “Write Threads to Directory”ghpr comment list 123 --unresolved --write-each ./review-threadsProcess Unresolved Comments with jq
Section titled “Process Unresolved Comments with jq”ghpr comment list 123 --unresolved --format json | jq -r '.[].threadId'Batch Process Comments
Section titled “Batch Process Comments”ghpr comment list 123 --unresolved --write-each ./review-threads
for file in ./review-threads/*.json; do THREAD_ID=$(jq -r '.encodedThreadId' "$file") COMMENT_ID=$(jq -r '.comments[0].databaseId' "$file")
# Process each comment... ghpr comment reply 123 $COMMENT_ID "Fixed!" ghpr comment resolve 123 $THREAD_IDdoneSEE ALSO
Section titled “SEE ALSO”- ghpr comment reply - Reply to a comment
- ghpr comment resolve - Resolve a thread
- ghpr review status - Check review status