Engineering
github-gh avatar

github-gh

Interact with GitHub via the gh CLI to manage issues, pull requests, workflow runs, and execute advanced API queries programmatically.

Introduction

The GitHub CLI (gh) skill provides a powerful interface for AI agents to interact directly with GitHub repositories. By leveraging the native gh CLI tool, agents can bridge the gap between local development environments and remote repository management. This skill is primarily intended for software engineers, DevOps practitioners, and automated systems that require programmatic access to GitHub data, status monitoring, and resource management without manual intervention. It excels in CI/CD automation scenarios where an agent needs to retrieve build states, inspect logs, or triage issues efficiently.

  • Perform comprehensive PR management: Check CI/CD status, list active pull requests, and retrieve specific PR metadata.

  • Execute granular workflow control: Access detailed workflow run history, identify failed build steps, and retrieve log content for debugging purposes.

  • Advanced API interaction: Use the gh api command to query specific REST API endpoints, supporting JQ filtering for precise data extraction, such as filtering issues by number or title or fetching custom PR fields.

  • Structured output handling: Support for --json output flags and --jq filters ensures that the agent receives data in a machine-readable format, minimizing parsing errors and improving the reliability of subsequent agent logic.

  • Always specify the repository context using --repo owner/repo when outside a local git repository or when explicitly targeting a remote project.

  • Utilize the --json flag whenever possible to obtain structured objects, which are easier for the agent to process compared to raw console text.

  • Ensure the gh CLI is authenticated with sufficient permissions on the target environment to execute read and write operations.

  • When debugging failures, prioritize using the --log-failed flag with the gh run view command to isolate relevant diagnostic information.

  • For complex queries, use the built-in JQ processor to filter large API responses, which helps in reducing token consumption during reasoning steps.

Repository Stats

Stars
68
Forks
5
Open Issues
3
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 05:01 AM
View on GitHub