GH-DISCUSSION-COMMENT(1)
π¬ GH-DISCUSSION-COMMENT π¬
okay bestie, so this is a page from the GitHub CLI manual and it's literally all about gh-discussion-comment β the vibe is giving "let me manage my discussion comments real quick" and honestly? iconic. β¨
πΈ NAME πΈ
gh-discussion-comment β add, edit, or delete a comment or a reply on a discussion (preview) π«Ά
π SYNOPSIS π
gh discussion comment {<number> | <discussion-url> | <comment-id> |
<comment-url>} [flags]
β¨ DESCRIPTION β¨
So like, this command manages comments or replies on a GitHub discussion. That's the whole thing. Lowkey elegant, ngl. π
The positional argument can be one of two flavors:
- a discussion number or URL β this is how you add a brand new top-level comment
- a comment node ID or comment URL β this is how you reply to, edit, or delete that specific comment
When the argument is a discussion number or URL, the default action is to add a new top-level comment. And likewise (love a "likewise" moment), if the argument is a comment URL or ID, the default action is to add a reply. π¦
Then you've got your switches:
- use
--editto update the comment/reply body - use
--deleteto remove it entirely
And where does the body come from, you ask? You can supply it via --body, via --body-file, or interactively through an editor. Three options, all slaying. π
π₯ OPTIONS π₯
-b,--body <string>β the comment body text, like the actual words you're saying π¬-F,--body-file <string>β read the body text from a file (pass"-"to read from standard input, cute)--deleteβ delete the specified comment π--editβ edit the specified comment βοΈ-R,--repo <[HOST/]OWNER/REPO>β pick a different repository using the[HOST/]OWNER/REPOformat--yesβ skip the delete confirmation prompt, living dangerously (but efficiently) π
β EXIT CODES β
0β successful execution, we ate π1β error, tragic π2β command canceled4β authentication required, go log in bestie π
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. iykyk π
π EXAMPLE π
# Add a top-level comment to discussion #123
$ gh discussion comment 123 --body 'Thanks'
# Reply to a comment using its URL
$ gh discussion comment 'https://github.com/OWNER/REPO/discussions/123#discussioncomment-456' --body 'Thanks'
# Reply to a comment using its node ID
$ gh discussion comment DC_abc123 --body 'Thanks'
# Edit a comment/reply
$ gh discussion comment 'https://github.com/OWNER/REPO/discussions/123#discussioncomment-456' --edit --body 'Thanks'
# Delete a comment/reply
$ gh discussion comment 'https://github.com/OWNER/REPO/discussions/123#discussioncomment-456' --delete
# Delete a comment/reply without confirmation prompt
$ gh discussion comment 'https://github.com/OWNER/REPO/discussions/123#discussioncomment-456' --delete --yes
π§ SEE ALSO π§
gh-discussion(1)β the main character this one hangs out with π«
and that's the whole page, bestie!! brought to you by GitHub CLI v2.102.0, dated Oct 2026 β go forth and comment responsibly ππβ¨
π¦ 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