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.
Command Groups
Section titled “Command Groups”Review Commands
Section titled “Review Commands”| Command | Description |
|---|---|
| ghpr review request | Request a review from a user, team, or Copilot |
| ghpr review status | Check the current review status of a PR |
| ghpr review wait | Poll until a review is complete |
Comment Commands
Section titled “Comment Commands”| Command | Description |
|---|---|
| ghpr comment list | List comment threads on a PR |
| ghpr comment reply | Reply to a specific comment thread |
| ghpr comment resolve | Resolve a comment thread |
Utility Commands
Section titled “Utility Commands”| Command | Description |
|---|---|
| ghpr update | Update ghpr to the latest version |
Authentication
Section titled “Authentication”Token resolution order (first match wins):
--tokenCLI optionGPR_PATenvironment variable.ghprfile in current directorygh auth tokencommand output (GitHub CLI)
Required Permissions:
reposcope for private repositoriespublic_reposcope for public repositories only
Repository Discovery
Section titled “Repository Discovery”Repository is determined by (in order):
--repoCLI option (owner/repoformat)- Git remote URL (prefers
upstreamoverorigin) - Current directory git config
Global Options
Section titled “Global Options”All commands support these options:
| Option | Description |
|---|---|
-t, --token <token> | GitHub personal access token |
-r, --repo <owner/repo> | Repository in owner/repo format |
Common Exit Codes
Section titled “Common Exit Codes”| Code | Meaning |
|---|---|
0 | Success |
1 | Changes requested (for review wait) |
2 | Timeout (for review wait) |
3 | Error (API error, auth error, validation) |
ID Types
Section titled “ID Types”GHPR uses two different ID types for comments:
| Format | Type | Usage |
|---|---|---|
PRRT_* | Thread ID | Used with comment resolve |
| Numeric | Comment ID | Used with comment reply |
Both IDs are displayed when listing comments.
Installation
Section titled “Installation”Prerequisites:
- .NET 8.0 SDK or later
- GitHub CLI (
gh) authenticated
Install Latest:
gh release download --repo LeverageSoftwareGroup/ghpr --pattern 'install.sh' --output - | bashInstall Specific Version:
gh release download v1.2.3 --repo LeverageSoftwareGroup/ghpr --pattern 'install.sh' --output - | bash -s -- 1.2.3Uninstall:
dotnet tool uninstall -g ghpr