github-cli Cursor ruleA

github-cli from metagit-ai/metagit-cli is a Cursor rule: instructions the Cursor agent follows in that repo.

Install it, pinned
mdr add metagit-ai/metagit-cli/.cursor/rules/github-cli.mdc@git:20260603.0f2037c

Pins git:20260603.0f2037c in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 14 of 14 checks passed
Kind
Cursor rule
Repository
metagit-ai/metagit-cli
Path
.cursor/rules/github-cli.mdc
Versions recorded
1
Latest version
git:20260603.0f2037c, committed Jun 3, 2026
Size
922 bytes
Repository stars
4
License
MIT

GitHub CLI (gh) auth — unset stale token env vars before API calls.

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# GitHub CLI authentication

Before any `gh` command (`gh pr create`, `gh issue`, `gh run`, etc.), **unset stale token environment variables** that override the keyring login:

```bash
env -u GH_TOKEN -u GITHUB_TOKEN gh <subcommand> ...
```

## Why

An invalid or expired `GH_TOKEN` / `GITHUB_TOKEN` in the shell environment causes `HTTP 401: Bad credentials` even when `gh auth status` shows a valid keyring account (with "Active account: false" on the keyring entry).

## Checklist for PRs

1. Push branch: `git push -u origin HEAD` (SSH/git creds are separate from `gh`).
2. Create PR: `env -u GH_TOKEN -u GITHUB_TOKEN gh pr create ...`
3. If auth still fails: `gh auth status` then `gh auth login` if needed.

Do **not** export `GH_TOKEN` for local `gh` unless intentionally using that token for the session.

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add metagit-ai/metagit-cli/.cursor/rules/github-cli.mdc@sha256:d249be7094e7cda8

The line at the top of this page pins the label git:20260603.0f2037c, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_oucos6jo4qkdzl75.svg)](https://markdownregistry.com/a/art_oucos6jo4qkdzl75)

3 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 1 version of this file, committed on Jun 3, 2026.

versioncommittedcommitsizeaudit
git:20260603.0f2037c latest2026-06-03 0f2037c 922 BA view

Audit of the latest version

A  14 of 14 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Size between 200 bytes and 200 KB (922 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

metagit-ai/metagit-cli · 4 stars · license MIT · pushed 2026-10-31 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_oucos6jo4qkdzl75
GET https://markdownregistry.com/api/v1/resolve?ref=metagit-ai/metagit-cli/.cursor/rules/github-cli.mdc
GET https://markdownregistry.com/api/v1/blob/d249be7094e7cda8713a7a90a3c36adb1df3b10f5b11aee5f69e9aeabdfee661

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: Cursor rules vs AGENTS.md · which agent file does what.

More from metagit-ai/metagit-cli

gitnexus-cli SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus-cli/SKILL.md · Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate…
git:20260907.a6ce61c · audit A · 4 stars
gitnexus-debugging SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus-debugging/SKILL.md · Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: "Why is X failing?"…
git:20260907.a6ce61c · audit A · 4 stars
gitnexus-exploring SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus-exploring/SKILL.md · Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar…
git:20260907.a6ce61c · audit A · 4 stars
gitnexus-guide SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus-guide/SKILL.md · Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph…
git:20260907.a6ce61c · audit A · 4 stars
gitnexus-impact-analysis SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus-impact-analysis/SKILL.md · Use when the user wants to know what will break if they change something, or needs safety analysis before editing code…
git:20260907.a6ce61c · audit A · 4 stars
gitnexus-refactoring SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus-refactoring/SKILL.md · Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: "Rename this function"…
git:20260907.a6ce61c · audit A · 4 stars
gitnexus-cli SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus/gitnexus-cli/SKILL.md · Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate…
git:20260625.aebf5ae · audit A · 4 stars
gitnexus-debugging SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus/gitnexus-debugging/SKILL.md · Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: "Why is X failing?"…
git:20260625.aebf5ae · audit A · 4 stars
gitnexus-exploring SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus/gitnexus-exploring/SKILL.md · Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar…
git:20260625.aebf5ae · audit A · 4 stars
gitnexus-guide SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus/gitnexus-guide/SKILL.md · Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph…
git:20260625.aebf5ae · audit A · 4 stars
gitnexus-impact-analysis SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus/gitnexus-impact-analysis/SKILL.md · Use when the user wants to know what will break if they change something, or needs safety analysis before editing code…
git:20260625.aebf5ae · audit A · 4 stars
gitnexus-refactoring SKILL.md skill
metagit-ai/metagit-cli · .agents/skills/gitnexus/gitnexus-refactoring/SKILL.md · Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: "Rename this function"…
git:20260625.aebf5ae · audit A · 4 stars

Every file in metagit-ai/metagit-cli

Other files named github-cli

github-cli SKILL.md skill
eltmon/overdeck · sync-sources/skills/github-cli/SKILL.md · GitHub CLI (gh) reference for issues, PRs, and API calls
git:20260618.ccb1e75 · audit A · 34 stars
github-cli SKILL.md skill
dpalfery/kyber-weave · products/kyber-squad/skills/github-cli/SKILL.md · use the github CLI to interact with github resources.
git:20260908.d184cd7 · audit A · 23 stars
github-cli SKILL.md skill
melvynx/ai-maxxing-skills · skills/setup-vps/server-skills/github-cli/SKILL.md · Every GitHub job from this server through the gh CLI - list, create and clone repos, push code, pull requests, issues…
git:20261021.15ae71f · audit A · 23 stars
github-cli SKILL.md skill
ethanyoq/skill-hub · archives/user-installed-skills/github-cli/e4ed8a3ab1d64cb6/github-cli/SKILL.md · MUST USE for GitHub-related operations, including a GitHub URL, repository or code search, Issues, pull requests…
git:20260912.84c6c93 · audit A · 11 stars
github-cli SKILL.md skill
anilcancakir/claude-code · opencode/ac/skills/github-cli/SKILL.md · Work with GitHub repositories, issues, PRs, releases and Actions runs through the gh CLI instead of web fetches. Use…
git:20261031.71e1c47 · audit A · 3 stars
github-cli SKILL.md skill
anilcancakir/claude-code · plugins/ac/skills/github-cli/SKILL.md · Work with GitHub repositories, issues, PRs, releases and Actions runs through the gh CLI instead of web fetches.
git:20261031.71e1c47 · audit A · 3 stars
github-cli SKILL.md skill
rogue-dev-studio/ai-agents-rogue · skills/github-cli/SKILL.md · GitHub CLI authentication and workflow configuration. Use when the project needs this capability or the user / team…
git:20260731.ddb8838 · audit A · 2 stars

Browse by kind, by grade A, or by owner.