تخطَّ إلى المحتوى
إضافةمستورديحتوي سكربتاتيحتوي خطّافاتترخيص مشاركة بالمثل

gh-cli

Intercepts GitHub URL fetches (WebFetch and MCP fetch tools) and curl/wget commands, redirecting to the authenticated gh CLI.

وصف مستورد لم يراجعه محرر بعد

جاء هذا العنصر من مستودعه الأصلي وفحصناه آلياً فقط، ولم يكتب له محرر وصفاً عربياً بعد. اقرأ محتواه بنفسك قبل أن تعتمد عليه. ولا تُفهرس هذه الصفحة في محركات البحث حتى تُراجَع.

التنزيل

اقرأ هذا قبل أن تنزّل

لا يشغّل تلقين أي شيء من هذا العنصر. لكن ما تنزّله يعمل على جهازك إن شغّلته أنت أو سمحت لكلود كود بتشغيله، فاقرأ الملفات أولاً.

  • في العنصر ملفات سكربت.
  • في العنصر خطّافات تعمل تلقائياً عند أحداث في كلود كود.

الملفات: 19 · الحجم: 90 ك.ب

نزّل ملف ZIP

يحمل الملف ترخيص المصدر الأصلي.

التثبيت

تُثبَّت الإضافات من سوق الإضافات في كلود كود، لا بنسخ الملفات. نزّل الحزمة لتقرأ محتواها وترخيصها.

التعليمات

gh-cli

A Claude Code plugin that intercepts GitHub URL fetches and redirects Claude to use the authenticated gh CLI instead.

Problem

Claude Code's WebFetch tool, MCP fetch tools (Exa's web_fetch_exa and similar), and Bash curl/wget commands don't use the user's GitHub authentication. This means:

  • Private repos: Fetches fail with 404 errors
  • Rate limits: Unauthenticated requests are limited to 60/hour (vs 5,000/hour authenticated)
  • Missing data: Some API responses are incomplete without authentication

Solution

This plugin provides:

  1. PreToolUse hooks that intercept GitHub URL access via WebFetch, MCP fetch/scrape/crawl/extract tools, or curl/wget, and suggest the correct gh CLI command
  2. A gh PATH shim that blocks anti-patterns: API /contents/ fetching and non-session-scoped temp directory clones
  3. A SessionEnd hook that automatically cleans up cloned repositories when the session ends

What Gets Intercepted

The fetch hook matches WebFetch plus any MCP tool whose name contains fetch, scrape, crawl, or extract — mcp__exa__web_fetch_exa, mcp__firecrawl__firecrawl_scrape, mcp__tavily__tavily_extract, and equivalents from other MCP servers. Web tools named something else entirely (browser navigation, for instance) are not covered; hooks/matcher.bats records exactly which names match.

It reads both fetch payload shapes — WebFetch's single url, and the urls field MCP fetch tools use to batch several pages into one call, whether that field arrives as an array or a bare string. Because a tool call is atomic, one GitHub URL anywhere in a batch denies the whole call; the denial names each offending URL alongside its suggestion. WebFetch's prompt field is deliberately not scanned, so a prompt that merely mentions a GitHub URL is not denied.

ToolPatternSuggestion
WebFetch, MCP fetchgithub.com/{owner}/{repo}gh repo view owner/repo
WebFetch, MCP fetchgithub.com/.../blob/...gh repo clone + Read
WebFetch, MCP fetchgithub.com/.../tree/...gh repo clone + Read/Glob/Grep
WebFetch, MCP fetchgithub.com/.../pull/{n}gh pr view
WebFetch, MCP fetchgithub.com/.../issues/{n}gh issue view
WebFetch, MCP fetchgithub.com/.../releases/download/...gh release download
WebFetch, MCP fetchapi.github.com/repos/.../pullsgh pr list / gh pr view
WebFetch, MCP fetchapi.github.com/repos/.../issuesgh issue list / gh issue view
WebFetch, MCP fetchapi.github.com/repos/.../contents/...gh repo clone + Read
WebFetch, MCP fetchapi.github.com/repos/.../releasesgh release list
WebFetch, MCP fetchapi.github.com/repos/.../actionsgh run list
WebFetch, MCP fetchapi.github.com/... (anything else)gh api <endpoint>
WebFetch, MCP fetchraw.githubusercontent.com/...gh repo clone + Read
WebFetch, MCP fetchgist.github.com/...gh gist view
Bashcurl https://api.github.com/...gh api <endpoint>
Bashcurl https://raw.githubusercontent.com/...gh repo clone + Read
Bashwget https://github.com/...gh release download
Bash (shim)gh api repos/.../contents/...gh repo clone + Read
Bash (shim)gh repo clone ... /tmp/... (non-session-scoped)Session-scoped clone path

What Passes Through

  • Non-GitHub URLs (any domain that isn't github.com, api.github.com, raw.githubusercontent.com, or gist.github.com)
  • GitHub Pages sites (*.github.io)
  • Commands already using gh (except anti-patterns blocked by the shim; see table above)
  • Git commands (git clone, git push, etc.)
  • Search commands that mention GitHub URLs (grep, rg, etc.)

Note: When hooks deny blob/tree/raw URLs, the denial message explicitly warns against using gh api to fetch and base64-decode file contents as a fallback — clone the repo instead.

Automatic Cleanup

Cloned repositories are stored in session-scoped temp directories ($TMPDIR/gh-clones-<session-id>/). A SessionEnd hook automatically removes them when the session ends, so there's no manual cleanup needed and concurrent sessions don't interfere with each other.

Prerequisites

  • GitHub CLI (gh) must be installed and authenticated (gh auth login)
  • If gh is not installed, the hooks pass through without disruption

Installation

/plugin marketplace add trailofbits/skills
/plugin install gh-cli

الملفات

  • مجلد.claude-plugin324 بايت
    • plugin.json324 بايت
  • مجلدhooks61 ك.بسكربت
    • مجلدshims13 ك.بسكربت
      • gh3 ك.بسكربت
      • gh-shim.bats10 ك.بسكربت
    • cleanup-clones.sh737 بايتسكربت
    • hooks.json1.4 ك.ب
    • intercept-github-curl.bats8.2 ك.بسكربت
    • intercept-github-curl.sh2.9 ك.بسكربت
    • intercept-github-fetch.bats9.8 ك.بسكربت
    • intercept-github-fetch.sh5.5 ك.بسكربت
    • matcher.bats4.4 ك.بسكربت
    • persist-session-id.sh1.2 ك.بسكربت
    • session-hooks.bats4.7 ك.بسكربت
    • setup-shims.bats3.9 ك.بسكربت
    • setup-shims.sh1.3 ك.بسكربت
    • test_helper.bash4.1 ك.بسكربت
  • مجلدskills4.4 ك.ب
    • مجلدgh-cli4.4 ك.ب
      • مجلدagents219 بايت
        • openai.yaml219 بايت
      • مجلدassets3 ك.ب
        • trail-of-bits-mark.svg3 ك.ب
      • SKILL.md1.2 ك.ب
  • LICENSE20 ك.ب
  • README.md4.5 ك.ب

ما وجده الفحص الآلي

فحصنا الملفات آلياً وقت الاستيراد. هذا ما نبّه إليه الفحص، ولا يعني أن العنصر ضار ولا أنه سليم: اقرأه بنفسك.

  • يحتاج مراجعةأمر يعمل داخل خطّاف

    في الملف plugins/gh-cli/hooks/hooks.json

  • يحتاج مراجعةأمر يعمل داخل خطّاف

    في الملف plugins/gh-cli/hooks/hooks.json

  • يحتاج مراجعةأمر يعمل داخل خطّاف

    في الملف plugins/gh-cli/hooks/hooks.json

  • يحتاج مراجعةأمر يعمل داخل خطّاف

    في الملف plugins/gh-cli/hooks/hooks.json

  • يحتاج مراجعةأمر يعمل داخل خطّاف

    في الملف plugins/gh-cli/hooks/hooks.json

  • يحتاج مراجعةملف سكربت

    في الملف plugins/gh-cli/hooks/cleanup-clones.sh

  • يحتاج مراجعةيحذف ملفات بالقوة وبالتكرار

    في الملف plugins/gh-cli/hooks/cleanup-clones.sh، السطر 17

  • يحتاج مراجعةيحذف ملفات بالقوة وبالتكرار

    في الملف plugins/gh-cli/hooks/session-hooks.bats، السطر 44

  • يحتاج مراجعةيحذف ملفات بالقوة وبالتكرار

    في الملف plugins/gh-cli/hooks/setup-shims.bats، السطر 19

  • يحتاج مراجعةيحذف ملفات بالقوة وبالتكرار

    في الملف plugins/gh-cli/hooks/shims/gh-shim.bats، السطر 25

  • يحتاج مراجعةيحذف ملفات بالقوة وبالتكرار

    في الملف plugins/gh-cli/hooks/test_helper.bash، السطر 49

التعليقات (0)

لا تعليقات بعد. كن أول من يعلّق.

سجّل الدخول لتعلّق. التعليق من المستوى 1 (عضو).

أبلغ

عناصر مشابهة

  • إضافةمستورد

    agent-sdk-dev

    Claude Agent SDK Development Plugin

    Apache-2.0الملفات: 6

  • إضافةمستورد

    block-no-verify

    PreToolUse hook that prevents AI agents from using --no-verify, --no-gpg-sign, and other bypass flags that skip git hooks

    MITالملفات: 4

  • إضافةمستورد

    chrome-mcp-troubleshooting

    Diagnose and fix Claude in Chrome MCP extension connectivity issues

    CC-BY-SA-4.0الملفات: 5

  • إضافةمستورد

    claude-code-setup

    Analyze codebases and recommend tailored Claude Code automations such as hooks, skills, MCP servers, and subagents.

    Apache-2.0الملفات: 10

  • إضافةمستورديحتوي سكربتات

    dgx-spark-ops

    NVIDIA DGX Spark (GB10 Grace Blackwell) environment operations: aarch64/CUDA-13 stack setup, training gotcha preflights, and unified-memory/thermal management for local ML workloads

    MITالملفات: 13

  • إضافةمستورديحتوي سكربتات

    llm-application-dev

    LLM application development with LangGraph, RAG systems, vector search, and AI agent architectures for Claude 4.6 and GPT-5.4

    MITالملفات: 33