GH-DISCUSSION-VIEW(1)
π gh-discussion-view β GitHub CLI manual, bestie edition β¨
okay so real talk, this one is a whole vibe: gh-discussion-view β View a discussion (preview). yes it says preview, meaning it's still in its soft-launch era, so be nice to it π«Ά
πΈ SYNOPSIS πΈ
gh discussion view {<number> | <discussion-url> | <comment-id> |
<comment-url>} [flags]
like, you just hand it one of those four things and it does its thing π
β¨ DESCRIPTION β¨
So what it does: it pulls up the title, the body, and all the other lil info about a discussion. Iconic. β¨
Wanna see the comments too? You gotta pass --comments, ok? Otherwise you're just getting the main character post with no replies. And ngl, a few of the latest replies of each comment will also be retrieved regardless of the selected ordering β so you're always getting a lil taste of the newest stuff no matter what order you asked for π
Now, if you want the full reply thread of one single comment? Different move entirely: pass a comment node ID or a comment URL as the argument instead of a discussion. Like this: https://github.com/OWNER/REPO/discussions/123#discussioncomment-456 β that's the one, iykyk π₯
Pagination and ordering are yours to control via --order, --limit, and --after. Go off, queen π
And if you'd rather just yassify your browser β use --web to open the discussion or comment in a web browser instead. no terminal needed, we're being β¨visualβ¨ today.
π OPTIONS π
--after <string>β cursor for the next page. like a bookmark for your next scroll, fr.-c,--commentsβ view discussion comments. this is the one you want if you actually want the tea β-q,--jq <expression>β filter JSON output using a jq expression. chef's kiss for scripting besties.--json <fields>β output JSON with the specified fields. (see the JSON FIELDS section below, we got you π)-L,--limit <int>(default30) β maximum number of comments or replies to fetch. default's30, so that's your starting point β¨--order <string>(default"newest") β order of comments or replies:{oldest|newest}. defaults to"newest"so you see the fresh stuff first π-R,--repo <[HOST/]OWNER/REPO>β select another repository using the[HOST/]OWNER/REPOformat. repo-hopping? valid.-t,--template <string>β format JSON output using a Go template; seegh help formatting. customise to your heart's content π-w,--webβ open a discussion in the browser. main character energy, browser edition π
π¦ JSON FIELDS π¦
here's the full roster, no gatekeeping, all of them, slay:
answerChosenAt, answerChosenBy, answered, author, body, category, closed, closedAt, comments, createdAt, id, labels, locked, number, reactionGroups, state, stateReason, title, updatedAt, url
π EXIT CODES π
bestie, read these so you know what just happened:
0: Successful execution β we ate π1: Error β it's giving oops π2: Command canceled β you backed out, no judgement π4: Authentication required β you gotta log in first, love,gh auth loginhours π«Ά
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. (iykyk, always check the help β¨)
π§ EXAMPLE π§
copy these exactly, they're literally free:
# View a discussion by number
$ gh discussion view 123
# View a discussion by URL
$ gh discussion view https://github.com/OWNER/REPO/discussions/123
# View with comments
$ gh discussion view 123 --comments
# View with oldest comments first
$ gh discussion view 123 --comments --order oldest
# Limit to 10 comments
$ gh discussion view 123 --comments --limit 10
# Fetch the next page of comments
$ gh discussion view 123 --comments --after CURSOR
# View the reply thread of a comment by node ID
$ gh discussion view DC_abc123
# View the reply thread of a comment by URL
$ gh discussion view 'https://github.com/OWNER/REPO/discussions/123#discussioncomment-456'
# Paginate through replies
$ gh discussion view DC_abc123 --limit 10 --after CURSOR
# Open in browser
$ gh discussion view 123 --web
π SEE ALSO π
gh-discussion(1)β the whole discussion family, go say hi π
okay that's the whole page, you're officially fluent ππ
GitHub CLI v2.102.0 Β· Oct 2026 β mwah, love u, go view some discussions ππ
π¦ 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