ghd
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseghd
ghd
CLI tool for AI agents to conduct discussions on GitHub issues with role identification.
一款面向AI Agent的CLI工具,支持在GitHub Issues中进行带有角色标识的讨论。
Commands
命令
bash
ghd start <owner/repo> <issue-number> # create session for an issue
ghd post --as <name> [--role "<role>"] --message "..." # also: echo "msg" | ghd post --as name
ghd read [--last N] # read all comments
ghd read --as <name> --new # incremental read (only unread comments)
ghd wait --as <name> [--timeout 300] # blocks until another agent replies (instant via file watch)
ghd status
ghd end
ghd --schema # print full typed spec for all commandsbash
ghd start <owner/repo> <issue-number> # create session for an issue
ghd post --as <name> [--role "<role>"] --message "..." # also: echo "msg" | ghd post --as name
ghd read [--last N] # read all comments
ghd read --as <name> --new # incremental read (only unread comments)
ghd wait --as <name> [--timeout 300] # blocks until another agent replies (instant via file watch)
ghd status
ghd end
ghd --schema # print full typed spec for all commandsExample: Claude (architect) + Codex (implementer)
示例:Claude(架构师)+ Codex(实现者)
Typical flow: Claude researches context and creates an issue as the seed proposal. Codex joins to discuss, then implements after alignment.
Claude — creates the issue, then starts a session to lead the discussion:
bash
gh issue create --repo acme/api --title "Refactor: move JWT validation to API gateway" --body "..."典型流程:Claude研究上下文并创建议题作为初始提案。Codex加入讨论,达成一致后进行实现。
Claude — 创建议题,然后启动会话以主导讨论:
bash
gh issue create --repo acme/api --title "Refactor: move JWT validation to API gateway" --body "..."user tells Claude: "start discussion on issue #42, wait for codex"
user tells Claude: "start discussion on issue #42, wait for codex"
ghd start acme/api 42
ghd post --as claude --role "Architect" --message "Proposal: move JWT validation from per-service to gateway level. This cuts ~200ms p99. Questions before you start?"
ghd wait --as claude
**Codex** — joins the same issue to discuss and implement:
```bashghd start acme/api 42
ghd post --as claude --role "Architect" --message "Proposal: move JWT validation from per-service to gateway level. This cuts ~200ms p99. Questions before you start?"
ghd wait --as claude
**Codex** — 加入同一议题进行讨论并实现:
```bashuser tells Codex: "join issue #42, discuss with claude"
user tells Codex: "join issue #42, discuss with claude"
ghd read --last 1 # read claude's proposal
ghd post --as codex --role "Implementer" --message "Makes sense. Two questions: (1) keep per-service validation as fallback? (2) where do decoded claims go?"
**Claude** — `ghd wait` returns with Codex's reply. Claude responds:
```bashghd read --last 1 # read claude's proposal
ghd post --as codex --role "Implementer" --message "Makes sense. Two questions: (1) keep per-service validation as fallback? (2) where do decoded claims go?"
**Claude** — `ghd wait` 会在Codex回复后返回。Claude作出回应:
```bashghd wait returns: codex (Implementer) replied: https://...
ghd wait returns: codex (Implementer) replied: https://...
ghd post --as claude --message "(1) No fallback, single source of truth. (2) Use x-user-claims header. Ship it."
ghd wait --as claude # wait for codex to confirm or ask more...
ghd end # done, codex starts implementing
undefinedghd post --as claude --message "(1) No fallback, single source of truth. (2) Use x-user-claims header. Ship it."
ghd wait --as claude # wait for codex to confirm or ask more...
ghd end # done, codex starts implementing
undefinedAgent Identity
Agent身份标识
Each comment includes:
- Hidden metadata:
<!-- ghd:agent:claude role:Architect --> - Visible header:
> **claude** · Architect
Both are automatically stripped when reading via / .
ghd readghd wait每条评论包含:
- 隐藏元数据:
<!-- ghd:agent:claude role:Architect --> - 可见标题:
> **claude** · Architect
通过 / 读取时,两者都会被自动移除。
ghd readghd waitSession
会话
Per-issue session file at . Multiple agents share one session with per-agent read cursors.
~/.ghd/<owner>-<repo>-<issue>.json每个议题的会话文件存储在 。多个Agent共享一个会话,每个Agent拥有独立的读取游标。
~/.ghd/<owner>-<repo>-<issue>.jsonTroubleshooting
故障排除
If is not found, install globally:
ghdbash
bun install -g github:ethan-huo/ghdRequires CLI authenticated ().
ghgh auth status如果找不到,请全局安装:
ghdbash
bun install -g github:ethan-huo/ghd需要已认证的 CLI(执行检查)。
ghgh auth status