gh-cli-expert

Provides GitHub CLI command reference, safety classification, and usage patterns for gh operations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with the GitHub CLI involves dozens of command groups, version-dependent flags, and subtle pitfalls like silent GET-to-POST method switches or identity drift between accounts. This Skill gives an agent a structured reference for routing gh commands correctly, classifying them by safety level, and avoiding destructive mistakes. ## Core Features & Use Cases - Command routing reference: Complete tables of gh command groups (issue, pr, repo, run, release, api, auth, extension, and more) with their subcommands and purposes. - Three-tier safety model: Classifies commands as read-only, mutating, or destructive, with rules such as never pre-filling --yes on destructive operations. - gh api guidance: Covers REST and GraphQL calls, pagination with --paginate and --slurp, typed vs raw fields (-F vs -f), and common pitfalls like placeholder resolution from git remotes. - Authentication and identity drift handling: Explains token methods, OAuth scopes, multi-account switching, and the authoritative gh api /user check to verify the active account before mutations. - Use Case: When asked to merge a pull request or delete a release, the agent consults the safety model, runs gh <command> --help for current flags, verifies the active GitHub identity, and only then executes the mutating command. ## Quick Start Ask the agent to list open pull requests with their authors and check CI run status for the current repository using the gh CLI.

Frequently Asked Questions about gh-cli-expert

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

FAQPage Schema
How do I list GitHub pull requests with specific fields using gh CLI?▼

Use gh pr list with --json followed by explicit field names, such as gh pr list --json number,title,state,author. Add --jq to filter results, for example --jq '.[] | "\(.number): \(.title)"', using the bundled jq support without needing a separate binary.

How do I call the GitHub API with gh api?▼

Run gh api with the endpoint path, for example gh api repos/{owner}/{repo}/issues --jq '.[].title'. Use -f for string parameters and -F for typed values, and add --paginate --slurp to fetch all pages into a single JSON array.

Why does gh api switch from GET to POST unexpectedly?▼

Adding any -f or -F field parameter silently changes the HTTP method from GET to POST. Always pass --method GET explicitly when adding parameters to a read-only call to avoid unintended mutations.

How do I check which GitHub account is active with gh?▼

Run gh api /user --jq .login to ask GitHub directly which account the current token belongs to. The gh auth status command reads a config flag that can drift from the actual token after account switches, so the API call is the authoritative check.

Which gh commands are destructive and need confirmation?▼

Destructive commands include gh issue delete, gh repo delete, gh run delete, gh release delete, gh cache delete, and gh gist delete, most of which are irreversible. Never pre-fill --yes or -y on these; let the interactive confirmation prompt run.

What tasks are outside the scope of the gh CLI reference?▼

Git operations like branching, merging, and rebasing belong to a git-focused skill, shell scripting patterns belong to a shell skill, and authoring GitHub Actions workflow YAML is out of scope. This reference covers managing runs and workflows via gh run and gh workflow only.