GH-ISSUE-COMMENT(1)
π¬ gh-issue-comment(1) β the GitHub CLI manual, bestie edition β¨
okay so real talk: this is gh-issue-comment, straight out of the GitHub CLI manual, and it's literally the glow-up your issue threads have been waiting for. let's get into it π«Ά
πΈ NAME πΈ
gh-issue-comment β bestie, it adds a comment to an issue. that's the whole vibe β¨
π SYNOPSIS π
gh issue comment {<number> | <url>} [flags]
like, you point it at an issue β either by its <number> or its <url> β and then you sprinkle flags on top as needed π
π¦ DESCRIPTION π¦
Add a comment to a GitHub issue. iconic behavior, no cap.
If you don't hand it body text or attachments through flags, the command will interactively prompt you for the comment text. so it's not just gonna post an empty comment and embarrass you in front of the whole repo π
Use --attach to upload an image or video. here's the cute part: if the body already references an attached file β like  β that reference gets rewritten to point at the uploaded asset. slay. and any attached file the body doesn't reference just gets appended to the end of the comment, so nothing gets left behind π
You can attach up to 50 files per command. that's a lot of screenshots, 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. if a reference already exists in the body, it keeps the alt text written there. video renders as a player and has no alt text, so it cannot be given any β that's just how it is, no notes π
β¨ OPTIONS β¨
--attach <file>β attach an image or video file, in the#format. you can repeat this flag to attach multiple files, up to 50 per command π-b,--body <text>β the comment body text. the words themselves, right there on the command line π¬-F,--body-file <file>β read body text from a file. use-to read from standard input, iykyk π--create-if-noneβ create a new comment if no comments are found. heads up though: this can be used only with--edit-lastβ¨--delete-lastβ delete the last comment of the current user. the undo button for your last post π--edit-lastβ edit the last comment of the current user. rewrite your own lore, respectfully βοΈ-e,--editorβ skip prompts and open the text editor to write the body in. for the girls who draft in vim π-w,--webβ open the web browser to write the comment. sometimes you just want the GUI, and that's valid π--yesβ skip the delete confirmation prompt when--delete-lastis provided. no take-backs, bestie π
π OPTIONS INHERITED FROM PARENT COMMANDS π
-R,--repo <[HOST/]OWNER/REPO>β select another repository using the[HOST/]OWNER/REPOformat. pointing at a different repo, no big deal π
π EXIT CODES π
vibe check on how it went:
0β Successful execution. ate, left no crumbs π1β Error. it's giving something went wrong π2β Command canceled. you backed out, and that's okay π«Ά4β Authentication required. log in first, bestie π
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.
πΈ EXAMPLE πΈ
# Add a comment to an issue
$ gh issue comment 12 --body "Hi from GitHub CLI"
# Attach a screenshot, with alt text after "#"
$ gh issue comment 12 --attach './login.png#The login error state'
# Attach multiple files by repeating the flag
$ gh issue comment 12 --attach ./before.png --attach ./after.png
the three moods: just text, one screenshot with alt text, and the before/after glow-up πβ¨
π§ SEE ALSO π§
gh-issue(1)β the parent command, the main character
okay that's the whole page!! this was GitHub CLI v2.102.0, dated Oct 2026 β mwah, go comment on some issues, bestie πππ¦
π¦ 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