← スキル一覧に戻る

github-cli
by Th0rgal
⭐ 5🍴 4📅 2026年1月23日
SKILL.md
name: github-cli description: > Interact with GitHub using the gh CLI - PRs, issues, repos, releases, and actions. Trigger terms: github, gh, pull request, PR, issue, release, actions, workflow, repo.
When to Use
- Creating, viewing, or merging pull requests
- Managing issues (create, close, comment)
- Checking workflow/action status
- Creating releases
- Cloning or forking repos
When NOT to Use
- Local git operations (use
gitdirectly) - Non-GitHub remotes (GitLab, Bitbucket)
Prerequisites
ghCLI installed- SSH key
~/.ssh/agentconfigured for GitHub access - Set
GIT_SSH_COMMANDif needed:export GIT_SSH_COMMAND="ssh -i ~/.ssh/agent"
Quick Reference
Pull Requests
| Action | Command |
|---|---|
| List PRs | gh pr list |
| View PR | gh pr view <number> |
| Create PR | gh pr create --title "..." --body "..." |
| Checkout PR | gh pr checkout <number> |
| Merge PR | gh pr merge <number> |
| PR diff | gh pr diff <number> |
| PR checks | gh pr checks <number> |
Issues
| Action | Command |
|---|---|
| List issues | gh issue list |
| View issue | gh issue view <number> |
| Create issue | gh issue create --title "..." --body "..." |
| Close issue | gh issue close <number> |
| Comment | gh issue comment <number> --body "..." |
Repos & Releases
| Action | Command |
|---|---|
| Clone | gh repo clone <owner>/<repo> |
| Fork | gh repo fork <owner>/<repo> |
| View repo | gh repo view |
| Create release | gh release create <tag> --title "..." --notes "..." |
| List releases | gh release list |
Actions & Workflows
| Action | Command |
|---|---|
| List runs | gh run list |
| View run | gh run view <run-id> |
| Watch run | gh run watch <run-id> |
| Rerun failed | gh run rerun <run-id> --failed |
| List workflows | gh workflow list |
API & GraphQL
REST API:
gh api repos/<owner>/<repo>/pulls
gh api repos/<owner>/<repo>/issues/<number>/comments
GraphQL (for data not exposed by gh pr view):
# List PR review threads (gh pr view doesn't expose these)
gh api graphql -F owner=<owner> -F name=<repo> -F number=<pr> -f query='
query($owner:String!, $name:String!, $number:Int!){
repository(owner:$owner,name:$name){
pullRequest(number:$number){
reviewThreads(first:100){
nodes{id isResolved isOutdated comments(first:50){nodes{id author{login} body}}}
pageInfo{hasNextPage endCursor}
}
}
}
}'
# Resolve a review thread
gh api graphql -F threadId=<threadId> -f query='
mutation($threadId:ID!){
resolveReviewThread(input:{threadId:$threadId}){thread{isResolved}}
}'
Pagination: If pageInfo.hasNextPage is true, repeat with after: "<endCursor>".
Procedure
- Ensure
gh auth statusshows authenticated - Use
gh pr listorgh issue listto find items - Perform action with appropriate command
- Verify with
gh pr checksorgh run list
Checks & Guardrails
- Always check PR status before merging
- Use
--draftfor work-in-progress PRs - Prefer
gh pr merge --squashfor clean history - Check
gh run listafter pushing to verify CI - Use GraphQL for review threads (
gh pr viewdoesn't expose them) - Handle pagination when results exceed 100 items
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です