gh-cli

Automates GitHub CLI operations for pull requests, issues, Actions, releases, secrets, and API access.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/eklyukin/my-ai-config --skill gh-cli-eklyukin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gh-cli
Source: https://github.com/eklyukin/my-ai-config/tree/main/skills/gh-cli
Command: npx skills add https://github.com/eklyukin/my-ai-config --skill gh-cli-eklyukin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gh, and includes scripts (resource) and references (resource) components.

What problem does it solve? Working with GitHub from the terminal involves memorizing dozens of gh commands, jq filters, and API endpoints, and debugging CI failures or managing releases manually is slow and error-prone. This Skill provides a complete command reference plus Python utilities that automate the most common GitHub workflows end to end. ## Core Features & Use Cases - Full gh command coverage: Auth, repos, PRs, issues, Actions runs, releases, secrets, variables, gists, code search, and branch protection via REST and GraphQL APIs, with agent-friendly JSON output patterns. - Python automation utilities: Scripts for enhanced code search, failed workflow run analysis, PR lifecycle automation, release management with checksums, secret sync, GitHub Pages deployment, and pre-built API queries. - Use Case: A CI pipeline fails on your pull request. Run the failed-run analyzer to extract error excerpts from the logs, fix the issue, rerun only the failed jobs, then auto-merge the PR once checks pass. ## Quick Start Ask the assistant to list the failed GitHub Actions runs in this repository and show the error logs for the most recent failure.

Frequently Asked Questions about gh-cli

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

FAQPage Schema
How do I debug a failed GitHub Actions workflow run from the command line?▼

Use gh run list --status failure to find failed runs, then gh run view RUN_ID --log-failed to get error logs. The included gh_failed_run.py script automates this by finding the most recent failure and extracting error excerpts as JSON.

How do I create and merge a pull request with the GitHub CLI?▼

Push your branch, run gh pr create --fill to auto-fill title and body, wait for CI with gh pr checks --watch, then merge with gh pr merge --squash --delete-branch. Stash uncommitted local changes first, since merge checks out the target branch.

Can I use the GitHub CLI in non-interactive scripts and CI pipelines?▼

Yes. Set GH_PROMPT_DISABLED=1, authenticate with a token via gh auth login --with-token, and use flags like --fill, --yes, and --json for machine-readable output. The Skill documents these agent-friendly patterns throughout.

How do I query the GitHub GraphQL API with gh?▼

Run gh api graphql -f query='...' with -f for string variables and -F for typed variables. Add --paginate for cursor-based pagination. The api-patterns reference includes ready-made queries for repositories, users, and organizations.

Why does gh pr merge fail with local changes would be overwritten?▼

This happens when your working tree has uncommitted changes in files that differ between branches, because merge checks out the target branch locally. Run git stash before merging and git stash pop afterward to restore your changes.

How do I set up branch protection rules using the GitHub CLI?▼

Use gh api repos/{owner}/{repo}/branches/main/protection with a PUT request and a JSON payload defining required reviews, status checks, and force-push restrictions. The Skill provides copy-ready payloads for standard and minimal protection setups.