Comments
ghx can add, reply to, edit, and delete comments on pull requests and issues.
PR comments go beyond the standard gh CLI: inline comments on specific lines, file-level comments, replies to review threads, and comments staged in a pending review or a local stash.
Top-level PR comment
ghx pr comment 10 --body "Looks good"
ghx pr comment 10 --body-file comment.txt
ghx pr comment 10 --body-file - # read body from stdin
Without --file, the comment is added as a top-level PR comment.
Inline comment on a line or range
ghx pr comment 10 --file src/main.go --line 42 --body "Nit"
ghx pr comment 10 --file src/main.go --line 42-45 --body "Consider extracting"
--line requires --file. A range is written as START-END.
File-level comment
Omit --line to leave a comment on an entire file:
Diff side
Inline comments default to the right-hand side of the diff. Use --side to comment on the left-hand side:
--side requires --file.
Reply to a review thread
Find thread IDs with ghx pr threads 10 (see Reviews). --reply-thread is mutually exclusive with --file and --line.
Stage a comment in a pending review
Add --pending to place a comment in a pending review instead of posting it immediately.
Pending reviews are submitted later with ghx pr review submit (see Reviews):
--pending requires --file or --reply-thread; it does not apply to top-level comments.
Save a comment to a local stash
Add --stash to save a comment to a local stash entry instead of calling the API.
Stashes are restored later with ghx pr review stash pop (see Reviews):
ghx pr comment 10 --file src/main.go --line 42 --body "Nit" --stash
ghx pr comment 10 --file src/main.go --line 42 --body "Nit" --stash=1 # target stash@{1}
--stash requires --file and is mutually exclusive with --pending.
Issue comments
Issue comments are always top-level.
Edit a comment
ghx pr comment edit <comment-id> --body "Updated text"
ghx issue comment edit <comment-id> --body "Updated text"
pr comment edit automatically detects whether the comment is an inline review comment or a top-level comment.
Delete a comment
Find comment IDs
Use --ids to display the node IDs needed for editing and deleting: