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 --edit to update the comment/reply body
  • use --delete to 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/REPO format
  • --yes β€” skip the delete confirmation prompt, living dangerously (but efficiently) πŸ’€

⭐ EXIT CODES ⭐

  • 0 β€” successful execution, we ate πŸ‘‘
  • 1 β€” error, tragic 😭
  • 2 β€” command canceled
  • 4 β€” 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 🧚


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