| name | ghcli |
| description | GitHub CLI for issues, PRs, starred repos, notifications, and repository exploration. Use when user asks about GitHub activity, starred projects, PR reviews, or issue management. |
GitHub CLI
Command-line interface for GitHub operations via gh.
Authentication
Already configured via GITHUB_PERSONAL_ACCESS_TOKEN in Claude Code settings.
Common Operations
Issues
gh issue list -R owner/repo
gh issue list -R owner/repo --state all --limit 20
gh issue view 123 -R owner/repo
gh issue create -R owner/repo --title "T" --body "B"
gh issue comment 123 -R owner/repo --body "comment"
Pull Requests
gh pr list -R owner/repo
gh pr view 123 -R owner/repo
gh pr diff 123 -R owner/repo
gh pr checks 123 -R owner/repo
gh pr status
gh pr create --title "T" --body "B"
gh pr review 123 --approve
gh api repos/owner/repo/pulls/123/comments
Starred Repos (Interests & Network)
gh api user/starred --paginate --jq '.[:10][] | {full_name, description, language, stargazers_count}'
gh api user/starred --paginate --jq '[.[] | select(.language == "Rust")] | length'
gh api user/starred --paginate --jq '.[] | select(.topics[]? == "emacs") | .full_name'
gh api user/starred --paginate --jq '.[] | select(.description? // "" | test("mcp|agent"; "i")) | {full_name, description}'
gh api user/starred --paginate --jq 'group_by(.language) | map({language: .[0].language, count: length}) | sort_by(-.count) | .[:10][]'
gh api user/starred --paginate --jq '[.[] | select(.pushed_at > "2026-01-01")] | sort_by(.pushed_at) | reverse | .[:10][] | {full_name, pushed_at, language}'
gh api user/starred --paginate --jq '[.[].owner.login] | group_by(.) | map({user: .[0], repos: length}) | sort_by(-.repos) | .[:10][]'
Starred repos with star date
gh api user/starred --paginate -H "Accept: application/vnd.github.star+json" --jq '.[:5][] | {starred_at, repo: .repo.full_name, desc: .repo.description}'
gh api user/starred --paginate -H "Accept: application/vnd.github.star+json" --jq '.[] | select(.starred_at > "2026-02-01") | {starred_at, repo: .repo.full_name}'
Repository Exploration
gh repo view owner/repo
gh repo view owner/repo --json description,stargazerCount,languages
gh api repos/owner/repo/contributors --jq '.[:5][] | {login, contributions}'
gh api repos/owner/repo/releases --jq '.[0] | {tag_name, published_at, name}'
gh search repos "keyword" --language rust --sort stars
Notifications
gh api notifications --jq '.[:10][] | {reason, title: .subject.title, repo: .repository.full_name, updated_at}'
User accounts
The user has two GitHub accounts:
Default gh auth uses the personal account.
BibTeX Export (Offline Reference)
For full starred repos export to BibTeX (Citar/Emacs integration):
~/repos/gh/memex-kb/scripts/gh_starred_to_bib.sh [output.bib]
Tips
- Use
--paginate for starred repos (may have hundreds)
- Use
--jq for filtering (avoids piping to jq separately)
-R owner/repo specifies repo without cd-ing into it
gh api can call any GitHub REST API endpoint