github-cli
Original:🇺🇸 English
Translated
GitHub CLI workflows for repositories, issues, pull requests, actions, releases, projects, and API calls. Use when creating PRs, reviewing code, triaging issues, triggering workflows, publishing releases, managing projects, verifying attestations, or querying the GitHub API. Use for gh cli, github automation, code review, release management.
1installs
Sourceoakoss/agent-skills
Added on
NPX Install
npx skill4agent add oakoss/agent-skills github-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →GitHub CLI Skill
Provides patterns for the CLI to interact with GitHub repositories, services, and APIs directly from the terminal. Covers authentication, repository management, issues, pull requests, actions, releases, projects, search, and the REST/GraphQL API. Git workflow patterns (branching, commits, CI/CD) are handled by a separate skill.
ghQuick Reference
| Area | Key Commands |
|---|---|
| Auth | |
| Repos | |
| Browse | |
| Issues | |
| Pull Requests | |
| Actions | |
| Releases | |
| Projects | |
| Search | |
| API | |
| Security | |
| Status | |
| Codespaces | |
Common Workflows
| Workflow | Commands |
|---|---|
| Quick PR | |
| Draft PR | |
| Review and merge | |
| Auto-merge PR | |
| Check CI | |
| Rerun failed CI | |
| Create release | |
| Search code | |
| Add issue to project | |
| Verify artifact | |
| Trigger workflow | |
| Revert merged PR | |
| Sync fork | |
Output Formatting
Most list and view commands support structured output for scripting and automation.
gh| Flag | Purpose |
|---|---|
| Output specified fields as JSON |
| Filter JSON with jq expressions |
| Format JSON with Go templates |
| Open the resource in a browser |
| Include comments (issues and PRs) |
Scoping: Repo, Env, Org
Secrets and variables can be scoped to different levels.
| Scope | Flag Example |
|---|---|
| Repository | |
| Environment | |
| Organization | |
Project commands always require or .
--owner @me--owner org-nameAuthentication Prerequisites
The CLI requires authentication before most commands work. Run to verify the current session. Missing scopes cause silent failures -- use to add scopes without re-authenticating. For CI environments, set the or environment variable instead of interactive login.
ghgh auth statusgh auth refresh -s scopeGITHUB_TOKENGH_TOKENCommon Mistakes
| Mistake | Correct Pattern |
|---|---|
Running | Push with |
Using | Run |
Forgetting | Use |
| Using REST API when GraphQL is more efficient for nested data | Use |
| Not authenticating with correct scopes | Run |
Using | Always pass |
| Manually downloading CI artifacts | Use |
Not using | Add |
Merging without | Use |
Running | Use |
Delegation
- Search across repositories for code patterns or issues: Use agent with
Exploreandgh search codegh search issues - Automate multi-step release workflows: Use agent to coordinate branch creation, PR merge, and release publishing
Task - Plan repository structure and access controls: Use agent to design team permissions, branch protection, and workflow architecture
Plan
References
- Repos & Auth -- Authentication, repository management, configuration, extensions, aliases
- Issues -- Issue CRUD, labels, assignments, pinning, transferring, development branches
- Pull Requests -- PR creation, review, merge, checkout, checks, diff, auto-merge
- Actions -- Workflow runs, manual triggers, secrets, variables, caches, artifact downloads
- Releases & Search -- Releases, attestation verification, search, gists, SSH/GPG keys
- Projects & API -- Projects v2 management, REST API, GraphQL API, rulesets, status