github / github/gh-stack

`gh stack view --json` omits the stack number that the text output prints

オープン 初心者向け
#416 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
feature request topic: cli - view
主要言語
Go
スター
1.5k
フォーク
70
平均マージ
1日 8時間
マージ済み PR(30日)
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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。