GitHub Default Active
GitHub gh CLI — issues, PRs, CI, code review, releases
gh CLI, including merged capabilities from the former gh-address-comments, gh-fix-ci, gh-issues, and yeet skills.Quick Reference
| Command | Description | Example |
|---|---|---|
gh pr list | List pull requests | gh pr list --repo owner/repo |
gh pr view | View PR details | gh pr view 55 --repo owner/repo |
gh pr checks | Check CI status on a PR | gh pr checks 55 --repo owner/repo |
gh pr create | Create a pull request | gh pr create --title "feat: X" --body "..." |
gh pr merge | Merge a pull request | gh pr merge 55 --squash |
gh issue list | List issues | gh issue list --state open |
gh issue create | Create an issue | gh issue create --title "Bug: X" |
gh issue close | Close an issue | gh issue close 42 |
gh run list | List CI workflow runs | gh run list --limit 10 |
gh run view | View a specific CI run | gh run view <id> --log-failed |
gh run rerun | Re-run failed jobs | gh run rerun <id> --failed |
gh api | Query GitHub REST/GraphQL API | gh api repos/o/r/pulls/55 --jq '.title' |
When to Use / When Not to Use
Use this skill when
- Checking PR status, reviews, or merge readiness
- Viewing CI/workflow run status and logs
- Creating, closing, or commenting on issues
- Creating or merging pull requests
- Querying GitHub API for repository data
- Listing repos, releases, or collaborators
- Addressing PR review comments
- Debugging and fixing failing CI checks
- Auto-fixing issues and opening PRs
- Stage, commit, push, and PR in one flow (yeet)
Do NOT use when
- Local git operations (commit, push, pull, branch) — use
gitdirectly - Non-GitHub repos (GitLab, Bitbucket, self-hosted) — different CLIs
- Cloning repositories — use
git clone - Reviewing actual code changes — use
coding-agentskill - Complex multi-file diffs — use
coding-agentor read files directly
Setup & Installation
The github skill requires the gh CLI binary. CLI-JAW can auto-install it for you, or you can install manually:
# macOS (Homebrew)
brew install gh
# Linux (apt)
sudo apt install gh
After installing, authenticate once:
# One-time authentication
gh auth login
# Verify authentication
gh auth status
gh token has repo, read:org, and workflow scopes. If CI operations fail, re-authenticate with gh auth login and select the required scopes.Pull Requests
Listing PRs
# List open PRs in a repo
gh pr list --repo owner/repo
# Filter by state
gh pr list --repo owner/repo --state merged --limit 20
# JSON output with jq filtering
gh pr list --json number,title,state,mergeable \
--jq '.[] | select(.mergeable == "MERGEABLE")'
Viewing PR Details
# View PR by number
gh pr view 55 --repo owner/repo
# View by URL directly
gh pr view https://github.com/owner/repo/pull/55
# Structured JSON output
gh pr view 55 --repo owner/repo \
--json title,body,author,additions,deletions,changedFiles \
--jq '"**\(.title)** by @\(.author.login)\n+\(.additions) -\(.deletions) across \(.changedFiles) files"'
Checking CI Status
# Check all CI checks on a PR
gh pr checks 55 --repo owner/repo
Creating PRs
# Basic PR creation
gh pr create --title "feat: add feature" --body "Description"
# With reviewers and labels
gh pr create --title "fix: resolve timeout" \
--body "Fixes #42" \
--reviewer alice,bob \
--label bug,urgent
# Draft PR
gh pr create --title "wip: new dashboard" --body "WIP" --draft
Merging PRs
# Squash merge
gh pr merge 55 --squash --repo owner/repo
# Merge commit
gh pr merge 55 --merge --repo owner/repo
# Rebase merge
gh pr merge 55 --rebase --repo owner/repo
# Auto-merge when checks pass
gh pr merge 55 --auto --squash
Issues
Listing Issues
# Open issues
gh issue list --repo owner/repo --state open
# Filter by label
gh issue list --repo owner/repo --label bug --limit 10
# JSON with formatting
gh issue list --repo owner/repo --state open \
--json number,title,labels,createdAt \
--jq '.[] | "[\(.number)] \(.title) - \([.labels[].name] | join(", ")) (\(.createdAt[:10]))"'
Creating Issues
# Basic issue
gh issue create --title "Bug: something broken" --body "Details..."
# With labels and assignee
gh issue create --title "Feature: dark mode" \
--body "Add dark mode toggle" \
--label enhancement \
--assignee @me
Closing Issues
# Close by number
gh issue close 42 --repo owner/repo
# Close with comment
gh issue close 42 --comment "Fixed in PR #55"
CI / Workflow Runs
Listing Runs
# Recent runs
gh run list --repo owner/repo --limit 10
# Filter by workflow
gh run list --workflow build.yml --limit 5
# Filter by status
gh run list --status failure --limit 10
Viewing Run Details
# View specific run
gh run view <run-id> --repo owner/repo
# View ONLY failed step logs (most useful for debugging)
gh run view <run-id> --repo owner/repo --log-failed
Re-running Failed Jobs
# Re-run only the failed jobs
gh run rerun <run-id> --failed --repo owner/repo
# Re-run all jobs
gh run rerun <run-id> --repo owner/repo
API Queries
The gh api command provides direct access to the GitHub REST and GraphQL API. Use --jq to filter JSON results.
# Get PR with specific fields
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
# List all labels
gh api repos/owner/repo/labels --jq '.[].name'
# Get repo stats
gh api repos/owner/repo --jq '{stars: .stargazers_count, forks: .forks_count}'
# List PR review comments
gh api repos/{owner}/{repo}/pulls/{pr}/comments \
--jq '.[] | "\(.id): \(.body[:80])"'
# Cache repeated queries (1 hour)
gh api --cache 1h repos/owner/repo
JSON Output Mode
Most gh commands support --json for structured output combined with --jq filtering:
# Issues as formatted list
gh issue list --repo owner/repo --json number,title \
--jq '.[] | "\(.number): \(.title)"'
# PRs that are mergeable
gh pr list --json number,title,state,mergeable \
--jq '.[] | select(.mergeable == "MERGEABLE")'
Integrated Workflows
The github skill consolidates several formerly-separate skills into unified workflows. These run as multi-step procedures triggered by natural language.
PR Comment Handling
Address review comments and issue comments on the open PR for the current branch.
- Check authentication:
gh auth status - Find current PR:
gh pr view --json number,url - List review comments:
gh api repos/{owner}/{repo}/pulls/{pr}/comments --jq '.[] | "\(.id): \(.body[:80])"' - Address each comment, implement fixes, and commit changes
- Push and re-request review from the original reviewers
Fix Failing CI
Debug and fix failing GitHub Actions checks automatically.
- Find failing checks:
gh pr checks <PR> --repo owner/repo - Get failed run logs:
gh run view <run-id> --log-failed - Summarize failure snippet and identify root cause
- Draft fix plan, get approval, then implement the fix
- Push fix and verify CI passes
Auto-Fix Issues
Fetch issues from a repository, implement fixes, and open PRs for each.
- List target issues:
gh issue list --label bug --limit 5 - For each issue: create a branch, implement the fix, open a PR
- Monitor PR reviews and address comments
- Uses the GitHub REST API with
$GH_TOKENfor automation
Yeet: Stage, Commit, Push, PR
One-shot flow to ship changes from working tree to a PR in a single command.
- If on
main/master, create a new branch:git checkout -b codex/{description} - Stage all changes:
git add -A - Commit with description:
git commit -m "{description}" - Push to remote:
git push -u origin HEAD - Open PR:
gh pr create --title "[codex] {description}" --body "..."
Templates
PR Review Summary
PR=55 REPO=owner/repo
echo "## PR #$PR Summary"
gh pr view $PR --repo $REPO \
--json title,body,author,additions,deletions,changedFiles \
--jq '"**\(.title)** by @\(.author.login)\n\n\(.body)\n\n+\(.additions) -\(.deletions) across \(.changedFiles) files"'
gh pr checks $PR --repo $REPO
Issue Triage Report
gh issue list --repo owner/repo --state open \
--json number,title,labels,createdAt \
--jq '.[] | "[\(.number)] \(.title) - \([.labels[].name] | join(", ")) (\(.createdAt[:10]))"'
Rules & Best Practices
| Rule | Details |
|---|---|
Always specify --repo | When not inside a git directory, always pass --repo owner/repo to avoid ambiguity. |
| Use URLs directly | gh pr view https://github.com/owner/repo/pull/55 works and is unambiguous. |
| Cache repeated API calls | Use gh api --cache 1h for queries you run frequently to avoid rate limits. |
Prefer --log-failed | When debugging CI, use gh run view <id> --log-failed instead of --log to avoid massive output. |
Use --json + --jq | For structured data extraction, always prefer JSON output with jq filtering over parsing text. |
| Local git stays local | Do not use this skill for git commit, git push, git pull, or git branch. Use git directly. |
| Rate limits | GitHub API has rate limits (5,000 req/hr for authenticated). Cache aggressively and batch queries. |
Usage Examples (~haejwo)
These examples show how to invoke the github skill using natural language. Both Korean and English work interchangeably.
gh pr checks 55 and summarizes pass/fail results.--reviewer alice --label bug.--log-failed, diagnoses the root cause, and proposes a fix.bug label, formats them as a triage report with creation dates and labels.Related Skills
| Skill | Relationship |
|---|---|
dev-code-reviewer | Reviews code content; github handles the PR mechanics (create, merge, comment). |
dev orchestrator | May delegate to github when a dev task requires PR creation or CI checking. |
code-review | Deep code review skill; pairs with github for --comment to post inline PR feedback. |
security-review | Security audit skill; uses github to check dependency alerts and security advisories. |