github-cli
Reference for GitHub CLI (gh) - READ-ONLY operations only. ALWAYS read BEFORE using gh commands to ensure correct syntax and available flags.
Files1
View on GitHubSKILL.mdvar/agents/skills/references/github-cli/SKILL.md
GitHubGitHub CLI Guardrails (gh)
Run gh <subcommand> --help (or man gh-<subcommand>) for exact command syntax, subcommands, and flags. Apply these local rules:
Safety & Permissions
- Read vs. write boundary: Read operations run without prompting. Write operations (creating, editing, commenting, closing, or merging issues/PRs/releases, or rerunning/canceling Actions) require explicit user request and confirmation.
- Never delete repos: Never run
gh repo delete. - Always pass
-X GETon read-onlygh apicalls: Passing-for-Fwithout-X GETsilently switchesgh apitoPOST. Only usePOST/PUT/PATCH/DELETEor GraphQLmutationqueries when explicitly requested.
Non-Interactive & Targeting Rules
- Always pass
-R owner/repoexplicitly: Do not rely on implicit repository detection. Identifyowner/repoviajj git remote list. - Prevent interactive prompts on writes: Always pass explicit
-t "<title>"and-b "<body>"flags (and-B/-Hongh pr create) soghnever opens$EDITORor blocks on stdin. - Structured output: Prefer
--json <fields>with--jqor pipe tojaqover scraping human-formatted tables.