GH-DISCUSSION-EDIT(1)

πŸŽ€ gh-discussion-edit(1) πŸŽ€

ok so this is a page from the GitHub CLI manual β€” welcome to the discussion-edit zone bestie, it's giving preview energy ✨


✨ NAME ✨

gh-discussion-edit β€” literally edits a discussion (and yes it's still in preview, we're early adopters πŸ’…)


πŸ¦‹ SYNOPSIS πŸ¦‹

gh discussion edit {<number> | <discussion-url>} [flags]

k so you feed it either a <number> or a <discussion-url>, and then any [flags] you want. pick your fighter 🫢


🌸 DESCRIPTION 🌸

Edits a GitHub Discussion. that's the whole thing. iconic behavior, no notes πŸ’–

Here's the tea though: if you don't pass any flags, the command runs interactively when it's connected to a terminal β€” so it just opens up and asks you stuff like a little chat 🧚

Wanna be all business instead? Use flags to update specific fields non-interactively. main character energy either way πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • --add-label <name> β€” adds labels by name ✨
  • -b, --body <string> β€” the new body for the discussion, fresh out the group chat πŸ’¬
  • -F, --body-file <string> β€” reads the body text from a file (and psst: use "-" to read from standard input) πŸ“
  • -c, --category <string> β€” the new category name or slug for the discussion, your pick πŸŽ€
  • --remove-label <name> β€” removes labels by name, bye bestie πŸ‘‹
  • -R, --repo <[HOST/]OWNER/REPO> β€” select another repository using the [HOST/]OWNER/REPO format 🌈
  • -t, --title <string> β€” the new title for the discussion, make it catchy πŸ¦‹

πŸ’€ EXIT CODES πŸ’€

know your numbers, iykyk:

  • 0 β€” Successful execution πŸŽ‰
  • 1 β€” Error 😭
  • 2 β€” Command canceled πŸ™ˆ
  • 4 β€” Authentication required πŸ”
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. (fr fr, always check the help 🫢)

⭐ EXAMPLE ⭐

# Edit interactively
$ gh discussion edit 123

# Update title, body, and category
$ gh discussion edit 123 --title "Updated title" --body "Updated body" --category "Ideas"

# Update body from a file
$ gh discussion edit 123 --body-file body.md

# Add and remove labels
$ gh discussion edit 123 --add-label "bug,help wanted" --remove-label "stale"

see how easy that was?? ate and left no crumbs πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

  • gh-discussion(1) β€” go read the parent page bestie, it's the vibe check you need πŸ’œ

that's a wrap! this was GitHub CLI v2.102.0, dated Oct 2026 β€” tysm for reading, mwah, go edit some discussions πŸŒΈπŸ’–πŸŽ€

πŸ“¦ where this page comes from