gh discussion commands cover repository discussion workflows
Introduced 2026-06-10 · score 0.99
HOW TO USE IT
When a repository has GitHub Discussions enabled, use GitHub CLI v2.94.0 or later to list, view, create, edit, and comment on discussions with `gh discussion` commands.
gh discussion list --repo <owner>/<repo>
gh discussion view <number> --repo <owner>/<repo> --comments
gh discussion create --repo <owner>/<repo> --title "<title>" --category "<category>" --body "<body>"
gh discussion edit <number> --repo <owner>/<repo> --title "<new-title>" --body "<new-body>"
gh discussion comment <number> --repo <owner>/<repo> --body "<comment>"WHY THIS HELPS
When working in a repository with GitHub Discussions enabled, list, read, create, edit, or comment on discussions from the terminal.
REQUIREMENTS AND LIMITATIONS
- Version: v2.94.0
- Requires Install or upgrade to GitHub CLI v2.94.0.
- <number> (required): Discussion number for view, edit, or comment; view also accepts a discussion URL.
- --repo <owner>/<repo>: Select a repository; otherwise the command uses the repository inferred from context.
- --comments: Fetch and display discussion comments with `view`.
- --title <title> (required): Discussion title when creating non-interactively; new title when editing.
- --category <name-or-slug> (required): Discussion category name or slug when creating non-interactively.
- --body <text> (required): Discussion body when creating non-interactively; replacement body when editing; comment text when commenting. `--body` and `--body-file` are mutually exclusive where both are supported.
- --body-file <file>: Read discussion or comment body from a file; `-` reads standard input. Mutually exclusive with `--body`.
- Authentication (required): Authenticate with `gh auth login` or provide `GH_TOKEN`/`GITHUB_TOKEN`; the docs do not specify discussion-specific scopes.
- Prerequisite: Install or upgrade to GitHub CLI v2.94.0 or later.
- Prerequisite: The target repository must have GitHub Discussions enabled.
- Prerequisite: Authenticate with GitHub CLI or set `GH_TOKEN`/`GITHUB_TOKEN`.
- Use on repositories where GitHub Discussions is enabled.
FIRST-PARTY EVIDENCE
- https://github.blog/changelog/2026-06-10-list-view-and-create-discussions-in-github-cli
- https://raw.githubusercontent.com/cli/cli/v2.94.0/pkg/cmd/discussion/create/create.go
- https://raw.githubusercontent.com/cli/cli/v2.94.0/pkg/cmd/discussion/view/view.go
- https://raw.githubusercontent.com/cli/cli/v2.94.0/pkg/cmd/discussion/list/list.go
- https://raw.githubusercontent.com/cli/cli/v2.94.0/pkg/cmd/discussion/comment/comment.go
- https://cli.github.com/manual/index
- https://github.com/cli/cli/releases/tag/v2.94.0
Check the installed version and the source before using it. Entry JSON