github-cli-comprehensive-reference
Comprehensive GitHub CLI (gh) reference. Covers repos, issues, PRs, Actions, releases, gists, search, projects v2, API, secrets/variables, labels, codespaces…
by rondoflow★ 37 GitHub stars
Install github-cli-comprehensive-reference in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
GitHub CLI (gh) — Comprehensive Skill
Version: gh 2.66.1+
Auth: gh auth login or set GH_TOKEN env var
Always use --repo OWNER/REPO (or -R) when not inside a git repo directory.
Table of Contents
- Authentication & Config
- Repositories
- Issues
- Pull Requests
- GitHub Actions (Runs & Workflows)
- Releases
- Gists
- Search
- Labels
- Secrets & Variables
- Caches
- Projects V2
- API (REST & GraphQL)
- Extensions
- Codespaces
- Copilot
- Other Commands
- JSON Output & Formatting
- Environment Variables
- Advanced Patterns
- Tips & Gotchas
1. Authentication & Config
Auth
# Interactive login (browser-based OAuth)
gh auth login
# Login with a PAT from stdin
echo "$MY_TOKEN" | gh auth login --with-token
# Login to GitHub Enterprise
gh auth login --hostname enterprise.example.com
# Add extra scopes (e.g., project scope for Projects V2)
gh auth refresh -s project
# Add delete_repo scope
gh auth refresh -s delete_repo
# Check auth status (shows active account, scopes, token validity)
gh auth status
gh auth status --show-token
# Switch active account (when multiple accounts configured)
gh auth switch
# Print the active token (useful for piping to other tools)
gh auth token
# Logout
gh auth logout
Required scopes by feature:
| Feature | Scope needed |
|---|---|
| Basic repo/PR/issue ops | repo |
| Gists | gist |
| Read org membership | read:org |
| Projects V2 | project |
| Delete repos | delete_repo |
| Actions workflows | workflow |
| Read user profile | user |
Config
# List all config
gh config list
# Get/set individual values
gh config get git_protocol # https or ssh
gh config set git_protocol ssh
gh config set editor "code --wait"
gh config set pager "less -R"
gh config set prompt disabled # disable interactive prompts (good for scripts)
gh config set browser "firefox"
# Clear CLI cache
gh config clear-cache
Git credential setup
# Configure git to use gh for HTTPS auth
gh auth setup-git
2. Repositories
Create
# Interactive
gh repo create
# Public repo, clone locally
gh repo create my-project --public --clone
# In an org
gh repo create my-org/my-project --private
# From local directory
gh repo create my-project --private --source=. --remote=upstream --push
# From template
gh repo create my-project --template owner/template-repo --clone
# With options
gh repo create my-project --public --description "My project" \
--license mit --gitignore Node --add-readme
Clone
gh repo clone owner/repo
gh repo clone owner/repo my-dir
gh repo clone owner/repo -- --depth=1 # shallow clone
# Clone your own repo (owner defaults to you)
gh repo clone my-repo
Fork
# Fork current repo
gh repo fork
# Fork and clone
gh repo fork owner/repo --clone
# Fork into an org
gh repo fork owner/repo --org my-org --fork-name new-name
# Fork default branch only
gh repo fork owner/repo --default-branch-only
View
# View current repo (README + description)
gh repo view
gh repo view owner/repo
# Open in browser
gh repo view --web
# JSON output
gh repo view --json name,description,stargazerCount,url
gh repo view --json name,stargazerCount --jq '.stargazerCount'
JSON fields for repo: archivedAt, assignableUsers, codeOfConduct, createdAt, defaultBranchRef, deleteBranchOnMerge, description, diskUsage, forkCount, hasDiscussionsEnabled, hasIssuesEnabled, hasProjectsEnabled, hasWikiEnabled, homepageUrl, id, isArchived, isEmpty, isFork, isPrivate, isTemplate, languages, latestRelease, licenseInfo, name, nameWithOwner, owner, parent, primaryLanguage, pullRequests, pushedAt, sshUrl, stargazerCount, updatedAt, url, visibility, watchers
List
# Your repos
gh repo list
gh repo list --limit 100
# Another user/org's repos
gh repo list my-org
# Filter
gh repo list --language go --visibility public
gh repo list --topic cli --no-archived
gh repo list --fork # only forks
gh repo list --source # only non-forks
# JSON output
gh repo list --json name,stargazerCount --jq '.[] | "\(.name): \(.stargazerCount) stars"'
Edit
# Edit settings
gh repo edit --description "New description"
gh repo edit --homepage "https://example.com"
gh repo edit --enable-issues --enable-wiki
gh repo edit --enable-projects=false
gh repo edit --default-branch main
gh repo edit --enable-auto-merge
gh repo edit --delete-branch-on-merge
gh repo edit --add-to
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- manifest.json
FAQ
What does the github-cli-comprehensive-reference skill do?
Comprehensive GitHub CLI (gh) reference. Covers repos, issues, PRs, Actions, releases, gists, search, projects v2, API, secrets/variables, labels, codespaces, extensions, auth, and advanced GraphQL patterns.
How do I install the github-cli-comprehensive-reference skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the github-cli-comprehensive-reference skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…