Skip to main content
The GitHub skill provides instructions for using the gh CLI to interact with GitHub issues, pull requests, CI runs, and API queries.

Installation

The skill requires the GitHub CLI (gh):
brew install gh

Pull Requests

Check CI Status

Check CI status on a pull request:
gh pr checks 55 --repo owner/repo
Always specify --repo owner/repo when not in a git directory, or use URLs directly.

List Workflow Runs

List recent workflow runs:
gh run list --repo owner/repo --limit 10

View Run Details

View a run and see which steps failed:
gh run view <run-id> --repo owner/repo
View logs for failed steps only:
gh run view <run-id> --repo owner/repo --log-failed

API for Advanced Queries

The gh api command accesses data not available through other subcommands. Get PR with specific fields:
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'

JSON Output

Most commands support --json for structured output. Use --jq to filter:
gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"'

Examples

List Open Issues

gh issue list --repo owner/repo --state open

Create a Pull Request

gh pr create --title "Fix bug" --body "Description" --repo owner/repo

View Issue Details

gh issue view 123 --repo owner/repo

Merge a Pull Request

gh pr merge 55 --repo owner/repo --merge

Tips

  • Always use --repo owner/repo when not in a git directory
  • Use --json and --jq for programmatic access
  • Use gh api for queries not supported by other commands

Build docs developers (and LLMs) love