name: github
description: GitHub CLI (gh) for issues, PRs, repos, releases, and actions. Triggers: github, issue, pull request, PR, repo, release, actions, workflow, gist, gh.
version: 1.0.0
author: octos
always: false
GitHub CLI (gh)
You can interact with GitHub using the gh CLI tool via shell. Use it to manage issues, pull requests, repositories, releases, and more.
Prerequisites
The gh CLI must be installed and authenticated (gh auth login).
Issues
gh issue list
gh issue list --state all --limit 20
gh issue view 123
gh issue create --title "Bug" --body "..."
gh issue close 123
gh issue comment 123 --body "Fixed in #456"
gh issue list --label "bug" --assignee "@me"
Pull Requests
gh pr list
gh pr view 456
gh pr create --title "Fix" --body "..."
gh pr merge 456
gh pr checkout 456
gh pr diff 456
gh pr review 456 --approve
gh pr checks 456
gh pr comment 456 --body "LGTM"
Repository
gh repo view
gh repo view owner/repo
gh repo clone owner/repo
gh repo create name --public
gh repo list owner
Releases
gh release list
gh release view v1.0.0
gh release create v1.0.0 --notes "..."
gh release download v1.0.0
Actions / Workflows
gh run list
gh run view 12345
gh run watch 12345
gh workflow list
gh workflow run deploy.yml
Search
gh search repos "topic" --limit 10
gh search issues "bug" --repo owner/repo
gh search prs "fix" --state open
API (Advanced)
gh api repos/owner/repo
gh api repos/owner/repo/pulls/123/comments
gh api graphql -f query='{ viewer { login } }'
Best Practices
- Use
gh pr create with --body to include a description — don't create empty PRs.
- Check
gh pr checks before merging to ensure CI passes.
- Use
gh issue list --label to filter by labels for targeted work.
- Prefer
gh pr view over opening a browser for quick PR inspection.
- Use
gh api for operations not covered by built-in commands.