GH-DISCUSSION-CREATE(1)

πŸ’¬ gh-discussion-create β€” the GitHub CLI manual, bestie edition ✨

okay so real talk, this page is from the GitHub CLI manual, and it's all about gh-discussion-create β€” the lil command that spins up a brand new discussion. it's still in preview btw, so don't come for me if things shift πŸ‘€


✨ SYNOPSIS ✨

gh discussion create [flags]

like, that's it. that's the whole vibe. flags optional-ish (we'll get to that πŸ‘€).


πŸ¦‹ DESCRIPTION πŸ¦‹

So gh discussion create makes a new GitHub Discussion in a repository. slay.

Here's the tea tho β€” there are two whole modes and you gotta pick your fighter:

  • non-interactive mode πŸ’… β€” if you pass --title, --body (or --body-file), and --category, the discussion just gets created, no questions asked. iconic, efficient, main character behavior.
  • interactive mode πŸŽ€ β€” the second you leave any of those flags out, you get hit with interactive prompts β€” but only when you're connected to a terminal, iykyk.
fr fr: all three of those flags together = no prompts. miss even one = prompts (if you're in a terminal). no cap.

🌸 OPTIONS 🌸

  • -b, --body <string> β€” the actual body text of your discussion. the words. the content. the moment πŸ’–
  • -F, --body-file <string> β€” read the body from a file instead. and yes bestie, "-" means read it from stdin 🫢
  • -c, --category <string> β€” the category for the discussion, by name or by slug
  • -l, --label <strings> β€” labels to slap on the discussion (plural, so you can stack 'em like stickers on a laptop ⭐)
  • -R, --repo <[HOST/]OWNER/REPO> β€” point at a different repo using the [HOST/]OWNER/REPO format πŸ¦‹
  • -t, --title <string> β€” the title of your discussion. make it good, make it clickbait-adjacent πŸ‘‘

πŸ’€ EXIT CODES πŸ’€

these are the numbers it throws at you when it's done (or not):

  • 0 β€” successful execution πŸŽ‰ everything ate, no crumbs
  • 1 β€” error 😭
  • 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. i don't make the rules πŸ’…

πŸ”₯ EXAMPLE πŸ”₯

# Create interactively
$ gh discussion create

# Create non-interactively
$ gh discussion create --title "My question" --category "Q&A" --body "Details here"

see how the second one has all three? yeah. that's the non-interactive trifecta ✨ first one? just vibes and prompts 🌈


πŸ‘‘ SEE ALSO πŸ‘‘


k bye, go start a discussion, be brave, be iconic πŸ’œ

πŸŽ€ this has been the GitHub CLI manual β€” GitHub CLI v2.102.0, dated Oct 2026. drink water, read the docs, mwah 🫢

πŸ“¦ where this page comes from