{
  "markdown": "# Agent Calling\n\n---\nThis extension is still under development; please use it at your discretion.\n\n---\n\nCalling other proxies and language models within the Gemini CLI.\n\n[English](README.md) | [简体中文](README.zh-CN.md)\n\n- [x] Claude code\n- [ ] Codex\n\n---\n\n## Core Architecture\n\nAgent Calling integrates Claude into the Gemini CLI ecosystem through three key mechanisms:\n\n1.  **Path Hijacking**: Creates a temporary directory containing a proxy script named `claude` (or `claude.cmd`) and forces this directory to the front of the system `PATH` environment variable.\n2.  **Context Injection**: The proxy script injects the current state of the Gemini CLI (such as workspace paths) as environment variables, allowing Claude to be aware of the Gemini context.\n3.  **Lifecycle Monitoring**: The proxy script sends notifications before and after calling the actual Claude CLI, enabling the host (Gemini CLI) to synchronize UI states or execute subsequent logic.\n\n---\n\n## Installation\n\n### 1. Prerequisites\n*   **Official Claude CLI**: Ensure that Anthropic's `claude` command-line tool is installed and configured on your system.\n*   **Node.js Environment**: Node.js 18+ is recommended.\n\n### 2. Method 1: Gemini CLI Direct Installation\n```bash\ngemini extension install https://github.com/xuansheep/agent-calling\ncd ~/.gemini/extensions/agent-calling\nnpm install\nnpm run build\n```\n\n### 3. Method 2: Via npm\n```bash\nnpm install -g agent-calling\n```\nadd Gemini setting.json\n```json\n{\n  \"mcpServers\": {\n    \"claude-mcp\": {\n      \"command\": \"agent-calling\",\n      \"args\": []\n    }\n  }\n}\n```\n\n---\n\n## Usage\n\n### 1. Direct Command Invocation\nOnce installed, Gemini CLI will expose a tool named `claude`. You can send instructions directly:\n\n```bash\ngemini claude \"Analyze the architecture of src/index.ts and suggest refactorings\"\n```\n\n### 2. Advanced Parameter Passthrough\nYou can pass additional command-line options to the original Claude CLI via the `args` parameter:\n\n```bash\ngemini claude \"Scan codebase\" --args \"--output-format json\"\n```\n\n---\n\n## Automation (GEMINI.md)\n\nTo achieve automatic delegation of complex tasks, this project includes a `GEMINI.md` configuration file. When you perform the following operations in the Gemini CLI, the Agent will automatically invoke this extension based on the instruction set:\n\n### Delegation Criteria\n- **System Architecture Analysis**: e.g., \"Analyze overall project architecture\", \"Identify dependencies between modules\".\n- **Long-term Planning**: e.g., \"Generate a detailed implementation plan\", \"Create a refactoring roadmap\".\n- **Deep Code Review**: e.g., \"Scan the codebase for potential security vulnerabilities\".\n- **Complex Refactoring Suggestions**: Involving decoupling logic or pattern refactoring.\n\n### Automated Execution Protocol\n1.  **Context Injection**: The Agent automatically injects the list of files currently being processed or related documents into the `prompt`.\n2.  **Structured Output**: Claude is required to return results in JSON format by default (e.g., using `--output-format json`) for subsequent automated processing.\n",
  "bytes": 3088,
  "sha": "ffde421cdc56846d25e31227b87ad5c1fa1e07f7893cc9af6dbc8e3ae4c65498",
  "repo_slug": "xuansheep/agent-calling-beta",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_xuansheep_agent_calling_beta_8b2f4f8d/readme"
}