gh

Standardize gh CLI usage for predictable JSON outputs across repositories.

5|Updated Apr 29, 2023
One-click install
npx skills add https://github.com/n4vysh/dotfiles --skill gh-n4vysh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh
Source: https://github.com/n4vysh/dotfiles/tree/main/home/dot_agents/skills/gh
Command: npx skills add https://github.com/n4vysh/dotfiles --skill gh-n4vysh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline and standardize GitHub CLI (gh) usage within agents to produce predictable, parseable outputs.

Core Features & Use Cases

  • Structured output: enforce JSON-like results from gh commands for downstream processing.
  • Pagination and targeting: handle multi-page results and scope commands to specific repos.
  • GH API fallback: gracefully fall back to gh api for fields not exposed by commands; supports cross-repo searches and mixed workflows.
  • Use Case: automate issue/pr discovery, categorization, and summary generation across multiple repos in a CI agent.

Quick Start

Instruct the agent to list open PRs in OWNER/REPO with JSON output and limit to 100 results.

Frequently Asked Questions about gh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get structured JSON output from gh CLI commands in an automation agent?

To get structured JSON output from gh CLI commands, you standardize agent usage by applying the --json flag. This enforces parseable results for reliable downstream processing and automation runs.

What is the best way to list issues across multiple GitHub repos?

Listing issues across multiple GitHub repos is handled by standardizing repository targeting with the --repo flag and managing multi-page results using pagination limits to ensure predictable outputs.

How do I retrieve GitHub PR fields not exposed by standard gh commands?

To retrieve GitHub PR fields not exposed by standard gh commands, you fall back to gh api. This gracefully handles missing data fields and supports mixed workflows across repositories.

Does this approach support categorizing open PRs in CI pipelines?

Yes, this approach supports categorizing open PRs in CI pipelines by automating issue and PR discovery. It generates summaries across multiple repos using structured outputs and pagination.

Why should I standardize gh CLI usage for agent runs instead of raw commands?

Standardizing gh CLI usage for agent runs ensures predictable, parseable outputs. Raw commands lack consistent formatting, whereas enforcing structured JSON and pagination handles multi-repo workflows reliably.