Extended GitHub CLI that provides pull request and issue comment operations not available in the standard gh CLI.
Uses the GitHub GraphQL API directly.
- A GitHub token set via
GH_TOKENorGITHUB_TOKEN, or the gh CLI authenticated withgh auth login(used as fallback)
Download the latest binary from releases.
Or build from source (requires Go 1.21+):
go install github.com/tomzxcode/ghx@mainAll commands accept --repo OWNER/REPO (or -R) to target a specific repository. If omitted, the repository is detected from the current git remote.
# Top-level comment
ghx pr comment 42 --body "Looks good"
# Inline comment on a file
ghx pr comment 42 --file src/main.go --line 10 --body "Nit: use fmt.Errorf"
# Inline comment on a line range
ghx pr comment 42 --file src/main.go --line 10-15 --body "Consider extracting this"
# File-level comment
ghx pr comment 42 --file src/main.go --body "Overall looks clean"
# Reply to an existing thread
ghx pr comment 42 --reply-thread <thread-id> --body "Agreed"
# Read body from stdin or a file
ghx pr comment 42 --body-file -
ghx pr comment 42 --body-file comment.txtUse --pending to add comments to a pending review instead of submitting them immediately:
ghx pr comment 42 --file src/main.go --line 10 --body "Nit" --pending
ghx pr comment 42 --reply-thread <thread-id> --body "Reply" --pendingSubmit the review when ready:
ghx pr review submit 42 --event COMMENT
ghx pr review submit 42 --event APPROVE --body "LGTM"Use --stash to save comments directly to a local stash entry without any GitHub API calls.
Each stash entry is stored as a separate YAML file on disk.
Supports multiple stash entries like git stash:
# Add a comment to stash@{0} (auto-created if no stashes exist)
ghx pr comment 42 --file src/main.go --line 10 --body "Nit" --stash
ghx pr comment 42 --file src/main.go --line 20-25 --body "Consider extracting" --stash
# See what's stashed
ghx pr review stash list 42
# Restore all stashed comments into a pending review
ghx pr review stash pop 42
# Add to a specific stash entry
ghx pr comment 42 --file src/main.go --line 30 --body "Another" --stash=1# Create a pending review
ghx pr review create 42
# List your pending reviews
ghx pr review list 42
# Discard a pending review
ghx pr review discard <review-id>Save pending review comments to local disk so you can post immediate comments, or accumulate review comments offline:
# Save pending comments to stash@{0} and delete the pending review
ghx pr review stash push 42
# With a description
ghx pr review stash push 42 -m "nit comments"
# Push another pending review as stash@{0} (previous becomes stash@{1})
ghx pr review stash push 42
# List all stash entries
ghx pr review stash list 42
# Pop stash@{0} into a pending review (stash preserved on failure)
ghx pr review stash pop 42
# Pop a specific stash entry
ghx pr review stash pop 42 --stash 1
# Drop stash@{0} without restoring
ghx pr review stash drop 42# List open threads
ghx pr threads 42
# Show a specific thread
ghx pr threads 42 --thread <thread-id>
# Include comment IDs (for edit/delete)
ghx pr threads 42 --ids
# Filter by state
ghx pr threads 42 --state all
ghx pr threads 42 --state resolvedghx pr comment edit <comment-id> --body "Updated text"
ghx pr comment edit <comment-id> --body-file updated.txtWhen submitting an immediate inline comment or reply (without --pending) on a PR that has an existing pending review, ghx will temporarily stash the pending review comments to disk, submit the comment, and then restore them.
This is necessary because GitHub does not allow mixing immediate and pending review comments on the same PR.
Automatically detects whether the PR comment is a review comment or an issue comment.
ghx pr comment delete <comment-id>Use ghx pr threads <number> --ids to find comment IDs.
# Add a comment
ghx issue comment 42 --body "This is fixed in #50"
# Read body from stdin or a file
ghx issue comment 42 --body-file -
ghx issue comment 42 --body-file comment.txt# View issue description and comments
ghx issue view 42
# Include comment IDs (for edit/delete)
ghx issue view 42 --idsghx issue comment edit <comment-id> --body "Updated text"
ghx issue comment edit <comment-id> --body-file updated.txtghx issue comment delete <comment-id>Use ghx issue view <number> --ids to find comment IDs.