gh-cli

Executes GitHub CLI commands for repositories, issues, pull requests, Actions, and releases.

10|2|Updated May 6, 2026
One-click install
npx skills add https://github.com/jcrabapple/hermes-skills --skill gh-cli-jcrabapple
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gh-cli
Source: https://github.com/jcrabapple/hermes-skills/tree/main/gh-cli
Command: npx skills add https://github.com/jcrabapple/hermes-skills --skill gh-cli-jcrabapple

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Working with GitHub through the web UI is slow for repetitive tasks like creating issues, reviewing pull requests, managing releases, and monitoring CI runs. This Skill provides a complete command reference for the GitHub CLI (gh) so an agent can perform any GitHub operation directly from the terminal. ## Core Features & Use Cases - Full Command Coverage: Reference for repositories, issues, pull requests, GitHub Actions workflows and runs, projects, releases, gists, codespaces, organizations, labels, secrets, and extensions. - Authentication & Setup: Covers gh auth login, token management, git credential helper setup, and environment variables for automation. - Scripting & Automation: Includes JSON output with --json and --jq filtering, bulk operations with xargs, and direct REST/GraphQL calls via gh api, including pushing files through the Contents API without cloning. - Use Case: Ask the agent to list all open PRs failing checks, request changes on each, then rerun the failed workflow jobs — all executed with the correct gh commands and flags. ## Quick Start Use the gh-cli skill to list all open pull requests in this repository and show their check status.

Frequently Asked Questions about gh-cli

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

FAQPage Schema
How do I create a pull request from the command line with gh?▼

Run gh pr create with --title and --body to open a pull request from your current branch. Add --draft for a draft PR, --reviewer to request reviewers, or --web to finish in the browser.

How to authenticate GitHub CLI for automation scripts?▼

Set the GH_TOKEN environment variable with a personal access token, or pipe a token via gh auth login --with-token. Run gh auth setup-git so git operations use gh as the credential helper.

Does GitHub CLI work with GitHub Enterprise Server?▼

Yes, gh supports GitHub Enterprise through the --hostname flag on commands like gh auth login and gh api. You can also set GH_HOST or GH_ENTERPRISE_HOSTNAME environment variables to target an enterprise instance.

How do I filter gh command output with jq?▼

Add --json with the fields you need, then pipe through --jq with a jq expression, for example gh pr list --json number,title --jq '.[].title'. This works on most list and view commands for scripting.

Can I push a file to GitHub without cloning the repository?▼

Yes, use gh api with the Contents API: base64-encode the file with base64 -w0, then call gh api repos/{owner}/{repo}/contents/{path} -X PUT with the message and content fields. The -w0 flag is required to avoid line wrapping that breaks the payload.

Why does gh pr merge fail even when checks pass?▼

Merges can fail due to branch protection rules, required reviews, or draft status. Use gh pr checks to inspect status, gh pr ready to mark a draft ready, or --admin to merge with administrator privileges when permitted.