Skip to content

GHPR CLI Reference

GHPR is a command-line tool for managing GitHub Pull Request reviews and comments. It provides automation for requesting reviews, tracking review status, and managing comment threads.

CommandDescription
ghpr review requestRequest a review from a user, team, or Copilot
ghpr review statusCheck the current review status of a PR
ghpr review waitPoll until a review is complete
CommandDescription
ghpr comment listList comment threads on a PR
ghpr comment replyReply to a specific comment thread
ghpr comment resolveResolve a comment thread
CommandDescription
ghpr updateUpdate ghpr to the latest version

Token resolution order (first match wins):

  1. --token CLI option
  2. GPR_PAT environment variable
  3. .ghpr file in current directory
  4. gh auth token command output (GitHub CLI)

Required Permissions:

  • repo scope for private repositories
  • public_repo scope for public repositories only

Repository is determined by (in order):

  1. --repo CLI option (owner/repo format)
  2. Git remote URL (prefers upstream over origin)
  3. Current directory git config

All commands support these options:

OptionDescription
-t, --token <token>GitHub personal access token
-r, --repo <owner/repo>Repository in owner/repo format
CodeMeaning
0Success
1Changes requested (for review wait)
2Timeout (for review wait)
3Error (API error, auth error, validation)

GHPR uses two different ID types for comments:

FormatTypeUsage
PRRT_*Thread IDUsed with comment resolve
NumericComment IDUsed with comment reply

Both IDs are displayed when listing comments.

Prerequisites:

  • .NET 8.0 SDK or later
  • GitHub CLI (gh) authenticated

Install Latest:

Terminal window
gh release download --repo LeverageSoftwareGroup/ghpr --pattern 'install.sh' --output - | bash

Install Specific Version:

Terminal window
gh release download v1.2.3 --repo LeverageSoftwareGroup/ghpr --pattern 'install.sh' --output - | bash -s -- 1.2.3

Uninstall:

Terminal window
dotnet tool uninstall -g ghpr