gh-cli

gh-cli is a cursor rule for Cursor from cdbattags/ai. It costs 559 tokens per session, scanned A, original, MIT.

A rule requiring all GitHub work to use the gh command-line tool. GitHub is a service for hosting code, issues, pull requests, releases, and automated workflows.

In plain words
What is it for?
Use it when creating or reviewing pull requests, managing issues and releases, checking automated workflow runs, calling the GitHub API, or working across repositories.
Why use it?
It gives GitHub tasks one consistent command-line workflow instead of mixing tools or using the website directly.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when creating or reviewing pull requests, managing issues and releases, checking automated workflow runs, calling the GitHub API, or working across repositories.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/cdbattags/ai/gh-cli
View source ↗ cdbattags/ai
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/cdbattags/ai

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gh-cli

README.md
[![agentmods](https://agentmods.dev/badge/rules/cdbattags/ai/gh-cli/github.svg)](https://agentmods.dev/rules/cdbattags/ai/gh-cli)
Your own site
<a href="https://agentmods.dev/rules/cdbattags/ai/gh-cli"><img src="https://agentmods.dev/badge/rules/cdbattags/ai/gh-cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gh-cli

Your own site · 80×15
<a href="https://agentmods.dev/rules/cdbattags/ai/gh-cli"><img src="https://agentmods.dev/badge/rules/cdbattags/ai/gh-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 559 This file is loaded in full into every session.
When invoked 559 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00559 $0.00559
Opus 5.5 $0.00224 $0.00224
Sonnet 5.5 $0.00112 $0.00112
Haiku 4.5 $0.00056 $0.00056

Measured 3mo ago against content hash 21d4c5e75d39, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gh-cli scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Use `gh` instead of raw `curl`/API calls or the GitHub web UI for all GitHub operations.
src/rules/gh-cli.mdc · 56 lines

What it actually says

GitHub CLI (gh)

Use gh instead of raw curl/API calls or the GitHub web UI for all GitHub operations.

Sandbox Permissions

gh commands require network access. Always use required_permissions: ["full_network"] in Shell tool calls.

Key Commands

Task Command
Create PR gh pr create --title "..." --body "..."
View PR gh pr view <number>
List PRs gh pr list
PR checks gh pr checks <number>
Merge PR gh pr merge <number>
Create issue gh issue create --title "..." --body "..."
List issues gh issue list
Workflow runs gh run list, gh run view <id>
Releases gh release create <tag>, gh release list
Arbitrary API gh api <endpoint>
Cross-repo Add -R OWNER/REPO to any command

Read vs Write Operations

Read-only commands do not require user approval — just run them. These include any command that only fetches or displays data:

  • gh pr list, gh pr view, gh pr checks, gh pr diff
  • gh issue list, gh issue view
  • gh run list, gh run view
  • gh release list, gh release view
  • gh search issues/prs/code/repos
  • gh api GET requests (the default method)

Write commands do require explicit user approval before executing:

  • gh pr create, gh pr merge, gh pr review, gh pr close
  • gh issue create, gh issue close, gh issue comment
  • gh run rerun
  • gh release create, gh release upload, gh release delete
  • gh api with -X POST, -X PATCH, -X PUT, -X DELETE, or -f/--input

Conventions

  • Pass long bodies via HEREDOC: --body "$(cat <<'EOF' ... EOF)"
  • Use --jq or --template to extract specific fields from output
  • Use gh api with {owner} and {repo} placeholders for the current repo
  • For detailed patterns and examples, read the gh-cli skill
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 56 lines · 559 tokens per session scan A 21d4c5e75d39

Subscribe to this mod's changes

gh-cli is a cursor rule published in the GitHub repository cdbattags/ai (5 stars, last pushed 9mo ago), licensed MIT. It adds 559 tokens to every session, about $0.0022 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

gh-cli compared with cursor rules from other repositories

gh-cli next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
gh-clicdbattags/aiCursor rule59mo agoMITA559Cursor
git-masterJkudjo/oh-my-cursorCursor rule118d agoMITA14Cursor
git-mv-renamejaansokk/cursor_toolsCursor rule110d agoMITA27Cursor
fork-first-methodologyTashanGKD/tashan-cursor-skillsCursor rule258mo agoMITA50Cursor
git-workflownedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA891Cursor
gitflowflyeric0212/cursor-rulesCursor rule1.9k10mo agononeA5Cursor
gitflyeric0212/cursor-rulesCursor rule1.9k10mo agononeA0Cursor