`gh stack view --json` omits the stack number that the text output prints
- 主要語言
- Go
- 星號
- 1.5k
- 分支
- 70
- 平均合併
- 1 天 8 小時
- 30 天內合併 PR
- 7
描述
## 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
貢獻指南
研究方向
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.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- go
- 領域
- cli
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 72/100