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.
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
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.
gh command not found or shutil.which("gh") returns Nonegithub.com (proxy environments)GITHUB_TOKENIf gh is not installed, run the setup script:
uv run .claude/skills/gh/scripts/setup_gh.pyThe script:
gh is already installed via shutil.whichhttps://github.com/cli/cli/releases/latestGITHUB_TOKEN for 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.GITHUB_TOKEN environment variable provides automatic authentication. No manual gh auth login needed.
# Verify authentication
gh auth statusIf GITHUB_TOKEN is set, gh authenticates automatically for all API calls.
<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>
!uv run --script .claude/skills/gh/scripts/setup_gh.py --detect-only 2>/dev/null
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:p1The script delegates all GitHub operations to the authenticated gh CLI — no separate API tokens or Python HTTP clients needed.
gh version 2.87.2 (2026-02-20) — version verified by installation testJamie-BitFlight/claude_skills
a5218b3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.