gh-api

Query and mutate GitHub resources via gh api REST and GraphQL.

3|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill gh-api-cogni-ai-ou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-api
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/gh-api
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill gh-api-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of not being able to access or manipulate the exact GitHub data fields you need using only standard gh subcommands.

Core Features & Use Cases

  • Advanced REST/GraphQL via gh api: Fetches or updates GitHub resources using REST endpoints or GraphQL queries and mutations when native commands fall short.
  • Correct parameter handling for reliability: Guides when to use -F vs -f, how to upload file bodies safely, and how to avoid brittle shell patterns.
  • Operational troubleshooting and robustness: Helps avoid common pitfalls like blind pagination, incorrect field typing, and indexing delays; includes rate-limit and error-mode guidance.
  • Use Case: List all workflow runs associated with a PR branch and title when gh pr checks misses workflow_dispatch and issue_comment runs.

Quick Start

Use gh-api to list workflow runs for a pull request by querying the actions/runs REST API with branch and title filtering.

Frequently Asked Questions about gh-api

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

FAQPage Schema
How do I fetch GitHub workflow runs that gh pr checks misses?

Standard gh pr checks misses workflow_dispatch and issue_comment runs. Query the actions/runs REST API directly via gh api to list all workflow runs associated with a specific PR branch and title with precise filtering.

When should I use GraphQL instead of REST with gh api?

Use GraphQL with gh api when native gh commands lack the required fields or endpoints for precise mutations. It enables variable-driven mutations and precise field selection that standard REST endpoints cannot provide.

What's the best way to handle parameters and file uploads in gh api?

The best way to handle parameters in gh api is using -F for type conversion and safe file expansion. This approach avoids brittle shell patterns and ensures correct parameter typing for reliable API requests.

How do I parse and paginate GitHub API output robustly?

Parse and paginate GitHub API output robustly by using --json, --jq, or --template flags. This prevents blind pagination and ensures accurate data extraction from large result sets without hitting rate limits.

Why does my GitHub API query fail due to incorrect field typing?

Your GitHub API query fails due to incorrect field typing when using -f instead of -F. Use -F for type conversion to ensure parameters are correctly formatted as strings, integers, or booleans for the API.