docs: record gh default disclosure behavior

This commit is contained in:
Codex
2026-07-01 09:21:37 +00:00
parent 31b6286017
commit b1bec61e49
2 changed files with 9 additions and 3 deletions
+3
View File
@@ -13,6 +13,7 @@ GitHub issue/PR 正式读写必须走 `bun scripts/cli.ts gh ...` 或 `trans gh:
- 新 issue 正文必须包含 `目标合并分支: <repo branch/lane>`;不需要合并时写 `目标合并分支: 不适用`
- 大计划、后续阶段和独立改进方向创建新 issue;已有 issue 评论只写短进展、证据、阻塞和链接。
- 规划型、多阶段、架构/API/平台运维类 issue 第一阶段必须 `P0 SPEC 先行`;细则见 [references/full.md](references/full.md) 的 `多阶段 Issue 与 SPEC-First`
- `gh` 默认输出是 k8s 风格 text/table/summary/Next/Disclosure;脚本消费或全量排障必须显式用 `--json``--full``--raw`
- 多行正文使用 quoted heredoc`--body-stdin <<'EOF'`;不要把长 Markdown 塞进 shell 参数。
- PR merge 只走 guarded `gh pr merge``gh pr create` 的 Next 默认是 `--merge --delete-branch`,只有确认 ancestry 可丢弃时才显式 `--squash`
@@ -21,8 +22,10 @@ GitHub issue/PR 正式读写必须走 `bun scripts/cli.ts gh ...` 或 `trans gh:
```bash
bun scripts/cli.ts gh auth status --repo pikasTech/unidesk
bun scripts/cli.ts gh issue list --repo pikasTech/unidesk --state open --limit 30
bun scripts/cli.ts gh issue view <number> --repo pikasTech/unidesk
bun scripts/cli.ts gh issue view <number> --repo pikasTech/unidesk --json body,title,state
bun scripts/cli.ts gh issue create --repo pikasTech/unidesk --title "标题" --body-stdin
bun scripts/cli.ts gh pr list --repo pikasTech/unidesk --state all --limit 10
bun scripts/cli.ts gh pr create --repo pikasTech/unidesk --title "标题" --body-stdin --base master --head <branch>
bun scripts/cli.ts gh pr preflight <number> --repo pikasTech/unidesk
bun scripts/cli.ts gh pr merge <number> --repo pikasTech/unidesk --merge --delete-branch
+6 -3
View File
@@ -85,6 +85,7 @@ bun scripts/cli.ts gh issue list [owner/repo] \
```
默认 `state=open``limit=30``owner/repo` 位置参数等价 `--repo``--search` 走 GitHub Search API 做查重。`--title-prefix` 在当前有界结果内按 issue 标题前缀做本地过滤,输出 `titleFilter` 的输入/输出/过滤数量,适合 `[FEEDBACK]` 去重:
默认 stdout 是有界表格和短摘要;`--json``--full``--raw` 是显式结构化/全量披露入口。
```bash
bun scripts/cli.ts gh issue list --repo pikasTech/unidesk --state all \
@@ -100,7 +101,7 @@ bun scripts/cli.ts gh issue view <number|url|owner/repo#number> \
```
`read` 是兼容别名。支持 `owner/repo#number` shorthand(如 `pikasTech/HWLAB#1024`)。
人工读取 issue/PR 正文优先走 `trans gh:/owner/repo/issue/<number> cat|rg``trans gh:/owner/repo/pr/<number> cat|rg``gh issue view/read` 主要保留为结构化 JSON 底座、metadata 读取和兼容入口
默认 stdout 是 issue 元数据表格、短摘要、body chars/SHA/preview 和 Next 命令,不输出完整 body。人工读取 issue/PR 正文优先走 `trans gh:/owner/repo/issue/<number> cat|rg``trans gh:/owner/repo/pr/<number> cat|rg`脚本消费或字段读取使用 `--json <fields>`,全量排障才用 `--full`/`--raw`
`--json comments` 默认只返回 comment id、URL、作者、时间、正文字符数、body SHA 和短 preview`--full` 仍保持评论列表有界,只有 `--raw` 会显式展开所有评论正文。读取单条完整 comment body 使用 `gh issue comment view <commentId> --full`,显式 `--json` 路径的 comments 位于 `.data.json.comments`,不要依赖顶层重复 comments。
### 创建
@@ -243,6 +244,8 @@ bun scripts/cli.ts gh pr list [owner/repo] \
[--state open|closed|all] [--json ...] [--raw|--full]
```
默认 stdout 是 PR 表格和短摘要,不输出 PR body 或 closeout metadata。脚本消费字段用 `--json`,全量排障用 `--full`/`--raw`
### 查看
```bash
@@ -252,7 +255,7 @@ bun scripts/cli.ts gh pr view <number|url|owner/repo#number> \
[--raw|--full]
```
`stateDetail` 归一化为 `open|closed|merged``mergeable`/`mergeStateStatus`/`statusCheckRollup` 走 GraphQL。
默认 stdout 是 PR 元数据表格、短摘要、body chars/SHA/preview 和 Next 命令,不输出完整 body。`stateDetail` 归一化为 `open|closed|merged``mergeable`/`mergeStateStatus`/`statusCheckRollup` 走 GraphQL,且仅在显式请求相关 `--json` 字段或 `--full`/`--raw` 时读取
### 文件变更
@@ -260,7 +263,7 @@ bun scripts/cli.ts gh pr view <number|url|owner/repo#number> \
bun scripts/cli.ts gh pr files <number> [--repo owner/name] [--limit N]
```
返回 changed files 统计,不输出 raw diff。`gh pr diff <number> --stat` 是兼容别名。
默认 stdout 是 changed files 统计表格,不输出 raw diff。`gh pr diff <number> --stat` 是兼容别名。
### 收口预检