gh-cli — Claude Code skill: GitHub work via CLI
A skill that redirects GitHub requests from curl and fetch to authenticated gh CLI for repositories, pull requests, and issues. Use it for private repos and higher API limits.
npx skills add trailofbits/skills --skill gh-cli -a claude-codeWhat gh-cli does
gh-cli shifts GitHub workflows from unauthenticated methods (curl, wget, WebFetch, MCP fetch) to the gh CLI. When an agent works with repos, PRs, issues, or releases, the skill prompts use of gh repo view, gh pr view, and gh api instead of direct HTTP calls. This unlocks private repository access and raises API rate limits.
The skill includes hook rules in plugins/gh-cli/hooks/. It works on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode. Licensed CC-BY-SA-4.0.
What it helps with
- Access a private GitHub repository through AI coding
- Work with GitHub API without leaking authentication
- Read repository files instead of direct raw.githubusercontent.com fetches
- View pull requests and issues via CLI agent
- Bypass rate limits for unauthenticated API requests
Example prompts for the agent
- Install gh-cli in Claude Code and show me info about owner/repo
- List pull requests from that repo using gh CLI
- Read a file from the repo via `gh repo` instead of curl
How to install gh-cli
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill gh-cli -a claude-code2Manually: put the files in place
~/.claude/skills/gh-cli/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/gh-cli/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill gh-cli -a codex2Manually: put the files in place
.agents/skills/gh-cli/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill gh-cli -a cursor2Manually: put the files in place
.cursor/skills/gh-cli/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills gh-cli2Manually: put the files in place
.github/skills/gh-cli/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill gh-cli -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/gh-cli/skills/gh-cliManually: put the files in place
.devin/skills/gh-cli/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill gh-cli -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set35
The whole set →Similar
Questions about gh-cli
How do I install gh-cli in Claude Code?
Run npx skills add trailofbits/skills --skill gh-cli -a claude-code, then the skill will be at ~/.claude/skills/gh-cli/SKILL.md.
What does gh-cli do?
The skill redirects GitHub requests to authenticated gh CLI instead of curl and fetch, giving access to private repos and higher API rate limits.
When should I skip gh-cli?
If your target is not GitHub or local git operations already solve your task.