关于 gh-issue-sync
gh-issue-sync 在 GitHub 问题与仓库中的 Markdown 文件之间同步内容,可从命令行编辑和管理问题。它还支持临时问题 ID,并在推送后更新相关引用。
主要功能
- 01拉取和推送问题 Markdown 文件
- 02创建、关闭、重开和列出问题
- 03跟踪标签、受派人、里程碑及关联
- 04为新问题使用临时 ID
- 05通过 Markdown 文件发布评论
适用场景
- 01在仓库中本地编辑问题详情
- 02推送前预览本地问题变更
- 03创建问题并更新临时 ID 的引用
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ mitsuhiko/ gh-issue-sync --skill gh-issue-sync安装后在 Claude Code 中输入/gh-issue-sync确认已加载。
附带文件embed.go
详细介绍
gh-issue-sync
将 GitHub issue 同步到本地 Markdown 文件,存放在 .issues/open/ 和 .issues/closed/ 中。
命令
gh-issue-sync init # Initialize in git repo
gh-issue-sync pull # Fetch open issues (--all for closed too)
gh-issue-sync push # Push local changes (--dry-run to preview)
gh-issue-sync list # List issues (supports gh issue list flags + --search)
gh-issue-sync new "Title" # Create issue (--label, --edit)
gh-issue-sync close 42 # Close (--reason completed|not_planned)
gh-issue-sync reopen 42
gh-issue-sync status # Show local changes
gh-issue-sync diff 42 # Show diff (--remote to re-fetch)
文件格式
.issues/open/42-fix-login-bug.md:
---
title: Fix login bug
labels: [bug, priority:high]
assignees: [alice]
milestone: v1.0
state: open
# For closed: state_reason: completed|not_planned
# Optional: parent: 10, blocked_by: [11, 12], blocks: [15]
---
Issue body in Markdown.
Issue 编号从文件名中获取,不存储在 frontmatter 中。
临时 Issue
新建的 issue 会获得一个以 T 开头的 ID(例如,T1a2b3c)。文件名必须以 T 开头:
.issues/open/T1a2b3c-my-new-issue.md
执行 push 时,文件会被重命名为实际 issue 编号(例如,42-my-new-issue.md),并更新 frontmatter 中的 number:。其他 issue 中的所有 #T1a2b3c 引用也会更新为 #42。
评论
若要在推送时发表评论,请在 issue 旁边创建一个 .comment.md 文件:
.issues/open/42.comment.md
.issues/open/42-fix-login-bug.comment.md
内容为纯 Markdown。发表评论后,该文件会被删除。
注意事项
- Pull 会跳过冲突;使用
--force覆盖本地内容
评论
支持 Markdown