Automates installation and configuration of the GitHub CLI (gh) to ensure agents can manage PRs, issues, and releases.
Install
mkdir -p .claude/skills/gh-jamie-bitflight && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18556" && unzip -o skill.zip -d .claude/skills/gh-jamie-bitflight && rm skill.zipInstalls to .claude/skills/gh-jamie-bitflight
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Install and configure the GitHub CLI (gh) for AI agent environments where gh may not be pre-installed and git remotes use local proxies instead of github.com. Use when gh command not found, shutil.which returns None, need GitHub API access for issues or PRs or releases or workflow runs, or repository operations fail with 'failed to determine base repo' error. Provides auto-install script with SHA256 verification, GITHUB_TOKEN auth with anonymous fallback, and the required -R flag pattern for proxy environments. Covers project management via GitHub Projects V2, milestones via REST API, issue lifecycle templates, and label taxonomy management.Key capabilities
- →Install the GitHub CLI (gh) with SHA256 verification
- →Authenticate gh commands using a GITHUB_TOKEN environment variable
- →Interact with GitHub API for issues, pull requests, releases, and workflow runs
- →Manage GitHub Projects V2, milestones, and labels
- →Handle proxy environments where git remotes do not point to github.com
- →Automate multi-step GitHub operations via Python scripts
How it works
The skill installs the GitHub CLI, authenticates it using a GITHUB_TOKEN, and ensures commands are correctly formatted for proxy environments.
Inputs & outputs
When to use gh
- →Installing GitHub CLI
- →Creating PRs via CLI
- →Managing repository issues
- →Interacting with workflow runs
About this skill
GitHub CLI (gh) — Setup and Usage
Purpose
Ensures the GitHub CLI (gh) is available and provides correct usage patterns for AI agents operating in environments where gh may not be pre-installed and where git remotes point to local proxies instead of github.com.
When to Use
ghcommand not found orshutil.which("gh")returns None- Need to interact with GitHub API (issues, PRs, releases, workflows)
- Repository remote does not point to
github.com(proxy environments) - Need authenticated GitHub operations with
GITHUB_TOKEN - Managing GitHub Issues, Projects V2, Milestones, or Labels
Installation
If gh is not installed, run the setup script:
uv run .claude/skills/gh/scripts/setup_gh.py
The script:
- Checks if
ghis already installed viashutil.which - Detects platform (Linux, macOS, Windows) and architecture
- Fetches the latest release from
https://github.com/cli/cli/releases/latest - Downloads the correct archive with SHA256 verification from checksums file
- Extracts and installs the binary to a writable PATH directory
- Uses
GITHUB_TOKENfor authenticated requests; falls back to anonymous if auth fails (401/403)
CLI options:
--force Reinstall even if already at latest version
--dry-run Show what would happen without installing
--bin-dir Override install directory (default: auto-detect from PATH)
--detect-only Detect owner/repo, refresh .dh/config.yaml and gh-examples.md, print examples to stdout. No network calls.
Authentication
GITHUB_TOKEN environment variable provides automatic authentication. No manual gh auth login needed.
# Verify authentication
gh auth status
If GITHUB_TOKEN is set, gh authenticates automatically for all API calls.
Repository Detection
<repo_detection>
Git remote points to a local proxy (127.0.0.1), NOT github.com. Every gh command fails without explicit repo specification:
failed to determine base repo: none of the git remotes configured for this
repository point to a known GitHub host.
RULE: Pass -R (or --repo) on EVERY gh command:
gh <command> -R <owner/repo>
This applies to ALL gh subcommands: pr, issue, run, api, release, project, etc.
</repo_detection>
Common Commands
!uv run --script .claude/skills/gh/scripts/setup_gh.py --detect-only 2>/dev/null
Automation — Python Script
For multi-step operations (label setup, milestone creation, project init, issue import), use:
# Full project setup
uv run .claude/skills/gh/scripts/github_project_setup.py setup
# Labels only
uv run .claude/skills/gh/scripts/github_project_setup.py labels
# Milestone management
uv run .claude/skills/gh/scripts/github_project_setup.py milestone list
uv run .claude/skills/gh/scripts/github_project_setup.py milestone create --title "v1.0" --due 2026-03-31
# Issue management
uv run .claude/skills/gh/scripts/github_project_setup.py issue list --priority p1
uv run .claude/skills/gh/scripts/github_project_setup.py issue create --title "feat: X" --priority-label priority:p1
The script delegates all GitHub operations to the authenticated gh CLI — no separate API tokens or Python HTTP clients needed.
Reference Files
- labels.md — Label taxonomy (priority, type, status), color codes, bulk setup
- milestones.md — Milestone CRUD via REST API, naming conventions
- projects-v2.md — GitHub Projects V2 commands, custom fields, GraphQL queries
- issue-stories.md — Issue as story format, body template, lifecycle, backlog item field mapping
Sources
- GitHub CLI Manual — official reference
- GitHub CLI Releases — binary downloads
- GitHub REST API — Issues — milestones, labels, issues
- GitHub Projects V2 API — GraphQL API
gh version 2.87.2 (2026-02-20)— version verified by installation test
When not to use it
- →When gh is already installed and configured correctly
- →When direct interaction with github.com is not required
- →When GitHub API access is not needed for issues, PRs, releases, or workflows
Limitations
- →Requires explicit repository specification with -R in proxy environments
- →Authentication relies on the GITHUB_TOKEN environment variable
How it compares
This skill automates the setup and configuration of the GitHub CLI, including handling proxy environments, which a manual installation would require separate steps for.
Compared to similar skills
gh side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| gh (this skill) | 0 | 1mo | Review | Beginner |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| openspec-onboard | 10 | 5mo | Review | Beginner |
| codex-cli-bridge | 9 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
openspec-onboard
studyzy
Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
codex-cli-bridge
alirezarezvani
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
skill-sync
KyleKing
Syncs Claude Skills with other AI coding tools like Cursor, Copilot, and Codeium by creating cross-references and shared knowledge bases. Invoke when user wants to leverage skills across multiple tools or create unified AI context.
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.