SKILL.md
readonlyread-only
name
github
description
GitHub CLI,用於處理 issues、PR、CI/檢查日誌、留言、審查、發行版、儲存庫及 gh api 查詢。
GitHub
使用 gh 處理 GitHub 相關操作。使用 git 處理本機提交/分支/推送/拉取。使用程式碼閱讀工具進行深度審查。
認證
gh auth status
gh auth login
Gateway 的 HOME 可能與操作者的 HOME 不同。如果 gh 的認證資訊存在於其他地方,請在 gateway 服務環境中設定 GH_CONFIG_DIR 並重新啟動。
PR
gh pr list --repo owner/repo --json number,title,state,author,url
gh pr view 55 --repo owner/repo --json title,body,author,files,commits,reviews,reviewDecision
gh pr checks 55 --repo owner/repo
gh pr diff 55 --repo owner/repo
gh pr create --repo owner/repo --title "feat: title" --body-file /tmp/pr.md
gh pr merge 55 --repo owner/repo --squash
URL 可直接使用:gh pr view https://github.com/owner/repo/pull/55。
Issues
gh issue list --repo owner/repo --state open --json number,title,labels,url
gh issue view 42 --repo owner/repo --json title,body,comments,labels,state
gh issue create --repo owner/repo --title "Bug: ..." --body-file /tmp/issue.md
gh issue comment 42 --repo owner/repo --body-file /tmp/comment.md
gh issue close 42 --repo owner/repo --comment "已在 ... 中修正"
CI/執行
gh run list --repo owner/repo --limit 10
gh run view <run-id> --repo owner/repo --json status,conclusion,headSha,url
gh run view <run-id> --repo owner/repo --log-failed
gh run rerun <run-id> --repo owner/repo --failed
API
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
gh api repos/owner/repo/labels --jq '.[].name'
gh api --cache 1h repos/owner/repo --jq '{stars: .stargazers_count, forks: .forks_count}'
使用 --json 搭配 --jq 取得結構化輸出。使用 --body-file 處理包含反引號、Shell 片段、環境變數名稱或使用者文字的留言/內容。






