gh-cli-agentic
БесплатноБез исполняемых скриптовНе проверенgh CLI commands with JSON output for agents. Use when querying PRs, issues, runs, or repo metadata; inspecting PR checks; fetching failed CI logs; or mapping…
от laurigates★ 61 звезда на GitHubОб этом скилле
GitHub CLI Agentic Patterns
When to Use This Skill
| Use this skill when... | Use the alternative when... |
|---|---|
Querying PRs, issues, runs, or repo metadata with gh and need JSON output |
Use git-cli-agentic for porcelain-mode local git queries (status, diff, log) |
| Inspecting PR checks, mergeable status, or fetching failed CI logs | Use github-actions-plugin:gh-workflow-monitoring to actively watch a run until it completes |
Resolving a github.com URL into an gh api call or working with sub-issues |
Use git-issue-hierarchy for sub-issue add/remove/dependency-graph operations |
Looking up label, repo, or workflow metadata via gh JSON commands |
Use github-labels to actually apply or create labels on issues/PRs |
Optimized gh commands for AI agent consumption using JSON output and structured field selection.
Core Principle
Always use --json <fields> for machine-readable output. The --jq filter is built-in (no jq installation required).
gh api sends every field as a string unless you use -F
-f key=value types the value as a string, so an endpoint expecting a
number rejects it:
gh api -X POST repos/O/R/issues/2380/sub_issues -f sub_issue_id=5471095685
Invalid property /sub_issue_id: "5471095685" is not of type `integer`. (HTTP 422)
-F key=value reads the value as a typed literal (number, boolean, null, or
@file) and the identical call succeeds. Observed 2026-09-16: six sub-issue
links failed this way before the flag changed. The error quotes the value and
names the property, so it reads as a bad id — the id was right and the flag was
wrong. Use -F for every numeric id (sub_issue_id, after_id) and -f for
free text.
Pull Request Operations
Check Status
# Get all check statuses
gh pr checks $PR_NUMBER --json name,state,conclusion,detailsUrl
# Filter to failed only
gh pr checks $PR_NUMBER --json name,state,conclusion --jq '.[] | select(.conclusion == "FAILURE")'
Fields: name, state, conclusion, detailsUrl, startedAt, completedAt
PR Details
# Essential PR info
gh pr view $PR_NUMBER --json number,title,state,mergeable,statusCheckRollup
# Full context
gh pr view $PR_NUMBER --json number,title,body,state,author,labels,assignees,reviewDecision,mergeable,statusCheckRollup
Key Fields:
| Field | Description |
|---|---|
mergeable |
MERGEABLE, CONFLICTING, UNKNOWN |
reviewDecision |
APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED |
statusCheckRollup |
Array of check statuses |
List PRs
# Open PRs
gh pr list --json number,title,author,labels
# PRs by author
gh pr list --author @me --json number,title,state
# PRs needing review
gh pr list --search "review-requested:@me" --json number,title
Workflow Run Operations
Run Details
# Get run status with jobs
gh run view $RUN_ID --json conclusion,status,jobs,createdAt,updatedAt
# List recent runs
gh run list --json databaseId,status,conclusion,name,createdAt -L 10
Status Values: queued, in_progress, completed
Conclusion Values: success, failure, cancelled, skipped, neutral
Watch Run Until Completion
# Watch and wait for run to complete (blocking, no timeout needed)
gh run watch $RUN_ID --compact --exit-status
# Find and watch latest run
RUN_ID=$(gh run list -L 1 --json databaseId --jq '.[0].databaseId')
gh run watch $RUN_ID --compact --exit-status
Full watching patterns: github-actions-plugin:gh-workflow-monitoring.
Failed Logs
# Get only failed step logs (most useful for debugging)
gh run view $RUN_ID --log-failed
# Full logs (verbose)
gh run view $RUN_ID --log
Workflow Triggers
# Trigger workflow manually
gh workflow run $WORKFLOW_NAME
# Trigger with inputs
gh workflow run $WORKFLOW_NAME -f param1=value1 -f param2=value2
# List workflows
gh workflow list --json name,state,path
Issue Operations
Issue Details
# Full issue context
gh issue view $ISSUE_NUMBER --json number,title,body,state,labels,assignees,comments
# Minimal
gh issue view $ISSUE_NUMBER --json number,title,state,labels
# With sub-issue progress
gh issue view $ISSUE_NUMBER --json number,title,state,subIssuesSummary
Read a thread with --json title,body,comments, not --comments. In a non-TTY context (every agent Bash call), gh issue view N --comments prints only the comments, with no title or body. When the issue has zero comments it prints nothing and exits 0, so an empty thread looks like an empty issue (observed on gh 2.102.0, #3125). gh pr view --comments likely behaves the same way, but that is unverified.
List Issues
# Open issues
gh issue list --json number,title,labels,assignees
# By label
gh issue list --label "bug" --json number,title
# Assigned to me
gh issue list --assignee @me --json number,title,state
Bot-opened issues: jq on .author.login, n
Установить gh-cli-agentic в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(gh pr *)Bash(gh run *)Bash(gh issue *)Bash(gh repo *)Bash(gh workflow *)Bash(gh api *)ReadВложенные файлы
FAQ
Что делает скилл gh-cli-agentic?
gh CLI commands with JSON output for agents. Use when querying PRs, issues, runs, or repo metadata; inspecting PR checks; fetching failed CI logs; or mapping a github.com URL to an API call.
Как установить скилл gh-cli-agentic?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gh-cli-agentic запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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