gh
БесплатноЗапускает вложенные скриптыНе проверен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…
от open-gsd★ 1 399 звёзд на GitHubОб этом скилле
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
gh is assumed to be already installed via the system package manager:
- macOS:
brew install gh - Windows:
winget install GitHub.cli - Linux (Debian/Ubuntu):
apt install gh
For CI monitoring operations (watching workflow runs, checking statuses, waiting for jobs), use ci_monitor.cjs:
node src/resources/skills/github-workflows/references/gh/scripts/ci_monitor.cjs
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
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 open-gsd/gsd-pi
This applies to ALL gh subcommands: pr, issue, run, api, release, project, etc.
Common Commands (v2.87.0)
Pull Requests
# List open PRs
gh pr list -R open-gsd/gsd-pi
# View PR details
gh pr view <number> -R open-gsd/gsd-pi
# Check PR CI status
gh pr checks <number> -R open-gsd/gsd-pi
# Create PR
gh pr create -R open-gsd/gsd-pi --title "title" --body "body"
# View PR comments
gh api repos/open-gsd/gsd-pi/pulls/<number>/comments
Issues
# List issues
gh issue list -R open-gsd/gsd-pi
# List by label
gh issue list -R open-gsd/gsd-pi --label "priority:p1" --state open
# Create issue with labels and milestone
# NOTE: Do NOT use labels for issue classification (bug, feature, etc.)
# Use labels for metadata (priority, status, auto-generated) only.
# Issue classification uses GitHub Issue Types, set via GraphQL after creation.
gh issue create -R open-gsd/gsd-pi \
--title "feat: add feature X" \
--label "priority:p1" \
--milestone "v1.0"
# View issue
gh issue view <number> -R open-gsd/gsd-pi
# Close issue with comment
gh issue close <number> -R open-gsd/gsd-pi --comment "Implemented in PR #N"
# Edit labels on issue
gh issue edit <number> -R open-gsd/gsd-pi \
--add-label "status:in-progress" \
--remove-label "status:needs-grooming"
Issue Types (Classification)
gh issue create has no --type flag. Issue types (Bug, Feature Request, etc.) are set via GraphQL after creation:
# Step 1: Create the issue (returns URL)
ISSUE_URL=$(gh issue create -R open-gsd/gsd-pi \
--title "..." --body "...")
# Step 2: Set the issue type via GraphQL
ISSUE_NUM=$(echo "$ISSUE_URL" | grep -oE '[0-9]+$')
ISSUE_ID=$(gh api graphql -f query='{ repository(owner:"open-gsd",name:"gsd-pi") { issue(number:'"$ISSUE_NUM"') { id } } }' --jq '.data.repository.issue.id')
TYPE_ID=$(gh api graphql -f query='{ repository(owner:"open-gsd",name:"gsd-pi") { issueTypes(first:20) { nodes { id name } } } }' --jq '.data.repository.issueTypes.nodes[] | select(.name=="Bug") | .id')
gh api graphql -f query='mutation { updateIssue(input:{id:"'"$ISSUE_ID"'",issueTypeId:"'"$TYPE_ID"'"}) { issue { number } } }'
Replace "Bug" with the appropriate type name ("Feature Request", "Task", etc.).
Labels
# List all labels
gh label list -R open-gsd/gsd-pi
# Create label
gh label create "priority:p1" --color "E99695" \
--description "High priority" -R open-gsd/gsd-pi
See labels.md for the full taxonomy and color codes.
Projects V2
# List projects
gh project list --owner open-gsd
# Create project
gh project create --owner open-gsd --title "gsd-pi Backlog"
# Add issue to project
gh project item-add 1 --owner open-gsd \
--url https://github.com/open-gsd/gsd-pi/issues/42
See projects-v2.md for field creation and item editing commands.
Milestones
gh has no native milestone subcommand — use gh api with the REST endpoint:
# List milestones
gh api repos/open-gsd/gsd-pi/milestones
# Create milestone
gh api repos/open-gsd/gsd-pi/milestones \
-X POST -f title="v1.0" -f due_on="2026-03-31T00:00:00Z"
# Assign milestone to issue
gh api repos/open-gsd/g
Установить gh в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл gh?
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. Provides auto-install script with SHA256 verification and GITHUB_TOKEN auth with anonymous fallback. Use when gh command not found, shutil.which("gh") returns None, need GitHub API access (issues, PRs, releases, workflow runs), or repository operations fail with "failed to determine base repo" error. Documents required -R flag for all gh commands in proxy environments. Includes project management: GitHub Projects V2 (gh project), milestones (REST API), issue stories (lifecycle and templates), and label taxonomy management.
Как установить скилл gh?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gh запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic