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
gh 2.97.0
gh-stack v0.1.0
- git 2.50.1
- macOS 26.4.1, darwin/arm64
Summary
gh stack viewprints the stack number in its human-readable output, butgh stack view --jsonomits it:The per-branch objects carry
pr.number,pr.urlandpr.state, but the stack's own identifier is nowhere in the payload.Why this matters
The stack number is the identifier
gh stack checkoutandgh stack linktake, 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 fromgh 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
--jsonoutput, e.g."number": 6, so--jsonis sufficient on its own.Environment
gh2.97.0gh-stackv0.1.0