github-cli
Skill0 starsChanged 3 months agoMITView on GitHub
Install, authenticate, and use GitHub CLI (gh) for repos, pull requests, issues, Actions, and API calls. Use when the user mentions gh, GitHub CLI, GitHub auth, creating PRs, checking CI, or GitHub operations from the terminal.
- Reads credentials
- Installs packages
- Commits and pushes
25 other projects use a version of this.
Adopted by
Most recently taken up by
- himkt/configtheir own version, first seen Nov 7, 2026
- rogue-dev-studio/ai-agents-roguetheir own version, first seen Nov 1, 2026
- kuailexiaozixin/githubtheir own version, first seen Oct 24, 2026
- danilolucasmd/skillstheir own version, first seen Oct 19, 2026
- garri333/Skillstheir own version, first seen Oct 11, 2026
- momo0338/skillstheir own version, first seen Oct 11, 2026
Used with
Projects with it also use terraform, codex-cli and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ihiteshguptaSkillterraform
Expert in Infrastructure as Code with Terraform. Use for creating, managing, and versioning infrastructure across cloud providers.
Also in 3 projects that use this
garri333Skillcodex-cli
OpenAI Codex CLI mastery skill for installation, authentication, terminal commands, code generation from natural language, file editing, project scaffolding, and IDE integrations. Covers GPT-5.2 Instant/Thinking tiers and shell/container execution modes.
Also in 3 projects that use this
PostHogSkillkarpathy-guidelines
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria. Based on https://github.com/multica-ai/andrej-karpathy-skills.
Also in 3 projects that use this
MicrosoftSkillcaveman
Ultra-compressed response style that reduces output token count while preserving technical accuracy, with intensity levels and auto-clarity safety rules
Also in 3 projects that use this
BlockSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Also in 4 projects that use this
Other versions25 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 25
- kaeawc/auto-mobile★ 56same name
- himkt/config★ 40same name
- georgekhananaev/claude-skills-vault★ 28same name
- doug-skinner/github-cli-claude-skill★ 10same name
- abdullahkhawer/devops-skills★ 8same name
- jonhill90/skills★ 8same name
- trotsky1997/My-Claude-Agent-Skills★ 7same name
- magnusrodseth/dotfiles★ 3same name
- shalomb/agent-skills★ 3same name
- aaronflorey/agent-skills★ 2same name
15 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Use gh for all GitHub tasks from the terminal.
- Distinctive: line 48
Run and let the user answer prompts:
- Distinctive: line 95
Run at the start of any GitHub task (or use the helper script):
- Very specific: line 120
If not in a git repo, ask the user for owner/repo or pass -R owner/repo on every command.
- Very specific: line 125
Check auth: before PR/issue/API work: gh auth status
- Distinctive: line 137
Run in parallel when possible:
- Very specific: line 217
Use gh api when no dedicated subcommand exists.
“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub CLI (gh)
Use gh for all GitHub tasks from the terminal. Prefer gh over raw curl to GitHub API when a subcommand exists.
Install
Windows (preferred)
winget install --id GitHub.cli --source wingetOpen a new terminal after install, then verify:
gh --versionOther platforms
| Platform | Command |
| macOS | brew install gh |
| Debian/Ubuntu | See official docs |
| Manual | Latest release |
Authentication
gh auth login is interactive — the user must complete prompts in the terminal. Do not run it unattended expecting full automation.
When to authenticate
gh auth statusfails or shows "not logged in"- User wants a different account or extra token scopes
- First-time setup after install
Login workflow
Run and let the user answer prompts:
gh auth loginRecommended choices for most development work:
| Prompt | Suggested answer |
| Account | GitHub.com (or Enterprise hostname if applicable) |
| Protocol | HTTPS |
| Authenticate | Login with a web browser (or paste token if headless) |
| Git credentials | Yes — lets git push/pull use gh credentials |
For GitHub Enterprise:
gh auth login --hostname <hostname>Verify auth
gh auth statusExpected: logged-in account, active token, and scopes (repo minimum for private repos and PRs).
Add scopes later
gh auth refresh -s workflow,read:orgCommon scopes: repo, read:org, workflow, gist, project.
Environment / CI (no interactive login)
Set GITHUB_TOKEN (or GH_TOKEN) with a PAT or Actions token. gh uses it automatically.
Dynamic context (required)
Never hardcode GitHub usernames, orgs, or repo names. Resolve them at runtime for whoever is authenticated.
Resolve before GitHub work
Run at the start of any GitHub task (or use the helper script):
powershell -File scripts/get-context.ps1Or manually:
gh auth status
gh api user --jq '{login: .login, name: .name}'
gh repo view --json nameWithOwner,defaultBranchRef -q '.nameWithOwner' # inside a git repo
git remote get-url origin # fallback for owner/repoDynamic patterns
| Need | Command / pattern |
| Current user login | gh api user -q .login |
| Current user in filters | @me (e.g. author:@me, --assignee @me) |
| Current repo | gh repo view -q .nameWithOwner (in repo) or -R owner/repo |
| User's repos | gh search repos "user:$(gh api user -q .login)" |
| API with owner | repos/{owner}/{repo} — fill from context, not literals |
If not in a git repo, ask the user for owner/repo or pass -R owner/repo on every command.
Agent rules
- Resolve context first — auth user and repo via commands above; never assume a fixed account
- Check auth before PR/issue/API work:
gh auth status - Use
ghfor GitHub tasks — PRs, issues, checks, releases, repo info - Interactive login — run
gh auth login, then tell the user to complete browser/token steps - Never commit or log tokens — warn if
.envor credentials would be committed - Use
--json+--jqfor scriptable output when parsing is needed
Pull requests
Align with the user's PR workflow: gather git state, then use gh.
Inspect branch before PR
Run in parallel when possible:
git status
git diff
git branch -vv
git log --oneline -10
git diff main...HEADCreate PR
git push -u origin HEAD
gh pr create --title "Title" --body "$( @'
## Summary
- Change 1
## Test plan
- [ ] Step 1
'@ )"Return the PR URL from command output.
Common PR commands
gh pr list
gh pr view 123
gh pr view --web
gh pr checkout 123
gh pr diff 123
gh pr merge 123 --squash
gh pr checks 123
gh pr review 123 --approveIssues
gh issue list
gh issue view 42
gh issue create --title "Bug" --body "Description"
gh issue close 42Repositories
gh repo view
gh repo view owner/repo --web
gh repo clone owner/repo
gh repo fork owner/repo --clone
gh repo create my-repo --public --source=. --remote=origin --pushGitHub Actions
Requires workflow scope for some operations.
gh run list
gh run view 123456789
gh run watch 123456789
gh run rerun 123456789 --failed
gh workflow list
gh workflow run ci.ymlSearch and API
gh search repos "topic:nextjs stars:>100"
gh search prs "is:open author:@me"
gh search repos "user:$(gh api user -q .login)"
gh api "repos/$(gh repo view -q .nameWithOwner)/pulls" --jq '.[].title'Use gh api when no dedicated subcommand exists. See gh api --help.
JSON output
gh pr list --json number,title,url --jq '.[] | "\(.number): \(.title)"'
gh issue list --json number,title,stateTroubleshooting
| Problem | Fix |
gh: command not found | Reinstall; open new terminal (Windows PATH update) |
HTTP 401 / auth errors | gh auth login or gh auth refresh |
| Missing scope errors | gh auth refresh -s <scope> |
| Wrong account | gh auth switch or logout and re-login |
| Enterprise host | gh auth login --hostname <host> or set GH_HOST |
gh auth logout
gh auth login
gh config set editor "code --wait"Quick reference
| Task | Command |
| Who am I? | gh api user -q .login or gh auth status |
| Open in browser | gh browse |
| Notifications | gh status |
| Create PR | gh pr create |
| CI status | gh pr checks or gh run list |
| Raw API | gh api <endpoint> |
Full reference: gh help or cli.github.com/manual
Additional resources
- For API patterns, JSON fields, merge flags, and env vars, see reference.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

