Back to list
Th0rgal

github-cli

by Th0rgal

5🍴 4📅 Jan 23, 2026

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 git directly)
  • Non-GitHub remotes (GitLab, Bitbucket)

Prerequisites

  • gh CLI installed
  • SSH key ~/.ssh/agent configured for GitHub access
  • Set GIT_SSH_COMMAND if needed: export GIT_SSH_COMMAND="ssh -i ~/.ssh/agent"

Quick Reference

Pull Requests

ActionCommand
List PRsgh pr list
View PRgh pr view <number>
Create PRgh pr create --title "..." --body "..."
Checkout PRgh pr checkout <number>
Merge PRgh pr merge <number>
PR diffgh pr diff <number>
PR checksgh pr checks <number>

Issues

ActionCommand
List issuesgh issue list
View issuegh issue view <number>
Create issuegh issue create --title "..." --body "..."
Close issuegh issue close <number>
Commentgh issue comment <number> --body "..."

Repos & Releases

ActionCommand
Clonegh repo clone <owner>/<repo>
Forkgh repo fork <owner>/<repo>
View repogh repo view
Create releasegh release create <tag> --title "..." --notes "..."
List releasesgh release list

Actions & Workflows

ActionCommand
List runsgh run list
View rungh run view <run-id>
Watch rungh run watch <run-id>
Rerun failedgh run rerun <run-id> --failed
List workflowsgh 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

  1. Ensure gh auth status shows authenticated
  2. Use gh pr list or gh issue list to find items
  3. Perform action with appropriate command
  4. Verify with gh pr checks or gh run list

Checks & Guardrails

  • Always check PR status before merging
  • Use --draft for work-in-progress PRs
  • Prefer gh pr merge --squash for clean history
  • Check gh run list after pushing to verify CI
  • Use GraphQL for review threads (gh pr view doesn't expose them)
  • Handle pagination when results exceed 100 items

Score

Total Score

50/100

Based on repository quality metrics

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

Reviews

💬

Reviews coming soon