`gh stack view --json` omits the stack number that the text output prints
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start at the gh stack view --json entry point and compare its payload with the human-readable gh stack view --short output. The change is done when the JSON includes the stack identifier as a top-level number field, while the existing branches, currentBranch, and trunk fields remain available; check the command's existing tests if present.
Written by the indexing model from the issue text.
Description
Summary
gh stack view prints the stack number in its human-readable output, but gh stack view --json omits it:
$ gh stack view --short
Stack #6
» stack-b-one ○ #4 (current)
...
$ gh stack view --json | jq 'keys'
[
"branches",
"currentBranch",
"trunk"
]
The per-branch objects carry pr.number, pr.url and pr.state, but the stack's own identifier is nowhere in the payload.
Why this matters
The stack number is the identifier gh stack checkout and gh stack link take, and the one shown in the GitHub stack UI — so it is the natural key for any automation. Because it is missing from the machine-readable output, scripts have to scrape it from gh stack submit's human-readable text (✓ Stack created on GitHub with 2 PRs (stack #6)) or from the UI.
Expected
Include the stack number as a top-level field in --json output, e.g. "number": 6, so --json is sufficient on its own.
Environment
gh2.97.0gh-stackv0.1.0- git 2.50.1
- macOS 26.4.1, darwin/arm64
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 73
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/gh-stack
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
feature request topic: cli - general
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
feature request topic: auto-merge
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug topic: docs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
feature request topic: cli - push
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·