github-cli-ops

Perform GitHub operations via the gh CLI with gh api and GraphQL fallbacks.

1|1|Updated May 24, 2026
One-click install
npx skills add https://github.com/bm629/agent-skills --skill github-cli-ops-bm629
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-cli-ops
Source: https://github.com/bm629/agent-skills/tree/main/skills/github-cli-ops
Command: npx skills add https://github.com/bm629/agent-skills --skill github-cli-ops-bm629

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Agents that need to act on GitHub programmatically often guess REST payloads, mutate global gh auth state, or hand-roll secret encryption. This Skill provides a disciplined, CLI-first workflow for performing any GitHub operation with per-call token authentication and no global state changes. ## Core Features & Use Cases - CLI-first operation routing: Scan a bundled command index to prefer first-class gh commands (issues, PRs, repos, releases, secrets, Actions runs) and fall back to gh api or gh api graphql only where no command exists. - Per-call authentication: Every invocation uses GH_TOKEN from a caller-injected variable name, never running gh auth switch and never printing the token value. - OpenAPI-driven REST fallback: A bundled GitHub OpenAPI spec plus a Python $ref-resolver script produces exact endpoint parameters, request bodies, and gh api call skeletons for the REST long tail. - Use Case: Ask the agent to create an issue, set an encrypted repository secret, and query repo traffic views; it picks gh issue create, gh secret set, and a resolved gh api call respectively, all authenticated per-call. ## Quick Start Use github-cli-ops to create an issue titled "Bug: login timeout" in my repository and list the open pull requests.

Frequently Asked Questions about github-cli-ops

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

FAQPage Schema
How do I create a GitHub issue from the command line with gh?

Use gh issue create with --repo, --title, and --body flags, authenticated per-call with GH_TOKEN. The Skill reads exact flags from live gh --help output so they always match the installed gh version.

When should I use gh api instead of a gh command?

Use gh api only when no first-class gh command exists, such as for teams, checks, packages, code-scanning, dependabot, or repo traffic endpoints. The Skill's endpoint index and resolver script build the exact call from the bundled OpenAPI spec.

How does per-call GH_TOKEN authentication work with gh?

Prefix every invocation with GH_TOKEN="$VAR", which takes precedence over stored credentials for that single call. This avoids gh auth switch, which mutates the global active account across all shells.

Does this support GitHub Enterprise Server?

Enterprise hosts route through the injected host value with GH_HOST and GH_ENTERPRISE_TOKEN, but the Skill targets github.com in v1 and Enterprise usage is untested. Local interactive commands like gh auth login or gh repo clone are out of scope.

Why does my gh api call fail with a 403 or 404 error?

A 4xx on a valid call usually means the token lacks a required scope such as repo, delete_repo, or read:org. Mint a properly scoped token rather than retrying; it is an authorization issue, not a bug in the call.

How do I set GitHub Actions secrets without exposing values?

Use gh secret set, which encrypts the value client-side before sending it to GitHub. Never hand-roll libsodium encryption or PUT a raw secret value through the REST API yourself.