GH-PR-COMMENT(1)
π¬ gh-pr-comment β the manual page, bestie edition
okay so gh-pr-comment is literally just the GitHub CLI manual entry for dropping a comment on a pull request. that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
gh-pr-comment β add a comment to a pull request π
πΈ SYNOPSIS πΈ
gh pr comment [<number> | <url> | <branch>] [flags]
like, you point it at a PR (by number, url, or branch, or honestly nothing at all) and it comments. iconic behavior.
π¦ DESCRIPTION π¦
So the whole point: add a comment to a GitHub pull request. that's it. that's the gig π
If you don't hand it any body text or attachments through flags, the command will interactively prompt you for the comment text. it's not gonna just guess, bestie π
Use --attach to upload an image or video. and here's the tea β if the body already references an attached file, like , that reference gets rewritten to point at the uploaded asset. slay. any attached file the body does not reference gets appended to the end of the comment. and you can attach up to 50 files per command. fifty. go off π
Alt text for an image follows the path after #, as in --attach './login.png#The login error state'. Without it, the filename is used. A reference already in the body keeps the alt text written there. Video renders as a player and has no alt text, so it cannot be given any β sorry to the video alt-text girlies, it's just not a thing π
β OPTIONS β
--attach <file>β attach an image or video file, in#format π-b,--body <text>β the comment body text, aka the actual words-F,--body-file <file>β read body text from a file (use"-"to read from standard input) π--create-if-noneβ create a new comment if no comments are found. can be used only with--edit-lastβ οΈ--delete-lastβ delete the last comment of the current user π--edit-lastβ edit the last comment of the current user βοΈ-e,--editorβ skip prompts and open the text editor to write the body in-w,--webβ open the web browser to write the comment π--yesβ skip the delete confirmation prompt when--delete-lastis provided β
π OPTIONS INHERITED FROM PARENT COMMANDS π
-R,--repo <[HOST/]OWNER/REPO>β select another repository using the[HOST/]OWNER/REPOformat π§
π₯ EXIT CODES π₯
0: Successful execution β¨1: Error π2: Command canceled4: Authentication required π
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. fr fr, check the help π
πΈ EXAMPLE πΈ
# Add a comment to a pull request
$ gh pr comment 13 --body "Hi from GitHub CLI"
# Attach a screenshot, with alt text after "#"
$ gh pr comment 13 --attach './login.png#The login error state'
# Attach multiple files by repeating the flag
$ gh pr comment 13 --attach ./before.png --attach ./after.png
π SEE ALSO π
gh-pr(1) β go read that one too, iykyk π«Ά
kay that's the whole page babes β this was the GitHub CLI manual, version v2.102.0, dated Oct 2026. mwah, go comment on something π
π¦ where this page comes from
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms