Gemini CLI Documentation Skill CRITICAL: Path Doubling Prevention - MANDATORY ABSOLUTE PROHIBITION: NEVER use with in PowerShell when running scripts from this skill. The Problem: If your current working directory is already inside the skill directory, using relative paths causes PowerShell to resolve paths relative to the current directory instead of the repository root, resulting in path doubling. REQUIRED Solutions (choose one): 1. ALWAYS use absolute paths (recommended) 2. Use separate commands (never with ) 3. Run from repository root with relative paths NEVER DO THIS: - Chain with : cau…

, '.md'\n # Ask Gemini CLI to generate the documentation and print it to stdout\n gemini -p \"Generate a Markdown documentation summary for @$($_.Name). Print the result to standard output.\" | Out-File -FilePath $newName -Encoding utf8\n }\n ```\n\n2. Make the script executable and run it in your directory:\n\n **macOS/Linux**\n\n ```bash\n chmod +x generate_docs.sh\n ./generate_docs.sh\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n .\\generate_docs.ps1\n ```\n\n This creates a corresponding Markdown file for every Python file in the\n folder.\n\n## Extract structured JSON data\n\nWhen writing a script, you often need structured data (JSON) to pass to tools\nlike `jq`. To get pure JSON data from the model, combine the\n`--output-format json` flag with `jq` to parse the response field.\n\n### Scenario: Extract and return structured data\n\n1. Save the following script as `generate_json.sh` (or `generate_json.ps1` for\n Windows):\n\n **macOS/Linux (`generate_json.sh`)**\n\n ```bash\n #!/bin/bash\n\n # Ensure we are in a project root\n if [ ! -f \"package.json\" ]; then\n echo \"Error: package.json not found.\"\n exit 1\n fi\n\n # Extract data\n gemini --output-format json \"Return a raw JSON object with keys 'version' and 'deps' from @package.json\" | jq -r '.response' > data.json\n ```\n\n **Windows PowerShell (`generate_json.ps1`)**\n\n ```powershell\n # Ensure we are in a project root\n if (-not (Test-Path \"package.json\")) {\n Write-Error \"Error: package.json not found.\"\n exit 1\n }\n\n # Extract data (requires jq installed, or you can use ConvertFrom-Json)\n $output = gemini --output-format json \"Return a raw JSON object with keys 'version' and 'deps' from @package.json\" | ConvertFrom-Json\n $output.response | Out-File -FilePath data.json -Encoding utf8\n ```\n\n2. Run the script:\n\n **macOS/Linux**\n\n ```bash\n chmod +x generate_json.sh\n ./generate_json.sh\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n .\\generate_json.ps1\n ```\n\n3. Check `data.json`. The file should look like this:\n\n ```json\n {\n \"version\": \"1.0.0\",\n \"deps\": {\n \"react\": \"^18.2.0\"\n }\n }\n ```\n\n## Build your own custom AI tools\n\nUse headless mode to perform custom, automated AI tasks.\n\n### Scenario: Create a \"Smart Commit\" alias\n\nYou can add a function to your shell configuration to create a `git commit`\nwrapper that writes the message for you.\n\n**macOS/Linux (Bash/Zsh)**\n\n1. Open your `.zshrc` file (or `.bashrc` if you use Bash) in your preferred\n text editor.\n\n ```bash\n nano ~/.zshrc\n ```\n\n **Note**: If you use VS Code, you can run `code ~/.zshrc`.\n\n2. Scroll to the very bottom of the file and paste this code:\n\n ```bash\n function gcommit() {\n # Get the diff of staged changes\n diff=$(git diff --staged)\n\n if [ -z \"$diff\" ]; then\n echo \"No staged changes to commit.\"\n return 1\n fi\n\n # Ask Gemini to write the message\n echo \"Generating commit message...\"\n msg=$(echo \"$diff\" | gemini -p \"Write a concise Conventional Commit message for this diff. Output ONLY the message.\")\n\n # Commit with the generated message\n git commit -m \"$msg\"\n }\n ```\n\n Save your file and exit.\n\n3. Run this command to make the function available immediately:\n\n ```bash\n source ~/.zshrc\n ```\n\n**Windows (PowerShell)**\n\n1. Open your PowerShell profile in your preferred text editor.\n\n ```powershell\n notepad $PROFILE\n ```\n\n2. Scroll to the very bottom of the file and paste this code:\n\n ```powershell\n function gcommit {\n # Get the diff of staged changes\n $diff = git diff --staged\n\n if (-not $diff) {\n Write-Host \"No staged changes to commit.\"\n return\n }\n\n # Ask Gemini to write the message\n Write-Host \"Generating commit message...\"\n $msg = $diff | gemini -p \"Write a concise Conventional Commit message for this diff. Output ONLY the message.\"\n\n # Commit with the generated message\n git commit -m \"$msg\"\n }\n ```\n\n Save your file and exit.\n\n3. Run this command to make the function available immediately:\n\n ```powershell\n . $PROFILE\n ```\n\n4. Use your new command:\n\n ```bash\n gcommit\n ```\n\n Gemini CLI will analyze your staged changes and commit them with a generated\n message.\n\n## Next steps\n\n- Explore the [Headless mode reference](/docs/cli/headless) for full JSON\n schema details.\n- Learn about [Shell commands](/docs/cli/tutorials/shell-commands) to let the agent run scripts\n instead of just writing them.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7515,"content_sha256":"883fb3e9de624a2740d0110765ac2ba156a15f5a4219396be4ddf3acf3c68068"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/file-management.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/file-management\nsource_type: llms-txt\ncontent_hash: sha256:cce3fb6b899356104eae74e93f302d7744cf7f4374f39bbbd84560fddc3d530a\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"071b0ab4b999c9acfbe308da3a261dfb6400c0a88c41facfa3e7adf0aecf5acc\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# File management with Gemini CLI\n\nExplore, analyze, and modify your codebase using Gemini CLI. In this guide,\nyou'll learn how to provide Gemini CLI with files and directories, modify and\ncreate files, and control what Gemini CLI can see.\n\n## Prerequisites\n\n- Gemini CLI installed and authenticated.\n- A project directory to work with (for example, a git repository).\n\n## Providing context by reading files\n\nGemini CLI will generally try to read relevant files, sometimes prompting you\nfor access (depending on your settings). To ensure that Gemini CLI uses a file,\nyou can also include it directly.\n\n### Direct file inclusion (`@`)\n\nIf you know the path to the file you want to work on, use the `@` symbol. This\nforces the CLI to read the file immediately and inject its content into your\nprompt.\n\n```bash\n`@src/components/UserProfile.tsx Explain how this component handles user data.`\n```\n\n### Working with multiple files\n\nComplex features often span multiple files. You can chain `@` references to give\nthe agent a complete picture of the dependencies.\n\n```bash\n`@src/components/UserProfile.tsx @src/types/User.ts Refactor the component to use the updated User interface.`\n```\n\n### Including entire directories\n\nFor broad questions or refactoring, you can include an entire directory. Be\ncareful with large folders, as this consumes more tokens.\n\n```bash\n`@src/utils/ Check these utility functions for any deprecated API usage.`\n```\n\n## How to find files (Exploration)\n\nIf you _don't_ know the exact file path, you can ask Gemini CLI to find it for\nyou. This is useful when navigating a new codebase or looking for specific\nlogic.\n\n### Scenario: Find a component definition\n\nYou know there's a `UserProfile` component, but you don't know where it lives.\n\n```none\n`Find the file that defines the UserProfile component.`\n```\n\nGemini uses the `glob` or `list_directory` tools to search your project\nstructure. It will return the specific path (for example,\n`src/components/UserProfile.tsx`), which you can then use with `@` in your next\nturn.\n\n\u003c!-- prettier-ignore -->\n> [!TIP]\n> You can also ask for lists of files, like \"Show me all the TypeScript\n> configuration files in the root directory.\"\n\n## How to modify code\n\nOnce Gemini CLI has context, you can direct it to make specific edits. The agent\nis capable of complex refactoring, not just simple text replacement.\n\n```none\n`Update @src/components/UserProfile.tsx to show a loading spinner if the user data is null.`\n```\n\nGemini CLI uses the `replace` tool to propose a targeted code change.\n\n### Creating new files\n\nYou can also ask the agent to create entirely new files or folder structures.\n\n```none\n`Create a new file @src/components/LoadingSpinner.tsx with a simple Tailwind CSS spinner.`\n```\n\nGemini CLI uses the `write_file` tool to generate the new file from scratch.\n\n## Review and confirm changes\n\nGemini CLI prioritizes safety. Before any file is modified, it presents a\nunified diff of the proposed changes.\n\n```diff\n- if (!user) return null;\n+ if (!user) return \u003cLoadingSpinner />;\n```\n\n- **Red lines (-):** Code that will be removed.\n- **Green lines (+):** Code that will be added.\n\nPress **y** to confirm and apply the change to your local file system. If the\ndiff doesn't look right, press **n** to cancel and refine your prompt.\n\n## Verify the result\n\nAfter the edit is complete, verify the fix. You can simply read the file again\nor, better yet, run your project's tests.\n\n```none\n`Run the tests for the UserProfile component.`\n```\n\nGemini CLI uses the `run_shell_command` tool to execute your test runner (for\nexample, `npm test` or `jest`). This ensures the changes didn't break existing\nfunctionality.\n\n## Advanced: Controlling what Gemini sees\n\nBy default, Gemini CLI respects your `.gitignore` file. It won't read or search\nthrough `node_modules`, build artifacts, or other ignored paths.\n\nIf you have sensitive files (like `.env`) or large assets that you want to keep\nhidden from the AI _without_ ignoring them in Git, you can create a\n`.geminiignore` file in your project root.\n\n**Example `.geminiignore`:**\n\n```text\n.env\nlocal-db-dump.sql\nprivate-notes.md\n```\n\n## Next steps\n\n- Learn how to [Manage context and memory](/docs/cli/tutorials/memory-management) to keep your\n agent smarter over long sessions.\n- See [Execute shell commands](/docs/cli/tutorials/shell-commands) for more on running tests and\n builds.\n- Explore the technical [File system reference](/docs/tools/file-system) for\n advanced tool parameters.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4868,"content_sha256":"676f44bcef65c61c211d61daf2d4a6441aa4f1b7147ae4e612dcce4d7a902057"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/mcp-setup.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/mcp-setup\nsource_type: llms-txt\ncontent_hash: sha256:4da9a70ccd4f7cd78877c724618302379e80accfb9abc26002e7c96b8eab528a\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"eb0e535e9e262e32f45cff03ed1a36e2c6af790fc0f9f3b0be35fc62271da0db\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Set up an MCP server\n\nConnect Gemini CLI to your external databases and services. In this guide,\nyou'll learn how to extend Gemini CLI's capabilities by installing the GitHub\nMCP server and using it to manage your repositories.\n\n## Prerequisites\n\n- Gemini CLI installed.\n- **Docker:** Required for this specific example (many MCP servers run as Docker\n containers).\n- **GitHub token:** A Personal Access Token (PAT) with repo permissions.\n\n## How to prepare your credentials\n\nMost MCP servers require authentication. For GitHub, you need a PAT.\n\n1. Create a [fine-grained PAT](https://github.com/settings/tokens?type=beta).\n2. Grant it **Read** access to **Metadata** and **Contents**, and\n **Read/Write** access to **Issues** and **Pull Requests**.\n3. Store it in your environment:\n\n**macOS/Linux**\n\n```bash\nexport GITHUB_PERSONAL_ACCESS_TOKEN=\"github_pat_...\"\n```\n\n**Windows (PowerShell)**\n\n```powershell\n$env:GITHUB_PERSONAL_ACCESS_TOKEN=\"github_pat_...\"\n```\n\n## How to configure Gemini CLI\n\nYou tell Gemini about new servers by editing your `settings.json`.\n\n1. Open `~/.gemini/settings.json` (or the project-specific\n `.gemini/settings.json`).\n2. Add the `mcpServers` block. This tells Gemini: \"Run this docker container\n and talk to it.\"\n\n```json\n{\n \"mcpServers\": {\n \"github\": {\n \"command\": \"docker\",\n \"args\": [\n \"run\",\n \"-i\",\n \"--rm\",\n \"-e\",\n \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n \"ghcr.io/github/github-mcp-server:latest\"\n ],\n \"env\": {\n \"GITHUB_PERSONAL_ACCESS_TOKEN\": \"${GITHUB_PERSONAL_ACCESS_TOKEN}\"\n }\n }\n }\n}\n```\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> The `command` is `docker`, and the rest are arguments passed to it. We\n> map the local environment variable into the container so your secret isn't\n> hardcoded in the config file.\n\n## How to verify the connection\n\nRestart Gemini CLI. It will automatically try to start the defined servers.\n\n**Command:** `/mcp list`\n\nYou should see: `✓ github: docker ... - Connected`\n\nIf you see `Disconnected` or an error, check that Docker is running and your API\ntoken is valid.\n\n## How to use the new tools\n\nNow that the server is running, the agent has new capabilities (\"tools\"). You\ndon't need to learn special commands; just ask in natural language.\n\n### Scenario: Listing pull requests\n\n**Prompt:** `List the open PRs in the google/gemini-cli repository.`\n\nThe agent will:\n\n1. Recognize the request matches a GitHub tool.\n2. Call `mcp_github_list_pull_requests`.\n3. Present the data to you.\n\n### Scenario: Creating an issue\n\n**Prompt:**\n`Create an issue in my repo titled \"Bug: Login fails\" with the description \"See logs\".`\n\n## Troubleshooting\n\n- **Server won't start?** Try running the docker command manually in your\n terminal to see if it prints an error (e.g., \"image not found\").\n- **Tools not found?** Run `/mcp reload` to force the CLI to re-query the server\n for its capabilities.\n\n## Next steps\n\n- Explore the [MCP servers reference](/docs/tools/mcp-server) to learn about\n SSE and HTTP transports for remote servers.\n- Browse the\n [official MCP server list](https://github.com/modelcontextprotocol/servers) to\n find connectors for Slack, Postgres, Google Drive, and more.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":3603,"content_sha256":"eb00018402bf6e43418d5c3e7d9e997a35c74a456053e7877ba8b41604e10a05"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/memory-management.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/memory-management\nsource_type: llms-txt\ncontent_hash: sha256:a59f8d999cafdead274196a9b21501e056f83f580f2928b61a5e450d7867340c\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"28d24ee3426d01af5a3122f76d551a2424c90d01f323764f431627f59975dc0c\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Manage context and memory\n\nControl what Gemini CLI knows about you and your projects. In this guide, you'll\nlearn how to define project-wide rules with `GEMINI.md`, teach the agent\npersistent facts, and inspect the active context.\n\n## Prerequisites\n\n- Gemini CLI installed and authenticated.\n- A project directory where you want to enforce specific rules.\n\n## Why manage context?\n\nGemini CLI is powerful but general. It doesn't know your preferred testing\nframework, your indentation style, or your preference against `any` in\nTypeScript. Context management solves this by giving the agent persistent\nmemory.\n\nYou'll use these features when you want to:\n\n- **Enforce standards:** Ensure every generated file matches your team's style\n guide.\n- **Set a persona:** Tell the agent to act as a \"Senior Rust Engineer\" or \"QA\n Specialist.\"\n- **Remember facts:** Save details like \"My database port is 5432\" so you don't\n have to repeat them.\n\n## How to define project-wide rules (GEMINI.md)\n\nThe most powerful way to control the agent's behavior is through `GEMINI.md`\nfiles. These are Markdown files containing instructions that are automatically\nloaded into every conversation.\n\n### Scenario: Create a project context file\n\n1. In the root of your project, create a file named `GEMINI.md`.\n\n2. Add your instructions:\n\n ```markdown\n # Project Instructions\n\n - **Framework:** We use React with Vite.\n - **Styling:** Use Tailwind CSS for all styling. Do not write custom CSS.\n - **Testing:** All new components must include a Vitest unit test.\n - **Tone:** Be concise. Don't explain basic React concepts.\n ```\n\n3. Start a new session. Gemini CLI will now know these rules automatically.\n\n### Scenario: Using the hierarchy\n\nContext is loaded hierarchically. This allows you to have general rules for\neverything and specific rules for sub-projects.\n\n1. **Global:** `~/.gemini/GEMINI.md` (Rules for _every_ project you work on).\n2. **Project Root:** `./GEMINI.md` (Rules for the current repository).\n3. **Subdirectory:** `./src/GEMINI.md` (Rules specific to the `src` folder).\n\n**Example:** You might set \"Always use strict typing\" in your global config, but\n\"Use Python 3.11\" only in your backend repository.\n\n## How to teach the agent facts (Memory)\n\nSometimes you don't want to write a config file. You just want to tell the agent\nsomething once and have it remember forever. You can do this naturally in chat.\n\n### Scenario: Saving a memory\n\nJust tell the agent to remember something.\n\n**Prompt:** `Remember that I prefer using 'const' over 'let' wherever possible.`\n\nThe agent will use the `save_memory` tool to store this fact in your global\nmemory file.\n\n**Prompt:** `Save the fact that the staging server IP is 10.0.0.5.`\n\n### Scenario: Using memory in conversation\n\nOnce a fact is saved, you don't need to invoke it explicitly. The agent \"knows\"\nit.\n\n**Next Prompt:** `Write a script to deploy to staging.`\n\n**Agent Response:** \"I'll write a script to deploy to **10.0.0.5**...\"\n\n## How to manage and inspect context\n\nAs your project grows, you might want to see exactly what instructions the agent\nis following.\n\n### Scenario: View active context\n\nTo see the full, concatenated set of instructions currently loaded (from all\n`GEMINI.md` files and saved memories), use the `/memory show` command.\n\n**Command:** `/memory show`\n\nThis prints the raw text the model receives at the start of the session. It's\nexcellent for debugging why the agent might be ignoring a rule.\n\n### Scenario: Refresh context\n\nIf you edit a `GEMINI.md` file while a session is running, the agent won't know\nimmediately. Force a reload with:\n\n**Command:** `/memory reload`\n\n## Best practices\n\n- **Keep it focused:** Avoid adding excessive content to `GEMINI.md`. Keep\n instructions actionable and relevant to code generation.\n- **Use negative constraints:** Explicitly telling the agent what _not_ to do\n (for example, \"Do not use class components\") is often more effective than\n vague positive instructions.\n- **Review often:** Periodically check your `GEMINI.md` files to remove outdated\n rules.\n\n## Next steps\n\n- Learn about [Session management](/docs/cli/tutorials/session-management) to see how short-term\n history works.\n- Explore the [Command reference](/docs/reference/commands) for more\n `/memory` options.\n- Read the technical spec for [Project context](/docs/cli/gemini-md).\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4762,"content_sha256":"a06d28d36a0bcb6b8ed0154810d22196c2d7fcff263404ff4f087f5772c98070"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/plan-mode-steering.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/plan-mode-steering\nsource_type: llms-txt\ncontent_hash: sha256:780767fd8e398ac1f3b2c4f3fbaff9556681a7813a5baa844c06945e3adfc71b\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"b59a23a8ba1e335d37e020638486fed841d4a8aef412d644d1bdf17a7317309e\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Use Plan Mode with model steering for complex tasks\n\nArchitecting a complex solution requires precision. By combining Plan Mode's\nstructured environment with model steering's real-time feedback, you can guide\nGemini CLI through the research and design phases to ensure the final\nimplementation plan is exactly what you need.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> This is an experimental feature currently under active development and\n> may need to be enabled under `/settings`.\n\n## Prerequisites\n\n- Gemini CLI installed and authenticated.\n- [Plan Mode](/docs/cli/plan-mode) enabled in your settings.\n- [Model steering](/docs/cli/model-steering) enabled in your settings.\n\n## Why combine Plan Mode and model steering?\n\n[Plan Mode](/docs/cli/plan-mode) typically follows a linear path: research, propose,\nand draft. Adding model steering lets you:\n\n1. **Direct the research:** Correct the agent if it's looking in the wrong\n directory or missing a key dependency.\n2. **Iterate mid-draft:** Suggest a different architectural pattern while the\n agent is still writing the plan.\n3. **Speed up the loop:** Avoid waiting for a full research turn to finish\n before providing critical context.\n\n## Step 1: Start a complex task\n\nEnter Plan Mode and start a task that requires research.\n\n**Prompt:** `/plan I want to implement a new notification service using Redis.`\n\nGemini CLI enters Plan Mode and starts researching your existing codebase to\nidentify where the new service should live.\n\n## Step 2: Steer the research phase\n\nAs you see the agent calling tools like `list_directory` or `grep_search`, you\nmight realize it's missing the relevant context.\n\n**Action:** While the spinner is active, type your hint:\n`\"Don't forget to check packages/common/queues for the existing Redis config.\"`\n\n**Result:** Gemini CLI acknowledges your hint and immediately incorporates it\ninto its research. You'll see it start exploring the directory you suggested in\nits very next turn.\n\n## Step 3: Refine the design mid-turn\n\nAfter research, the agent starts drafting the implementation plan. If you notice\nit's proposing a design that doesn't align with your goals, steer it.\n\n**Action:** Type:\n`\"Actually, let's use a Publisher/Subscriber pattern instead of a simple queue for this service.\"`\n\n**Result:** The agent stops drafting the current version of the plan,\nre-evaluates the design based on your feedback, and starts a new draft that uses\nthe Pub/Sub pattern.\n\n## Step 4: Approve and implement\n\nOnce the agent has used your hints to craft the perfect plan, review the final\n`.md` file.\n\n**Action:** Type: `\"Looks perfect. Let's start the implementation.\"`\n\nGemini CLI exits Plan Mode and transitions to the implementation phase. Because\nthe plan was refined in real-time with your feedback, the agent can now execute\neach step with higher confidence and fewer errors.\n\n## Tips for effective steering\n\n- **Be specific:** Instead of \"do it differently,\" try \"use the existing\n `Logger` class in `src/utils`.\"\n- **Steer early:** Providing feedback during the research phase is more\n efficient than waiting for the final plan to be drafted.\n- **Use for context:** Steering is a great way to provide knowledge that might\n not be obvious from reading the code (e.g., \"We are planning to deprecate this\n module next month\").\n\n## Next steps\n\n- Explore [Agent Skills](/docs/cli/skills) to add specialized expertise to your\n planning turns.\n- See the [Model steering reference](/docs/cli/model-steering) for technical\n details.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":3890,"content_sha256":"a3548496c087f7d36984d02968fa6c9b4b33d2e72f93aa15fc7fc531f86132e5"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/session-management.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/session-management\nsource_type: llms-txt\ncontent_hash: sha256:f671414287fa9778241dacdb17f2c0abe136de638a389c53f5ec2b5c3cff2a7a\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"eca5d06b41e53b0f53908220ba32932256996c9d1d89349bec79920ce57e2de6\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Manage sessions and history\n\nResume, browse, and rewind your conversations with Gemini CLI. In this guide,\nyou'll learn how to switch between tasks, manage your session history, and undo\nmistakes using the rewind feature.\n\n## Prerequisites\n\n- Gemini CLI installed and authenticated.\n- At least one active or past session.\n\n## How to resume where you left off\n\nIt's common to switch context—maybe you're waiting for a build and want to work\non a different feature. Gemini makes it easy to jump back in.\n\n### Scenario: Resume the last session\n\nThe fastest way to pick up your most recent work is with the `--resume` flag (or\n`-r`).\n\n```bash\ngemini -r\n```\n\nThis restores your chat history and memory, so you can say \"Continue with the\nnext step\" immediately.\n\n### Scenario: Browse past sessions\n\nIf you want to find a specific conversation from yesterday, use the interactive\nbrowser.\n\n**Command:** `/resume`\n\nThis opens a searchable list of all your past sessions. You'll see:\n\n- A timestamp (e.g., \"2 hours ago\").\n- The first user message (helping you identify the topic).\n- The number of turns in the conversation.\n\nSelect a session and press **Enter** to load it.\n\n## How to manage your workspace\n\nOver time, you'll accumulate a lot of history. Keeping your session list clean\nhelps you find what you need.\n\n### Scenario: Deleting sessions\n\nIn the `/resume` browser, navigate to a session you no longer need and press\n**x**. This permanently deletes the history for that specific conversation.\n\nYou can also manage sessions from the command line:\n\n```bash\n# List all sessions with their IDs\ngemini --list-sessions\n\n# Delete a specific session by ID or index\ngemini --delete-session 1\n```\n\n## How to rewind time (Undo mistakes)\n\nGemini CLI's **Rewind** feature is like `Ctrl+Z` for your workflow.\n\n### Scenario: Triggering rewind\n\nAt any point in a chat, type `/rewind` or press **Esc** twice.\n\n### Scenario: Choosing a restore point\n\nYou'll see a list of your recent interactions. Select the point _before_ the\nundesired changes occurred.\n\n### Scenario: Choosing what to revert\n\nGemini gives you granular control over the undo process. You can choose to:\n\n1. **Rewind conversation:** Only remove the chat history. The files stay\n changed. (Useful if the code is good but the chat got off track).\n2. **Revert code changes:** Keep the chat history but undo the file edits.\n (Useful if you want to keep the context but retry the implementation).\n3. **Rewind both:** Restore everything to exactly how it was.\n\n## How to fork conversations\n\nSometimes you want to try two different approaches to the same problem.\n\n1. Start a session and get to a decision point.\n2. Save the current state with `/resume save decision-point`.\n3. Try your first approach.\n4. Later, use `/resume resume decision-point` to fork the conversation back to\n that moment and try a different approach.\n\nThis creates a new branch of history without losing your original work.\n\n## Next steps\n\n- Learn about [Checkpointing](/docs/cli/checkpointing) to understand the\n underlying safety mechanism.\n- Explore [Task planning](/docs/cli/tutorials/task-planning) to keep complex sessions organized.\n- See the [Command reference](/docs/reference/commands) for `/resume`\n options, grouped checkpoint menus, and `/chat` compatibility aliases.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":3690,"content_sha256":"7ce67d72bf1ced488c5465cfd7413d6a08be81508f758b90df3cf30a3e7d3de7"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/shell-commands.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/shell-commands\nsource_type: llms-txt\ncontent_hash: sha256:1ac7c0840b4490180adc33b82ffb560afa3688777b856f68a4e1c6ddb6568761\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"09520176c43409605f444683cfca230443b832bd6266b9d249e766214b81605c\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Execute shell commands\n\nUse the CLI to run builds, manage git, and automate system tasks without leaving\nthe conversation. In this guide, you'll learn how to run commands directly,\nautomate complex workflows, and manage background processes safely.\n\n## Prerequisites\n\n- Gemini CLI installed and authenticated.\n- Basic familiarity with your system's shell (Bash, Zsh, PowerShell, and so on).\n\n## How to run commands directly (`!`)\n\nSometimes you just need to check a file size or git status without asking the AI\nto do it for you. You can pass commands directly to your shell using the `!`\nprefix.\n\n**Example:** `!ls -la`\n\nThis executes `ls -la` immediately and prints the output to your terminal.\nGemini CLI also records the command and its output in the current session\ncontext, so the model can reference it in follow-up prompts. Very large outputs\nmay be truncated.\n\n### Scenario: Entering Shell mode\n\nIf you're doing a lot of manual work, toggle \"Shell Mode\" by typing `!` and\npressing **Enter**. Now, everything you type is sent to the shell until you exit\n(usually by pressing **Esc** or typing `exit`).\n\n## How to automate complex tasks\n\nYou can automate tasks using a combination of Gemini CLI and shell commands.\n\n### Scenario: Run tests and fix failures\n\nYou want to run tests and fix any failures.\n\n**Prompt:**\n`Run the unit tests. If any fail, analyze the error and try to fix the code.`\n\n**Workflow:**\n\n1. Gemini calls `run_shell_command('npm test')`.\n2. You see a confirmation prompt: `Allow command 'npm test'? [y/N]`.\n3. You press `y`.\n4. The tests run. If they fail, Gemini reads the error output.\n5. Gemini uses `read_file` to inspect the failing test.\n6. Gemini uses `replace` to fix the bug.\n7. Gemini runs `npm test` again to verify the fix.\n\nThis loop lets Gemini work autonomously.\n\n## How to manage background processes\n\nYou can ask Gemini to start long-running tasks, like development servers or file\nwatchers.\n\n**Prompt:** `Start the React dev server in the background.`\n\nGemini will run the command (e.g., `npm run dev`) and detach it.\n\n### Scenario: Viewing active shells\n\nTo see what's running in the background, use the `/shells` command.\n\n**Command:** `/shells`\n\nThis opens a dashboard where you can view logs or kill runaway processes.\n\n## How to handle interactive commands\n\nGemini CLI attempts to handle interactive commands (like `git add -p` or\nconfirmation prompts) by streaming the output to you. However, for highly\ninteractive tools (like `vim` or `top`), it's often better to run them yourself\nin a separate terminal window or use the `!` prefix.\n\n## Safety features\n\nGiving an AI access to your shell is powerful but risky. Gemini CLI includes\nseveral safety layers.\n\n### Confirmation prompts\n\nBy default, **every** shell command requested by the agent requires your\nexplicit approval.\n\n- **Allow once:** Runs the command one time.\n- **Allow always:** Trusts this specific command for the rest of the session.\n- **Deny:** Stops the agent.\n\n### Sandboxing\n\nFor maximum security, especially when running untrusted code or exploring new\nprojects, we strongly recommend enabling Sandboxing. This runs all shell\ncommands inside a secure Docker container.\n\n**Enable sandboxing:** Use the `--sandbox` flag when starting the CLI:\n`gemini --sandbox`.\n\n## Next steps\n\n- Learn about [Sandboxing](/docs/cli/sandbox) to safely run destructive\n commands.\n- See the [Shell tool reference](/docs/tools/shell) for configuration options\n like timeouts and working directories.\n- Explore [Task planning](/docs/cli/tutorials/task-planning) to see how shell commands fit into\n larger workflows.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":3992,"content_sha256":"4a7738d7324eb0c658057673f18f6a687e24d2f4c44f604d82f4570a3f0102fc"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/skills-getting-started.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/skills-getting-started\nsource_type: llms-txt\ncontent_hash: sha256:b50f9fca4dd779f2379892dd87b7a19d936f3848fd913e5ff663bdba113842b8\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"0d81fa42209ad1e426f37080b3c5073c48707c53ae2e0b3fbb715c653d5d7b65\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Get started with Agent Skills\n\nAgent Skills extend Gemini CLI with specialized expertise. In this guide, you'll\nlearn how to create your first skill, bundle custom scripts, and activate them\nduring a session.\n\n## How to create a skill\n\nA skill is defined by a directory containing a `SKILL.md` file. Let's create an\n**API Auditor** skill that helps you verify if local or remote endpoints are\nresponding correctly.\n\n### Create the directory structure\n\n1. Run the following command to create the folders:\n\n **macOS/Linux**\n\n ```bash\n mkdir -p .gemini/skills/api-auditor/scripts\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n New-Item -ItemType Directory -Force -Path \".gemini\\skills\\api-auditor\\scripts\"\n ```\n\n### Create the definition\n\n1. Create a file at `.gemini/skills/api-auditor/SKILL.md`. This tells the agent\n _when_ to use the skill and _how_ to behave.\n\n ```markdown\n ---\n name: api-auditor\n description:\n Expertise in auditing and testing API endpoints. Use when the user asks to\n \"check\", \"test\", or \"audit\" a URL or API.\n ---\n\n # API Auditor Instructions\n\n You act as a QA engineer specialized in API reliability. When this skill is\n active, you MUST:\n\n 1. **Audit**: Use the bundled `scripts/audit.js` utility to check the\n status of the provided URL.\n 2. **Report**: Analyze the output (status codes, latency) and explain any\n failures in plain English.\n 3. **Secure**: Remind the user if they are testing a sensitive endpoint\n without an `https://` protocol.\n ```\n\n### Add the tool logic\n\nSkills can bundle resources like scripts.\n\n1. Create a file at `.gemini/skills/api-auditor/scripts/audit.js`. This is the\n code the agent will run.\n\n ```javascript\n // .gemini/skills/api-auditor/scripts/audit.js\n const url = process.argv[2];\n\n if (!url) {\n console.error('Usage: node audit.js \u003curl>');\n process.exit(1);\n }\n\n console.log(`Auditing ${url}...`);\n fetch(url, { method: 'HEAD' })\n .then((r) => console.log(`Result: Success (Status ${r.status})`))\n .catch((e) => console.error(`Result: Failed (${e.message})`));\n ```\n\n## How to verify discovery\n\nGemini CLI automatically discovers skills in the `.gemini/skills` directory. You\ncan also use `.agents/skills` as a more generic alternative. Check that it found\nyour new skill.\n\n**Command:** `/skills list`\n\nYou should see `api-auditor` in the list of available skills.\n\n## How to use the skill\n\nNow, try it out. Start a new session and ask a question that triggers the\nskill's description.\n\n**User:** \"Can you audit http://geminicli.com\"\n\nGemini recognizes the request matches the `api-auditor` description and asks for\npermission to activate it.\n\n**Model:** (After calling `activate_skill`) \"I've activated the **api-auditor**\nskill. I'll run the audit script now...\"\n\nGemini then uses the `run_shell_command` tool to execute your bundled Node\nscript:\n\n`node .gemini/skills/api-auditor/scripts/audit.js http://geminili.com`\n\n## Next steps\n\n- Explore the\n [Agent Skills Authoring Guide](/docs/cli/skills#creating-a-skill) to learn\n about more advanced features.\n- Learn how to share skills via [Extensions](/docs/extensions).\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":3613,"content_sha256":"c53fbeb680d5528a777aa643dc9441b382f9a4c8392a74af8f2825867158749f"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/task-planning.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/task-planning\nsource_type: llms-txt\ncontent_hash: sha256:3bf9a1756b671df1c5f1159ef92a7418e52bd499cadaa51bac3bcecb7accdb5e\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"7d3cecf4eb0a5769732a89fca81ce249f26129c2fc64a0cef8b6519a395360a0\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Plan tasks with todos\n\nKeep complex jobs on the rails with Gemini CLI's built-in task planning. In this\nguide, you'll learn how to ask for a plan, execute it step-by-step, and monitor\nprogress with the todo list.\n\n## Prerequisites\n\n- Gemini CLI installed and authenticated.\n- A complex task in mind (e.g., a multi-file refactor or new feature).\n\n## Why use task planning?\n\nStandard LLMs have a limited context window and can \"forget\" the original goal\nafter 10 turns of code generation. Task planning provides:\n\n1. **Visibility:** You see exactly what the agent plans to do _before_ it\n starts.\n2. **Focus:** The agent knows exactly which step it's working on right now.\n3. **Resilience:** If the agent gets stuck, the plan helps it get back on\n track.\n\n## How to ask for a plan\n\nThe best way to trigger task planning is to explicitly ask for it.\n\n**Prompt:**\n`I want to migrate this project from JavaScript to TypeScript. Please make a plan first.`\n\nGemini will analyze your codebase and use the `write_todos` tool to generate a\nstructured list.\n\n**Example Plan:**\n\n1. [ ] Create `tsconfig.json`.\n2. [ ] Rename `.js` files to `.ts`.\n3. [ ] Fix type errors in `utils.js`.\n4. [ ] Fix type errors in `server.js`.\n5. [ ] Verify build passes.\n\n## How to review and iterate\n\nOnce the plan is generated, it appears in your CLI. Review it.\n\n- **Missing steps?** Tell the agent: \"You forgot to add a step for installing\n `@types/node`.\"\n- **Wrong order?** Tell the agent: \"Let's verify the build _after_ each file,\n not just at the end.\"\n\nThe agent will update the todo list dynamically.\n\n## How to execute the plan\n\nTell the agent to proceed.\n\n**Prompt:** `Looks good. Start with the first step.`\n\nAs the agent works, you'll see the todo list update in real-time above the input\nbox.\n\n- **Current focus:** The active task is highlighted (e.g.,\n `[IN_PROGRESS] Create tsconfig.json`).\n- **Progress:** Completed tasks are marked as done.\n\n## How to monitor progress (`Ctrl+T`)\n\nFor a long-running task, the full todo list might be hidden to save space. You\ncan toggle the full view at any time.\n\n**Action:** Press **Ctrl+T**.\n\nThis shows the complete list, including pending, in-progress, and completed\nitems. It's a great way to check \"how much is left?\" without scrolling back up.\n\n## How to handle unexpected changes\n\nPlans change. Maybe you discover a library is incompatible halfway through.\n\n**Prompt:**\n`Actually, let's skip the 'server.js' refactor for now. It's too risky.`\n\nThe agent will mark that task as `cancelled` or remove it, and move to the next\nitem. This dynamic adjustment is what makes the todo system powerful—it's a\nliving document, not a static text block.\n\n## Next steps\n\n- Explore [Session management](/docs/cli/tutorials/session-management) to save your plan and\n finish it tomorrow.\n- See the [Todo tool reference](/docs/tools/todos) for technical schema\n details.\n- Learn about [Memory management](/docs/cli/tutorials/memory-management) to persist planning\n preferences (e.g., \"Always create a test plan first\").\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":3421,"content_sha256":"ea1501c24d6487cdf7e620970dc839733f1ca9c1848bf41d62c7e5f6b6d37abb"},{"filename":"canonical/geminicli-com/docs/cli/tutorials/web-tools.md","content":"---\nsource_url: http://geminicli.com/docs/cli/tutorials/web-tools\nsource_type: llms-txt\ncontent_hash: sha256:372779d79765a471e3e273696e1eca1fd7d48fa60f73272d5eb47108cf1f4a4a\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"f3b39f1e18ed450e8459ae988c40cec8e14f05ca512d20b034a3f51c7e1375da\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Web search and fetch\n\nAccess the live internet directly from your prompt. In this guide, you'll learn\nhow to search for up-to-date documentation, fetch deep context from specific\nURLs, and apply that knowledge to your code.\n\n## Prerequisites\n\n- Gemini CLI installed and authenticated.\n- An internet connection.\n\n## How to research new technologies\n\nImagine you want to use a library released yesterday. The model doesn't know\nabout it yet. You need to teach it.\n\n### Scenario: Find documentation\n\n**Prompt:**\n`Search for the 'Bun 1.0' release notes and summarize the key changes.`\n\nGemini uses the `google_web_search` tool to find relevant pages and synthesizes\nan answer. This \"grounding\" process ensures the agent isn't hallucinating\nfeatures that don't exist.\n\n**Prompt:** `Find the documentation for the 'React Router v7' loader API.`\n\n## How to fetch deep context\n\nSearch gives you a summary, but sometimes you need the raw details. The\n`web_fetch` tool lets you feed a specific URL directly into the agent's context.\n\n### Scenario: Reading a blog post\n\nYou found a blog post with the exact solution to your bug.\n\n**Prompt:**\n`Read https://example.com/fixing-memory-leaks and explain how to apply it to my code.`\n\nGemini will retrieve the page content (stripping away ads and navigation) and\nuse it to answer your question.\n\n### Scenario: Comparing sources\n\nYou can even fetch multiple pages to compare approaches.\n\n**Prompt:**\n`Compare the pagination patterns in https://api.example.com/v1/docs and https://api.example.com/v2/docs.`\n\n## How to apply knowledge to code\n\nThe real power comes when you combine web tools with file editing.\n\n**Workflow:**\n\n1. **Search:** \"How do I implement auth with Supabase?\"\n2. **Fetch:** \"Read this guide: https://supabase.com/docs/guides/auth.\"\n3. **Implement:** \"Great. Now use that pattern to create an `auth.ts` file in\n my project.\"\n\n## How to troubleshoot errors\n\nWhen you hit an obscure error message, paste it into the chat.\n\n**Prompt:**\n`I'm getting 'Error: hydration mismatch' in Next.js. Search for recent solutions.`\n\nThe agent will search sources such as GitHub issues, StackOverflow, and forums\nto find relevant fixes that might be too new to be in its base training set.\n\n## Next steps\n\n- Explore [File management](/docs/cli/tutorials/file-management) to see how to apply the code you\n generate.\n- See the [Web search tool reference](/docs/tools/web-search) for citation\n details.\n- See the [Web fetch tool reference](/docs/tools/web-fetch) for technical\n limitations.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2894,"content_sha256":"821d73ddfeb20333157c639c890f9cc2d31da79d1fe61f200d775010a14a2620"},{"filename":"canonical/geminicli-com/docs/cli/uninstall.md","content":"---\nsource_url: https://geminicli.com/docs/cli/uninstall\nsource_type: llms-txt\ncontent_hash: sha256:a066af1bfcdaef37665912e13c48d208260f0736361b7e9cd027175e37457878\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"4551bfdfcd0ee71334d8179e6982d4363450a03b33c0c332fcfaba54241e8906\"'\nlast_modified: '2026-02-13T20:13:35Z'\n---\n\n# Uninstalling the CLI\n\nYour uninstall method depends on how you ran the CLI. Follow the instructions\nfor either npx or a global npm installation.\n\n## Method 1: Using npx\n\nnpx runs packages from a temporary cache without a permanent installation. To\n\"uninstall\" the CLI, you must clear this cache, which will remove gemini-cli and\nany other packages previously executed with npx.\n\nThe npx cache is a directory named `_npx` inside your main npm cache folder. You\ncan find your npm cache path by running `npm config get cache`.\n\n**For macOS / Linux**\n\n```bash\n# The path is typically ~/.npm/_npx\nrm -rf \"$(npm config get cache)/_npx\"\n```\n\n**For Windows**\n\n_Command Prompt_\n\n```cmd\n:: The path is typically %LocalAppData%\\npm-cache\\_npx\nrmdir /s /q \"%LocalAppData%\\npm-cache\\_npx\"\n```\n\n_PowerShell_\n\n```powershell\n# The path is typically $env:LocalAppData\\npm-cache\\_npx\nRemove-Item -Path (Join-Path $env:LocalAppData \"npm-cache\\_npx\") -Recurse -Force\n```\n\n## Method 2: Using npm (global install)\n\nIf you installed the CLI globally (e.g., `npm install -g @google/gemini-cli`),\nuse the `npm uninstall` command with the `-g` flag to remove it.\n\n```bash\nnpm uninstall -g @google/gemini-cli\n```\n\nThis command completely removes the package from your system.\n\n## Method 3: Homebrew\n\nIf you installed the CLI globally using Homebrew (e.g.,\n`brew install gemini-cli`), use the `brew uninstall` command to remove it.\n\n```bash\nbrew uninstall gemini-cli\n```\n\n## Method 4: MacPorts\n\nIf you installed the CLI globally using MacPorts (e.g.,\n`sudo port install gemini-cli`), use the `port uninstall` command to remove it.\n\n```bash\nsudo port uninstall gemini-cli\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":1999,"content_sha256":"e198497eb3b56afdcad779ff8346a02dfd1fbab86a53afb3c756a9634b4ef42f"},{"filename":"canonical/geminicli-com/docs/contributing.md","content":"---\nsource_url: http://geminicli.com/docs/contributing\nsource_type: llms-txt\ncontent_hash: sha256:7640940d4f4b093b5b8a78ba19f67ffe0e31db53dabeb34ef6128b2453a3a82f\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"aa81143f8e4b2ee9436581347348260ddeea87857b68eda9e188248ac35cae5e\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# How to contribute\n\nWe would love to accept your patches and contributions to this project. This\ndocument includes:\n\n- **[Before you begin](#before-you-begin):** Essential steps to take before\n becoming a Gemini CLI contributor.\n- **[Code contribution process](#code-contribution-process):** How to contribute\n code to Gemini CLI.\n- **[Development setup and workflow](#development-setup-and-workflow):** How to\n set up your development environment and workflow.\n- **[Documentation contribution process](#documentation-contribution-process):**\n How to contribute documentation to Gemini CLI.\n\nWe're looking forward to seeing your contributions!\n\n## Before you begin\n\n### Sign our Contributor License Agreement\n\nContributions to this project must be accompanied by a\n[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).\nYou (or your employer) retain the copyright to your contribution; this simply\ngives us permission to use and redistribute your contributions as part of the\nproject.\n\nIf you or your current employer have already signed the Google CLA (even if it\nwas for a different project), you probably don't need to do it again.\n\nVisit \u003chttps://cla.developers.google.com/> to see your current agreements or to\nsign a new one.\n\n### Review our Community Guidelines\n\nThis project follows\n[Google's Open Source Community Guidelines](https://opensource.google/conduct/).\n\n## Code contribution process\n\n### Get started\n\nThe process for contributing code is as follows:\n\n1. **Find an issue** that you want to work on. If an issue is tagged as\n `🔒Maintainers only`, this means it is reserved for project maintainers. We\n will not accept pull requests related to these issues. In the near future,\n we will explicitly mark issues looking for contributions using the\n `help-wanted` label. If you believe an issue is a good candidate for\n community contribution, please leave a comment on the issue. A maintainer\n will review it and apply the `help-wanted` label if appropriate. Only\n maintainers should attempt to add the `help-wanted` label to an issue.\n2. **Fork the repository** and create a new branch.\n3. **Make your changes** in the `packages/` directory.\n4. **Ensure all checks pass** by running `npm run preflight`.\n5. **Open a pull request** with your changes.\n\n### Code reviews\n\nAll submissions, including submissions by project members, require review. We\nuse [GitHub pull requests](https://docs.github.com/articles/about-pull-requests)\nfor this purpose.\n\nTo assist with the review process, we provide an automated review tool that\nhelps detect common anti-patterns, testing issues, and other best practices that\nare easy to miss.\n\n#### Using the automated review tool\n\nYou can run the review tool in two ways:\n\n1. **Using the helper script (Recommended):** We provide a script that\n automatically handles checking out the PR into a separate worktree,\n installing dependencies, building the project, and launching the review\n tool.\n\n ```bash\n ./scripts/review.sh \u003cPR_NUMBER> [model]\n ```\n\n **Warning:** If you run `scripts/review.sh`, you must have first verified\n that the code for the PR being reviewed is safe to run and does not contain\n data exfiltration attacks.\n\n **Authors are strongly encouraged to run this script on their own PRs**\n immediately after creation. This allows you to catch and fix simple issues\n locally before a maintainer performs a full review.\n\n **Note on Models:** By default, the script uses the latest Pro model\n (`gemini-3.1-pro-preview`). If you do not have enough Pro quota, you can run\n it with the latest Flash model instead:\n `./scripts/review.sh \u003cPR_NUMBER> gemini-3-flash-preview`.\n\n2. **Manually from within Gemini CLI:** If you already have the PR checked out\n and built, you can run the tool directly from the CLI prompt:\n\n ```text\n /review-frontend \u003cPR_NUMBER>\n ```\n\nReplace `\u003cPR_NUMBER>` with your pull request number. Reviewers should use this\ntool to augment, not replace, their manual review process.\n\n### Self-assigning and unassigning issues\n\nTo assign an issue to yourself, simply add a comment with the text `/assign`. To\nunassign yourself from an issue, add a comment with the text `/unassign`.\n\nThe comment must contain only that text and nothing else. These commands will\nassign or unassign the issue as requested, provided the conditions are met\n(e.g., an issue must be unassigned to be assigned).\n\nPlease note that you can have a maximum of 3 issues assigned to you at any given\ntime.\n\n### Pull request guidelines\n\nTo help us review and merge your PRs quickly, please follow these guidelines.\nPRs that do not meet these standards may be closed.\n\n#### 1. Link to an existing issue\n\nAll PRs should be linked to an existing issue in our tracker. This ensures that\nevery change has been discussed and is aligned with the project's goals before\nany code is written.\n\n- **For bug fixes:** The PR should be linked to the bug report issue.\n- **For features:** The PR should be linked to the feature request or proposal\n issue that has been approved by a maintainer.\n\nIf an issue for your change doesn't exist, we will automatically close your PR\nalong with a comment reminding you to associate the PR with an issue. The ideal\nworkflow starts with an issue that has been reviewed and approved by a\nmaintainer. Please **open the issue first** and wait for feedback before you\nstart coding.\n\n#### 2. Keep it small and focused\n\nWe favor small, atomic PRs that address a single issue or add a single,\nself-contained feature.\n\n- **Do:** Create a PR that fixes one specific bug or adds one specific feature.\n- **Don't:** Bundle multiple unrelated changes (e.g., a bug fix, a new feature,\n and a refactor) into a single PR.\n\nLarge changes should be broken down into a series of smaller, logical PRs that\ncan be reviewed and merged independently.\n\n#### 3. Use draft PRs for work in progress\n\nIf you'd like to get early feedback on your work, please use GitHub's **Draft\nPull Request** feature. This signals to the maintainers that the PR is not yet\nready for a formal review but is open for discussion and initial feedback.\n\n#### 4. Ensure all checks pass\n\nBefore submitting your PR, ensure that all automated checks are passing by\nrunning `npm run preflight`. This command runs all tests, linting, and other\nstyle checks.\n\n#### 5. Update documentation\n\nIf your PR introduces a user-facing change (e.g., a new command, a modified\nflag, or a change in behavior), you must also update the relevant documentation\nin the `/docs` directory.\n\nSee more about writing documentation:\n[Documentation contribution process](#documentation-contribution-process).\n\n#### 6. Write clear commit messages and a good PR description\n\nYour PR should have a clear, descriptive title and a detailed description of the\nchanges. Follow the [Conventional Commits](https://www.conventionalcommits.org/)\nstandard for your commit messages.\n\n- **Good PR title:** `feat(cli): Add --json flag to 'config get' command`\n- **Bad PR title:** `Made some changes`\n\nIn the PR description, explain the \"why\" behind your changes and link to the\nrelevant issue (e.g., `Fixes #123`).\n\n### Forking\n\nIf you are forking the repository you will be able to run the Build, Test and\nIntegration test workflows. However in order to make the integration tests run\nyou'll need to add a\n[GitHub Repository Secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)\nwith a value of `GEMINI_API_KEY` and set that to a valid API key that you have\navailable. Your key and secret are private to your repo; no one without access\ncan see your key and you cannot see any secrets related to this repo.\n\nAdditionally you will need to click on the `Actions` tab and enable workflows\nfor your repository, you'll find it's the large blue button in the center of the\nscreen.\n\n### Development setup and workflow\n\nThis section guides contributors on how to build, modify, and understand the\ndevelopment setup of this project.\n\n### Setting up the development environment\n\n**Prerequisites:**\n\n1. **Node.js**:\n - **Development:** Please use Node.js `~20.19.0`. This specific version is\n required due to an upstream development dependency issue. You can use a\n tool like [nvm](https://github.com/nvm-sh/nvm) to manage Node.js versions.\n - **Production:** For running the CLI in a production environment, any\n version of Node.js `>=20` is acceptable.\n2. **Git**\n\n### Build process\n\nTo clone the repository:\n\n```bash\ngit clone https://github.com/google-gemini/gemini-cli.git # Or your fork's URL\ncd gemini-cli\n```\n\nTo install dependencies defined in `package.json` as well as root dependencies:\n\n```bash\nnpm install\n```\n\nTo build the entire project (all packages):\n\n```bash\nnpm run build\n```\n\nThis command typically compiles TypeScript to JavaScript, bundles assets, and\nprepares the packages for execution. Refer to `scripts/build.js` and\n`package.json` scripts for more details on what happens during the build.\n\n### Enabling sandboxing\n\n[Sandboxing](#sandboxing) is highly recommended and requires, at a minimum,\nsetting `GEMINI_SANDBOX=true` in your `~/.env` and ensuring a sandboxing\nprovider (e.g. `macOS Seatbelt`, `docker`, or `podman`) is available. See\n[Sandboxing](#sandboxing) for details.\n\nTo build both the `gemini` CLI utility and the sandbox container, run\n`build:all` from the root directory:\n\n```bash\nnpm run build:all\n```\n\nTo skip building the sandbox container, you can use `npm run build` instead.\n\n### Running the CLI\n\nTo start the Gemini CLI from the source code (after building), run the following\ncommand from the root directory:\n\n```bash\nnpm start\n```\n\nIf you'd like to run the source build outside of the gemini-cli folder, you can\nutilize `npm link path/to/gemini-cli/packages/cli` (see:\n[docs](https://docs.npmjs.com/cli/v9/commands/npm-link)) or\n`alias gemini=\"node path/to/gemini-cli/packages/cli\"` to run with `gemini`\n\n### Running tests\n\nThis project contains two types of tests: unit tests and integration tests.\n\n#### Unit tests\n\nTo execute the unit test suite for the project:\n\n```bash\nnpm run test\n```\n\nThis will run tests located in the `packages/core` and `packages/cli`\ndirectories. Ensure tests pass before submitting any changes. For a more\ncomprehensive check, it is recommended to run `npm run preflight`.\n\n#### Integration tests\n\nThe integration tests are designed to validate the end-to-end functionality of\nthe Gemini CLI. They are not run as part of the default `npm run test` command.\n\nTo run the integration tests, use the following command:\n\n```bash\nnpm run test:e2e\n```\n\nFor more detailed information on the integration testing framework, please see\nthe\n[Integration Tests documentation](https://geminicli.com/docs/integration-tests).\n\n### Linting and preflight checks\n\nTo ensure code quality and formatting consistency, run the preflight check:\n\n```bash\nnpm run preflight\n```\n\nThis command will run ESLint, Prettier, all tests, and other checks as defined\nin the project's `package.json`.\n\n_ProTip_\n\nafter cloning create a git precommit hook file to ensure your commits are always\nclean.\n\n```bash\necho \"\n# Run npm build and check for errors\nif ! npm run preflight; then\n echo \"npm build failed. Commit aborted.\"\n exit 1\nfi\n\" > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit\n```\n\n#### Formatting\n\nTo separately format the code in this project by running the following command\nfrom the root directory:\n\n```bash\nnpm run format\n```\n\nThis command uses Prettier to format the code according to the project's style\nguidelines.\n\n#### Linting\n\nTo separately lint the code in this project, run the following command from the\nroot directory:\n\n```bash\nnpm run lint\n```\n\n### Coding conventions\n\n- Please adhere to the coding style, patterns, and conventions used throughout\n the existing codebase.\n- Consult [GEMINI.md](https://github.com/google-gemini/gemini-cli/blob/main/GEMINI.md) (typically found in the project root) for\n specific instructions related to AI-assisted development, including\n conventions for React, comments, and Git usage.\n- **Imports:** Pay special attention to import paths. The project uses ESLint to\n enforce restrictions on relative imports between packages.\n\n### Debugging\n\n#### VS Code\n\n0. Run the CLI to interactively debug in VS Code with `F5`\n1. Start the CLI in debug mode from the root directory:\n ```bash\n npm run debug\n ```\n This command runs `node --inspect-brk dist/gemini.js` within the\n `packages/cli` directory, pausing execution until a debugger attaches. You\n can then open `chrome://inspect` in your Chrome browser to connect to the\n debugger.\n2. In VS Code, use the \"Attach\" launch configuration (found in\n `.vscode/launch.json`).\n\nAlternatively, you can use the \"Launch Program\" configuration in VS Code if you\nprefer to launch the currently open file directly, but 'F5' is generally\nrecommended.\n\nTo hit a breakpoint inside the sandbox container run:\n\n```bash\nDEBUG=1 gemini\n```\n\n**Note:** If you have `DEBUG=true` in a project's `.env` file, it won't affect\ngemini-cli due to automatic exclusion. Use `.gemini/.env` files for gemini-cli\nspecific debug settings.\n\n### React DevTools\n\nTo debug the CLI's React-based UI, you can use React DevTools.\n\n1. **Start the Gemini CLI in development mode:**\n\n ```bash\n DEV=true npm start\n ```\n\n2. **Install and run React DevTools version 6 (which matches the CLI's\n `react-devtools-core`):**\n\n You can either install it globally:\n\n ```bash\n npm install -g react-devtools@6\n react-devtools\n ```\n\n Or run it directly using npx:\n\n ```bash\n npx react-devtools@6\n ```\n\n Your running CLI application should then connect to React DevTools.\n ![](/docs/assets/connected_devtools.png)\n\n### Sandboxing\n\n#### macOS Seatbelt\n\nOn macOS, `gemini` uses Seatbelt (`sandbox-exec`) under a `permissive-open`\nprofile (see `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) that\nrestricts writes to the project folder but otherwise allows all other operations\nand outbound network traffic (\"open\") by default. You can switch to a\n`strict-open` profile (see\n`packages/cli/src/utils/sandbox-macos-strict-open.sb`) that restricts both reads\nand writes to the working directory while allowing outbound network traffic by\nsetting `SEATBELT_PROFILE=strict-open` in your environment or `.env` file.\nAvailable built-in profiles are `permissive-{open,proxied}`,\n`restrictive-{open,proxied}`, and `strict-{open,proxied}` (see below for proxied\nnetworking). You can also switch to a custom profile\n`SEATBELT_PROFILE=\u003cprofile>` if you also create a file\n`.gemini/sandbox-macos-\u003cprofile>.sb` under your project settings directory\n`.gemini`.\n\n#### Container-based sandboxing (all platforms)\n\nFor stronger container-based sandboxing on macOS or other platforms, you can set\n`GEMINI_SANDBOX=true|docker|podman|\u003ccommand>` in your environment or `.env`\nfile. The specified command (or if `true` then either `docker` or `podman`) must\nbe installed on the host machine. Once enabled, `npm run build:all` will build a\nminimal container (\"sandbox\") image and `npm start` will launch inside a fresh\ninstance of that container. The first build can take 20-30s (mostly due to\ndownloading of the base image) but after that both build and start overhead\nshould be minimal. Default builds (`npm run build`) will not rebuild the\nsandbox.\n\nContainer-based sandboxing mounts the project directory (and system temp\ndirectory) with read-write access and is started/stopped/removed automatically\nas you start/stop Gemini CLI. Files created within the sandbox should be\nautomatically mapped to your user/group on host machine. You can easily specify\nadditional mounts, ports, or environment variables by setting\n`SANDBOX_{MOUNTS,PORTS,ENV}` as needed. You can also fully customize the sandbox\nfor your projects by creating the files `.gemini/sandbox.Dockerfile` and/or\n`.gemini/sandbox.bashrc` under your project settings directory (`.gemini`) and\nrunning `gemini` with `BUILD_SANDBOX=1` to trigger building of your custom\nsandbox.\n\n#### Proxied networking\n\nAll sandboxing methods, including macOS Seatbelt using `*-proxied` profiles,\nsupport restricting outbound network traffic through a custom proxy server that\ncan be specified as `GEMINI_SANDBOX_PROXY_COMMAND=\u003ccommand>`, where `\u003ccommand>`\nmust start a proxy server that listens on `:::8877` for relevant requests. See\n`docs/examples/proxy-script.md` for a minimal proxy that only allows `HTTPS`\nconnections to `example.com:443` (e.g. `curl https://example.com`) and declines\nall other requests. The proxy is started and stopped automatically alongside the\nsandbox.\n\n### Manual publish\n\nWe publish an artifact for each commit to our internal registry. But if you need\nto manually cut a local build, then run the following commands:\n\n```\nnpm run clean\nnpm install\nnpm run auth\nnpm run prerelease:dev\nnpm publish --workspaces\n```\n\n## Documentation contribution process\n\nOur documentation must be kept up-to-date with our code contributions. We want\nour documentation to be clear, concise, and helpful to our users. We value:\n\n- **Clarity:** Use simple and direct language. Avoid jargon where possible.\n- **Accuracy:** Ensure all information is correct and up-to-date.\n- **Completeness:** Cover all aspects of a feature or topic.\n- **Examples:** Provide practical examples to help users understand how to use\n Gemini CLI.\n\n### Getting started\n\nThe process for contributing to the documentation is similar to contributing\ncode.\n\n1. **Fork the repository** and create a new branch.\n2. **Make your changes** in the `/docs` directory.\n3. **Preview your changes locally** in Markdown rendering.\n4. **Lint and format your changes.** Our preflight check includes linting and\n formatting for documentation files.\n ```bash\n npm run preflight\n ```\n5. **Open a pull request** with your changes.\n\n### Documentation structure\n\nOur documentation is organized using [sidebar.json](/docs/sidebar.json) as the\ntable of contents. When adding new documentation:\n\n1. Create your markdown file **in the appropriate directory** under `/docs`.\n2. Add an entry to `sidebar.json` in the relevant section.\n3. Ensure all internal links use relative paths and point to existing files.\n\n### Style guide\n\nWe follow the\n[Google Developer Documentation Style Guide](https://developers.google.com/style).\nPlease refer to it for guidance on writing style, tone, and formatting.\n\n#### Key style points\n\n- Use sentence case for headings.\n- Write in second person (\"you\") when addressing the reader.\n- Use present tense.\n- Keep paragraphs short and focused.\n- Use code blocks with appropriate language tags for syntax highlighting.\n- Include practical examples whenever possible.\n\n### Linting and formatting\n\nWe use `prettier` to enforce a consistent style across our documentation. The\n`npm run preflight` command will check for any linting issues.\n\nYou can also run the linter and formatter separately:\n\n- `npm run lint` - Check for linting issues\n- `npm run format` - Auto-format markdown files\n- `npm run lint:fix` - Auto-fix linting issues where possible\n\nPlease make sure your contributions are free of linting errors before submitting\na pull request.\n\n### Before you submit\n\nBefore submitting your documentation pull request, please:\n\n1. Run `npm run preflight` to ensure all checks pass.\n2. Review your changes for clarity and accuracy.\n3. Check that all links work correctly.\n4. Ensure any code examples are tested and functional.\n5. Sign the\n [Contributor License Agreement (CLA)](https://cla.developers.google.com/) if\n you haven't already.\n\n### Need help?\n\nIf you have questions about contributing documentation:\n\n- Check our [FAQ](https://geminicli.com/docs/resources/faq).\n- Review existing documentation for examples.\n- Open [an issue](https://github.com/google-gemini/gemini-cli/issues) to discuss\n your proposed changes.\n- Reach out to the maintainers.\n\nWe appreciate your contributions to making Gemini CLI documentation better!\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":20501,"content_sha256":"0dfbe6efed9a22a98a4b4fe577e515b68ff4608a43f4c82f3da161d2c563e513"},{"filename":"canonical/geminicli-com/docs/core.md","content":"---\nsource_url: http://geminicli.com/docs/core\nsource_type: llms-txt\ncontent_hash: sha256:2d4d5d17791b439cc60225a8877ee68e87a6af83216a55695bd52cf73810d899\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"9f2f80a90b3291c1d17bb6ea4ad357a7988a20441b2e7dd0ba71d7132915bdbd\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Gemini CLI core\n\nGemini CLI's core package (`packages/core`) is the backend portion of Gemini\nCLI, handling communication with the Gemini API, managing tools, and processing\nrequests sent from `packages/cli`. For a general overview of Gemini CLI, see the\n[main documentation page](/docs).\n\n## Navigating this section\n\n- **[Sub-agents (experimental)](/docs/core/subagents):** Learn how to create and use\n specialized sub-agents for complex tasks.\n- **[Core tools reference](/docs/reference/tools):** Information on how tools\n are defined, registered, and used by the core.\n- **[Memory Import Processor](/docs/reference/memport):** Documentation for the\n modular GEMINI.md import feature using @file.md syntax.\n- **[Policy Engine](/docs/reference/policy-engine):** Use the Policy Engine for\n fine-grained control over tool execution.\n- **[Local Model Routing (experimental)](/docs/core/local-model-routing):** Learn how\n to enable use of a local Gemma model for model routing decisions.\n\n## Role of the core\n\nWhile the `packages/cli` portion of Gemini CLI provides the user interface,\n`packages/core` is responsible for:\n\n- **Gemini API interaction:** Securely communicating with the Google Gemini API,\n sending user prompts, and receiving model responses.\n- **Prompt engineering:** Constructing effective prompts for the Gemini model,\n potentially incorporating conversation history, tool definitions, and\n instructional context from `GEMINI.md` files.\n- **Tool management & orchestration:**\n - Registering available tools (e.g., file system tools, shell command\n execution).\n - Interpreting tool use requests from the Gemini model.\n - Executing the requested tools with the provided arguments.\n - Returning tool execution results to the Gemini model for further processing.\n- **Session and state management:** Keeping track of the conversation state,\n including history and any relevant context required for coherent interactions.\n- **Configuration:** Managing core-specific configurations, such as API key\n access, model selection, and tool settings.\n\n## Security considerations\n\nThe core plays a vital role in security:\n\n- **API key management:** It handles the `GEMINI_API_KEY` and ensures it's used\n securely when communicating with the Gemini API.\n- **Tool execution:** When tools interact with the local system (e.g.,\n `run_shell_command`), the core (and its underlying tool implementations) must\n do so with appropriate caution, often involving sandboxing mechanisms to\n prevent unintended modifications.\n\n## Chat history compression\n\nTo ensure that long conversations don't exceed the token limits of the Gemini\nmodel, the core includes a chat history compression feature.\n\nWhen a conversation approaches the token limit for the configured model, the\ncore automatically compresses the conversation history before sending it to the\nmodel. This compression is designed to be lossless in terms of the information\nconveyed, but it reduces the overall number of tokens used.\n\nYou can find the token limits for each model in the\n[Google AI documentation](https://ai.google.dev/gemini-api/docs/models).\n\n## Model fallback\n\nGemini CLI includes a model fallback mechanism to ensure that you can continue\nto use the CLI even if the default \"pro\" model is rate-limited.\n\nIf you are using the default \"pro\" model and the CLI detects that you are being\nrate-limited, it automatically switches to the \"flash\" model for the current\nsession. This allows you to continue working without interruption.\n\nInternal utility calls that use `gemini-2.5-flash-lite` (for example, prompt\ncompletion and classification) silently fall back to `gemini-2.5-flash` and\n`gemini-2.5-pro` when quota is exhausted, without changing the configured model.\n\n## File discovery service\n\nThe file discovery service is responsible for finding files in the project that\nare relevant to the current context. It is used by the `@` command and other\ntools that need to access files.\n\n## Memory discovery service\n\nThe memory discovery service is responsible for finding and loading the\n`GEMINI.md` files that provide context to the model. It searches for these files\nin a hierarchical manner, starting from the current working directory and moving\nup to the project root and the user's home directory. It also searches in\nsubdirectories.\n\nThis allows you to have global, project-level, and component-level context\nfiles, which are all combined to provide the model with the most relevant\ninformation.\n\nYou can use the [`/memory` command](/docs/reference/commands) to `show`, `add`,\nand `refresh` the content of loaded `GEMINI.md` files.\n\n## Citations\n\nWhen Gemini finds it is reciting text from a source it appends the citation to\nthe output. It is enabled by default but can be disabled with the\nui.showCitations setting.\n\n- When proposing an edit the citations display before giving the user the option\n to accept.\n- Citations are always shown at the end of the model’s turn.\n- We deduplicate citations and display them in alphabetical order.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":5372,"content_sha256":"1b0eefaed2bf09481faeec782a73bc4b190eaf79ba02c42d286cb53b99c43e86"},{"filename":"canonical/geminicli-com/docs/core/local-model-routing.md","content":"---\nsource_url: http://geminicli.com/docs/core/local-model-routing\nsource_type: llms-txt\ncontent_hash: sha256:492e0b28cf8a26892cf7620ff886c0a0f6b7b867be557a000d76e6103a50f2bd\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"f3c1c1fefe8cd4a8ab4bae5b50f6ddf7a7bc0991c63a2d84fe5e79e5e11e0423\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Local Model Routing (experimental)\n\nGemini CLI supports using a local model for\n[routing decisions](/docs/cli/model-routing). When configured, Gemini CLI will\nuse a locally-running **Gemma** model to make routing decisions (instead of\nsending routing decisions to a hosted model).\n\nThis feature can help reduce costs associated with hosted model usage while\noffering similar routing decision latency and quality.\n\n> **Note: Local model routing is currently an experimental feature.**\n\n## Setup\n\nUsing a Gemma model for routing decisions requires that an implementation of a\nGemma model be running locally on your machine, served behind an HTTP endpoint\nand accessed via the Gemini API.\n\nTo serve the Gemma model, follow these steps:\n\n### Download the LiteRT-LM runtime\n\nThe [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM) runtime offers\npre-built binaries for locally-serving models. Download the binary appropriate\nfor your system.\n\n#### Windows\n\n1. Download\n [lit.windows_x86_64.exe](https://github.com/google-ai-edge/LiteRT-LM/releases/download/v0.9.0-alpha03/lit.windows_x86_64.exe).\n2. Using GPU on Windows requires the DirectXShaderCompiler. Download the\n [dxc zip from the latest release](https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.8.2505.1/dxc_2025_07_14.zip).\n Unzip the archive and from the architecture-appropriate `bin\\` directory, and\n copy the `dxil.dll` and `dxcompiler.dll` into the same location as you saved\n `lit.windows_x86_64.exe`.\n3. (Optional) Test starting the runtime:\n `.\\lit.windows_x86_64.exe serve --verbose`\n\n#### Linux\n\n1. Download\n [lit.linux_x86_64](https://github.com/google-ai-edge/LiteRT-LM/releases/download/v0.9.0-alpha03/lit.linux_x86_64).\n2. Ensure the binary is executable: `chmod a+x lit.linux_x86_64`\n3. (Optional) Test starting the runtime: `./lit.linux_x86_64 serve --verbose`\n\n#### MacOS\n\n1. Download\n [lit-macos-arm64](https://github.com/google-ai-edge/LiteRT-LM/releases/download/v0.9.0-alpha03/lit.macos_arm64).\n2. Ensure the binary is executable: `chmod a+x lit.macos_arm64`\n3. (Optional) Test starting the runtime: `./lit.macos_arm64 serve --verbose`\n\n> **Note**: MacOS can be configured to only allows binaries from \"App Store &\n> Known Developers\". If you encounter an error message when attempting to run\n> the binary, you will need to allow the application. One option is to visit\n> `System Settings -> Privacy & Security`, scroll to `Security`, and click\n> `\"Allow Anyway\"` for `\"lit.macos_arm64\"`. Another option is to run\n> `xattr -d com.apple.quarantine lit.macos_arm64` from the commandline.\n\n### Download the Gemma Model\n\nBefore using Gemma, you will need to download the model (and agree to the Terms\nof Service).\n\nThis can be done via the LiteRT-LM runtime.\n\n#### Windows\n\n```bash\n$ .\\lit.windows_x86_64.exe pull gemma3-1b-gpu-custom\n\n[Legal] The model you are about to download is governed by\nthe Gemma Terms of Use and Prohibited Use Policy. Please review these terms and ensure you agree before continuing.\n\nFull Terms: https://ai.google.dev/gemma/terms\nProhibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy\n\nDo you accept these terms? (Y/N): Y\n\nTerms accepted.\nDownloading model 'gemma3-1b-gpu-custom' ...\nDownloading... 968.6 MB\nDownload complete.\n```\n\n#### Linux\n\n```bash\n$ ./lit.linux_x86_64 pull gemma3-1b-gpu-custom\n\n[Legal] The model you are about to download is governed by\nthe Gemma Terms of Use and Prohibited Use Policy. Please review these terms and ensure you agree before continuing.\n\nFull Terms: https://ai.google.dev/gemma/terms\nProhibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy\n\nDo you accept these terms? (Y/N): Y\n\nTerms accepted.\nDownloading model 'gemma3-1b-gpu-custom' ...\nDownloading... 968.6 MB\nDownload complete.\n```\n\n#### MacOS\n\n```bash\n$ ./lit.lit.macos_arm64 pull gemma3-1b-gpu-custom\n\n[Legal] The model you are about to download is governed by\nthe Gemma Terms of Use and Prohibited Use Policy. Please review these terms and ensure you agree before continuing.\n\nFull Terms: https://ai.google.dev/gemma/terms\nProhibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy\n\nDo you accept these terms? (Y/N): Y\n\nTerms accepted.\nDownloading model 'gemma3-1b-gpu-custom' ...\nDownloading... 968.6 MB\nDownload complete.\n```\n\n### Start LiteRT-LM Runtime\n\nUsing the command appropriate to your system, start the LiteRT-LM runtime.\nConfigure the port that you want to use for your Gemma model. For the purposes\nof this document, we will use port `9379`.\n\nExample command for MacOS: `./lit.macos_arm64 serve --port=9379 --verbose`\n\n### (Optional) Verify Model Serving\n\nSend a quick prompt to the model via HTTP to validate successful model serving.\nThis will cause the runtime to download the model and run it once.\n\nYou should see a short joke in the server output as an indicator of success.\n\n#### Windows\n\n```\n# Run this in PowerShell to send a request to the server\n\n$uri = \"http://localhost:9379/v1beta/models/gemma3-1b-gpu-custom:generateContent\"\n$body = @{contents = @( @{\n role = \"user\"\n parts = @( @{ text = \"Tell me a joke.\" } )\n})} | ConvertTo-Json -Depth 10\n\nInvoke-RestMethod -Uri $uri -Method Post -Body $body -ContentType \"application/json\"\n```\n\n#### Linux/MacOS\n\n```bash\n$ curl \"http://localhost:9379/v1beta/models/gemma3-1b-gpu-custom:generateContent\" \\\n -H 'Content-Type: application/json' \\\n -X POST \\\n -d '{\"contents\":[{\"role\":\"user\",\"parts\":[{\"text\":\"Tell me a joke.\"}]}]}'\n```\n\n## Configuration\n\nTo use a local Gemma model for routing, you must explicitly enable it in your\n`settings.json`:\n\n```json\n{\n \"experimental\": {\n \"gemmaModelRouter\": {\n \"enabled\": true,\n \"classifier\": {\n \"host\": \"http://localhost:9379\",\n \"model\": \"gemma3-1b-gpu-custom\"\n }\n }\n }\n}\n```\n\n> Use the port you started your LiteRT-LM runtime on in the setup steps.\n\n### Configuration schema\n\n| Field | Type | Required | Description |\n| :----------------- | :------ | :------- | :----------------------------------------------------------------------------------------- |\n| `enabled` | boolean | Yes | Must be `true` to enable the feature. |\n| `classifier` | object | Yes | The configuration for the local model endpoint. It includes the host and model specifiers. |\n| `classifier.host` | string | Yes | The URL to the local model server. Should be `http://localhost:\u003cport>`. |\n| `classifier.model` | string | Yes | The model name to use for decisions. Must be `\"gemma3-1b-gpu-custom\"`. |\n\n> **Note: You will need to restart after configuration changes for local model\n> routing to take effect.**\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7206,"content_sha256":"42e017b1416e305cc34b8d441bdb652124d54338ec7c1af84c6eeeadbe2af3e2"},{"filename":"canonical/geminicli-com/docs/core/memport.md","content":"---\nsource_url: https://geminicli.com/docs/core/memport\nsource_type: llms-txt\ncontent_hash: sha256:d090fa9a2bd8a1f539672670bd93d8e40237c5b47eca1557fd1191c4d4d33234\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"651675f386681a050042d3cfd7837579150815ab5f9e93067c3154a5aa4dfe2a\"'\nlast_modified: '2026-01-16T14:05:24Z'\n---\n\n# Memory Import Processor\n\nThe Memory Import Processor is a feature that allows you to modularize your\nGEMINI.md files by importing content from other files using the `@file.md`\nsyntax.\n\n## Overview\n\nThis feature enables you to break down large GEMINI.md files into smaller, more\nmanageable components that can be reused across different contexts. The import\nprocessor supports both relative and absolute paths, with built-in safety\nfeatures to prevent circular imports and ensure file access security.\n\n## Syntax\n\nUse the `@` symbol followed by the path to the file you want to import:\n\n```markdown\n# Main GEMINI.md file\n\nThis is the main content.\n\n@./components/instructions.md\n\nMore content here.\n\n@./shared/configuration.md\n```\n\n## Supported path formats\n\n### Relative paths\n\n- `@./file.md` - Import from the same directory\n- `@../file.md` - Import from parent directory\n- `@./components/file.md` - Import from subdirectory\n\n### Absolute paths\n\n- `@/absolute/path/to/file.md` - Import using absolute path\n\n## Examples\n\n### Basic import\n\n```markdown\n# My GEMINI.md\n\nWelcome to my project!\n\n@./get-started.md\n\n## Features\n\n@./features/overview.md\n```\n\n### Nested imports\n\nThe imported files can themselves contain imports, creating a nested structure:\n\n```markdown\n# main.md\n\n@./header.md @./content.md @./footer.md\n```\n\n```markdown\n# header.md\n\n# Project Header\n\n@./shared/title.md\n```\n\n## Safety features\n\n### Circular import detection\n\nThe processor automatically detects and prevents circular imports:\n\n```markdown\n# file-a.md\n\n@./file-b.md\n```\n\n```markdown\n# file-b.md\n\n@./file-a.md \u003c!-- This will be detected and prevented -->\n```\n\n### File access security\n\nThe `validateImportPath` function ensures that imports are only allowed from\nspecified directories, preventing access to sensitive files outside the allowed\nscope.\n\n### Maximum import depth\n\nTo prevent infinite recursion, there's a configurable maximum import depth\n(default: 5 levels).\n\n## Error handling\n\n### Missing files\n\nIf a referenced file doesn't exist, the import will fail gracefully with an\nerror comment in the output.\n\n### File access errors\n\nPermission issues or other file system errors are handled gracefully with\nappropriate error messages.\n\n## Code region detection\n\nThe import processor uses the `marked` library to detect code blocks and inline\ncode spans, ensuring that `@` imports inside these regions are properly ignored.\nThis provides robust handling of nested code blocks and complex Markdown\nstructures.\n\n## Import tree structure\n\nThe processor returns an import tree that shows the hierarchy of imported files,\nsimilar to Claude's `/memory` feature. This helps users debug problems with\ntheir GEMINI.md files by showing which files were read and their import\nrelationships.\n\nExample tree structure:\n\n```\nMemory Files\n L project: GEMINI.md\n L a.md\n L b.md\n L c.md\n L d.md\n L e.md\n L f.md\n L included.md\n```\n\nThe tree preserves the order that files were imported and shows the complete\nimport chain for debugging purposes.\n\n## Comparison to Claude Code's `/memory` (`claude.md`) approach\n\nClaude Code's `/memory` feature (as seen in `claude.md`) produces a flat, linear\ndocument by concatenating all included files, always marking file boundaries\nwith clear comments and path names. It does not explicitly present the import\nhierarchy, but the LLM receives all file contents and paths, which is sufficient\nfor reconstructing the hierarchy if needed.\n\n> [!NOTE] The import tree is mainly for clarity during development and has\n> limited relevance to LLM consumption.\n\n## API reference\n\n### `processImports(content, basePath, debugMode?, importState?)`\n\nProcesses import statements in GEMINI.md content.\n\n**Parameters:**\n\n- `content` (string): The content to process for imports\n- `basePath` (string): The directory path where the current file is located\n- `debugMode` (boolean, optional): Whether to enable debug logging (default:\n false)\n- `importState` (ImportState, optional): State tracking for circular import\n prevention\n\n**Returns:** Promise<ProcessImportsResult> - Object containing processed\ncontent and import tree\n\n### `ProcessImportsResult`\n\n```typescript\ninterface ProcessImportsResult {\n content: string; // The processed content with imports resolved\n importTree: MemoryFile; // Tree structure showing the import hierarchy\n}\n```\n\n### `MemoryFile`\n\n```typescript\ninterface MemoryFile {\n path: string; // The file path\n imports?: MemoryFile[]; // Direct imports, in the order they were imported\n}\n```\n\n### `validateImportPath(importPath, basePath, allowedDirectories)`\n\nValidates import paths to ensure they are safe and within allowed directories.\n\n**Parameters:**\n\n- `importPath` (string): The import path to validate\n- `basePath` (string): The base directory for resolving relative paths\n- `allowedDirectories` (string[]): Array of allowed directory paths\n\n**Returns:** boolean - Whether the import path is valid\n\n### `findProjectRoot(startDir)`\n\nFinds the project root by searching for a `.git` directory upwards from the\ngiven start directory. Implemented as an **async** function using non-blocking\nfile system APIs to avoid blocking the Node.js event loop.\n\n**Parameters:**\n\n- `startDir` (string): The directory to start searching from\n\n**Returns:** Promise<string> - The project root directory (or the start\ndirectory if no `.git` is found)\n\n## Best Practices\n\n1. **Use descriptive file names** for imported components\n2. **Keep imports shallow** - avoid deeply nested import chains\n3. **Document your structure** - maintain a clear hierarchy of imported files\n4. **Test your imports** - ensure all referenced files exist and are accessible\n5. **Use relative paths** when possible for better portability\n\n## Troubleshooting\n\n### Common issues\n\n1. **Import not working**: Check that the file exists and the path is correct\n2. **Circular import warnings**: Review your import structure for circular\n references\n3. **Permission errors**: Ensure the files are readable and within allowed\n directories\n4. **Path resolution issues**: Use absolute paths if relative paths aren't\n resolving correctly\n\n### Debug mode\n\nEnable debug mode to see detailed logging of the import process:\n\n```typescript\nconst result = await processImports(content, basePath, true);\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":6736,"content_sha256":"5bbb9f9d7b32d5329057f109c14f258b6ecdcbbd72e8bd5cc103e9208d2dba5c"},{"filename":"canonical/geminicli-com/docs/core/policy-engine.md","content":"---\nsource_url: https://geminicli.com/docs/core/policy-engine\nsource_type: llms-txt\ncontent_hash: sha256:091446e99fd261df2a8471b1f058a426d81d6a984cf76a84ec967fe1a865a919\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"56ae2f4f7b0a2b14935067c4ae0fd455c39b22fc78d5a877a738cd4941605e05\"'\nlast_modified: '2026-02-13T20:13:35Z'\n---\n\n# Policy engine\n\nThe Gemini CLI includes a powerful policy engine that provides fine-grained\ncontrol over tool execution. It allows users and administrators to define rules\nthat determine whether a tool call should be allowed, denied, or require user\nconfirmation.\n\n## Quick start\n\nTo create your first policy:\n\n1. **Create the policy directory** if it doesn't exist:\n ```bash\n mkdir -p ~/.gemini/policies\n ```\n2. **Create a new policy file** (e.g., `~/.gemini/policies/my-rules.toml`). You\n can use any filename ending in `.toml`; all such files in this directory\n will be loaded and combined:\n ```toml\n [[rule]]\n toolName = \"run_shell_command\"\n commandPrefix = \"git status\"\n decision = \"allow\"\n priority = 100\n ```\n3. **Run a command** that triggers the policy (e.g., ask Gemini CLI to\n `git status`). The tool will now execute automatically without prompting for\n confirmation.\n\n## Core concepts\n\nThe policy engine operates on a set of rules. Each rule is a combination of\nconditions and a resulting decision. When a large language model wants to\nexecute a tool, the policy engine evaluates all rules to find the\nhighest-priority rule that matches the tool call.\n\nA rule consists of the following main components:\n\n- **Conditions**: Criteria that a tool call must meet for the rule to apply.\n This can include the tool's name, the arguments provided to it, or the current\n approval mode.\n- **Decision**: The action to take if the rule matches (`allow`, `deny`, or\n `ask_user`).\n- **Priority**: A number that determines the rule's precedence. Higher numbers\n win.\n\nFor example, this rule will ask for user confirmation before executing any `git`\ncommand.\n\n```toml\n[[rule]]\ntoolName = \"run_shell_command\"\ncommandPrefix = \"git \"\ndecision = \"ask_user\"\npriority = 100\n```\n\n### Conditions\n\nConditions are the criteria that a tool call must meet for a rule to apply. The\nprimary conditions are the tool's name and its arguments.\n\n#### Tool Name\n\nThe `toolName` in the rule must match the name of the tool being called.\n\n- **Wildcards**: For Model-hosting-protocol (MCP) servers, you can use a\n wildcard. A `toolName` of `my-server__*` will match any tool from the\n `my-server` MCP.\n\n#### Arguments pattern\n\nIf `argsPattern` is specified, the tool's arguments are converted to a stable\nJSON string, which is then tested against the provided regular expression. If\nthe arguments don't match the pattern, the rule does not apply.\n\n### Decisions\n\nThere are three possible decisions a rule can enforce:\n\n- `allow`: The tool call is executed automatically without user interaction.\n- `deny`: The tool call is blocked and is not executed.\n- `ask_user`: The user is prompted to approve or deny the tool call. (In\n non-interactive mode, this is treated as `deny`.)\n\n### Priority system and tiers\n\nThe policy engine uses a sophisticated priority system to resolve conflicts when\nmultiple rules match a single tool call. The core principle is simple: **the\nrule with the highest priority wins**.\n\nTo provide a clear hierarchy, policies are organized into three tiers. Each tier\nhas a designated number that forms the base of the final priority calculation.\n\n| Tier | Base | Description |\n| :------ | :--- | :------------------------------------------------------------------------- |\n| Default | 1 | Built-in policies that ship with the Gemini CLI. |\n| User | 2 | Custom policies defined by the user. |\n| Admin | 3 | Policies managed by an administrator (e.g., in an enterprise environment). |\n\nWithin a TOML policy file, you assign a priority value from **0 to 999**. The\nengine transforms this into a final priority using the following formula:\n\n`final_priority = tier_base + (toml_priority / 1000)`\n\nThis system guarantees that:\n\n- Admin policies always override User and Default policies.\n- User policies always override Default policies.\n- You can still order rules within a single tier with fine-grained control.\n\nFor example:\n\n- A `priority: 50` rule in a Default policy file becomes `1.050`.\n- A `priority: 100` rule in a User policy file becomes `2.100`.\n- A `priority: 20` rule in an Admin policy file becomes `3.020`.\n\n### Approval modes\n\nApproval modes allow the policy engine to apply different sets of rules based on\nthe CLI's operational mode. A rule can be associated with one or more modes\n(e.g., `yolo`, `autoEdit`, `plan`). The rule will only be active if the CLI is\nrunning in one of its specified modes. If a rule has no modes specified, it is\nalways active.\n\n- `default`: The standard interactive mode where most write tools require\n confirmation.\n- `autoEdit`: Optimized for automated code editing; some write tools may be\n auto-approved.\n- `plan`: A strict, read-only mode for research and design. See [Customizing\n Plan Mode Policies].\n- `yolo`: A mode where all tools are auto-approved (use with extreme caution).\n\n## Rule matching\n\nWhen a tool call is made, the engine checks it against all active rules,\nstarting from the highest priority. The first rule that matches determines the\noutcome.\n\nA rule matches a tool call if all of its conditions are met:\n\n1. **Tool name**: The `toolName` in the rule must match the name of the tool\n being called.\n - **Wildcards**: For Model-hosting-protocol (MCP) servers, you can use a\n wildcard. A `toolName` of `my-server__*` will match any tool from the\n `my-server` MCP.\n2. **Arguments pattern**: If `argsPattern` is specified, the tool's arguments\n are converted to a stable JSON string, which is then tested against the\n provided regular expression. If the arguments don't match the pattern, the\n rule does not apply.\n\n## Configuration\n\nPolicies are defined in `.toml` files. The CLI loads these files from Default,\nUser, and (if configured) Admin directories.\n\n### Policy locations\n\n| Tier | Type | Location |\n| :-------- | :----- | :-------------------------- |\n| **User** | Custom | `~/.gemini/policies/*.toml` |\n| **Admin** | System | _See below (OS specific)_ |\n\n#### System-wide policies (Admin)\n\nAdministrators can enforce system-wide policies (Tier 3) that override all user\nand default settings. These policies must be placed in specific, secure\ndirectories:\n\n| OS | Policy Directory Path |\n| :---------- | :------------------------------------------------ |\n| **Linux** | `/etc/gemini-cli/policies` |\n| **macOS** | `/Library/Application Support/GeminiCli/policies` |\n| **Windows** | `C:\\ProgramData\\gemini-cli\\policies` |\n\n**Security Requirements:**\n\nTo prevent privilege escalation, the CLI enforces strict security checks on\nadmin directories. If checks fail, system policies are **ignored**.\n\n- **Linux / macOS:** Must be owned by `root` (UID 0) and NOT writable by group\n or others (e.g., `chmod 755`).\n- **Windows:** Must be in `C:\\ProgramData`. Standard users (`Users`, `Everyone`)\n must NOT have `Write`, `Modify`, or `Full Control` permissions. _Tip: If you\n see a security warning, use the folder properties to remove write permissions\n for non-admin groups. You may need to \"Disable inheritance\" in Advanced\n Security Settings._\n\n### TOML rule schema\n\nHere is a breakdown of the fields available in a TOML policy rule:\n\n```toml\n[[rule]]\n# A unique name for the tool, or an array of names.\ntoolName = \"run_shell_command\"\n\n# (Optional) The name of an MCP server. Can be combined with toolName\n# to form a composite name like \"mcpName__toolName\".\nmcpName = \"my-custom-server\"\n\n# (Optional) A regex to match against the tool's arguments.\nargsPattern = '\"command\":\"(git|npm)'\n\n# (Optional) A string or array of strings that a shell command must start with.\n# This is syntactic sugar for `toolName = \"run_shell_command\"` and an `argsPattern`.\ncommandPrefix = \"git \"\n\n# (Optional) A regex to match against the entire shell command.\n# This is also syntactic sugar for `toolName = \"run_shell_command\"`.\n# Note: This pattern is tested against the JSON representation of the arguments (e.g., `{\"command\":\"\u003cyour_command>\"}`).\n# Because it prepends `\"command\":\"`, it effectively matches from the start of the command.\n# Anchors like `^` or ` gemini-cli-docs — Skillopedia apply to the full JSON string, so `^` should usually be avoided here.\n# You cannot use commandPrefix and commandRegex in the same rule.\ncommandRegex = \"git (commit|push)\"\n\n# The decision to take. Must be \"allow\", \"deny\", or \"ask_user\".\ndecision = \"ask_user\"\n\n# The priority of the rule, from 0 to 999.\npriority = 10\n\n# (Optional) A custom message to display when a tool call is denied by this rule.\n# This message is returned to the model and user, useful for explaining *why* it was denied.\ndeny_message = \"Deletion is permanent\"\n\n# (Optional) An array of approval modes where this rule is active.\nmodes = [\"autoEdit\"]\n```\n\n### Using arrays (lists)\n\nTo apply the same rule to multiple tools or command prefixes, you can provide an\narray of strings for the `toolName` and `commandPrefix` fields.\n\n**Example:**\n\nThis single rule will apply to both the `write_file` and `replace` tools.\n\n```toml\n[[rule]]\ntoolName = [\"write_file\", \"replace\"]\ndecision = \"ask_user\"\npriority = 10\n```\n\n### Special syntax for `run_shell_command`\n\nTo simplify writing policies for `run_shell_command`, you can use\n`commandPrefix` or `commandRegex` instead of the more complex `argsPattern`.\n\n- `commandPrefix`: Matches if the `command` argument starts with the given\n string.\n- `commandRegex`: Matches if the `command` argument matches the given regular\n expression.\n\n**Example:**\n\nThis rule will ask for user confirmation before executing any `git` command.\n\n```toml\n[[rule]]\ntoolName = \"run_shell_command\"\ncommandPrefix = \"git \"\ndecision = \"ask_user\"\npriority = 100\n```\n\n### Special syntax for MCP tools\n\nYou can create rules that target tools from Model-hosting-protocol (MCP) servers\nusing the `mcpName` field or a wildcard pattern.\n\n**1. Using `mcpName`**\n\nTo target a specific tool from a specific server, combine `mcpName` and\n`toolName`.\n\n```toml\n# Allows the `search` tool on the `my-jira-server` MCP\n[[rule]]\nmcpName = \"my-jira-server\"\ntoolName = \"search\"\ndecision = \"allow\"\npriority = 200\n```\n\n**2. Using a wildcard**\n\nTo create a rule that applies to _all_ tools on a specific MCP server, specify\nonly the `mcpName`.\n\n```toml\n# Denies all tools from the `untrusted-server` MCP\n[[rule]]\nmcpName = \"untrusted-server\"\ndecision = \"deny\"\npriority = 500\ndeny_message = \"This server is not trusted by the admin.\"\n```\n\n## Default policies\n\nThe Gemini CLI ships with a set of default policies to provide a safe\nout-of-the-box experience.\n\n- **Read-only tools** (like `read_file`, `glob`) are generally **allowed**.\n- **Agent delegation** defaults to **`ask_user`** to ensure remote agents can\n prompt for confirmation, but local sub-agent actions are executed silently and\n checked individually.\n- **Write tools** (like `write_file`, `run_shell_command`) default to\n **`ask_user`**.\n- In **`yolo`** mode, a high-priority rule allows all tools.\n- In **`autoEdit`** mode, rules allow certain write operations to happen without\n prompting.\n\n[Customizing Plan Mode Policies]: /docs/cli/plan-mode.md#customizing-policies\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":11699,"content_sha256":"1fb59adb8670a521cab36935c5145fd0534283e741d84d974011d47e6f692c38"},{"filename":"canonical/geminicli-com/docs/core/remote-agents.md","content":"---\nsource_url: http://geminicli.com/docs/core/remote-agents\nsource_type: llms-txt\ncontent_hash: sha256:9d521056958b0b7a881ac65648d0d257e654fed6c392c413a17b0b7b0a918b89\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"1f584f670e7603aad8e21a4b63d4bc7e2e90c0619fb1438a429f3ac8a355cd47\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Remote Subagents (experimental)\n\nGemini CLI supports connecting to remote subagents using the Agent-to-Agent\n(A2A) protocol. This allows Gemini CLI to interact with other agents, expanding\nits capabilities by delegating tasks to remote services.\n\nGemini CLI can connect to any compliant A2A agent. You can find samples of A2A\nagents in the following repositories:\n\n- [ADK Samples (Python)](https://github.com/google/adk-samples/tree/main/python)\n- [ADK Python Contributing Samples](https://github.com/google/adk-python/tree/main/contributing/samples)\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> Remote subagents are currently an experimental feature.\n\n## Configuration\n\nTo use remote subagents, you must explicitly enable them in your\n`settings.json`:\n\n```json\n{\n \"experimental\": {\n \"enableAgents\": true\n }\n}\n```\n\n## Proxy support\n\nGemini CLI routes traffic to remote agents through an HTTP/HTTPS proxy if one is\nconfigured. It uses the `general.proxy` setting in your `settings.json` file or\nstandard environment variables (`HTTP_PROXY`, `HTTPS_PROXY`).\n\n```json\n{\n \"general\": {\n \"proxy\": \"http://my-proxy:8080\"\n }\n}\n```\n\n## Defining remote subagents\n\nRemote subagents are defined as Markdown files (`.md`) with YAML frontmatter.\nYou can place them in:\n\n1. **Project-level:** `.gemini/agents/*.md` (Shared with your team)\n2. **User-level:** `~/.gemini/agents/*.md` (Personal agents)\n\n### Configuration schema\n\n| Field | Type | Required | Description |\n| :--------------- | :----- | :------- | :------------------------------------------------------------------------------------------------------------- |\n| `kind` | string | Yes | Must be `remote`. |\n| `name` | string | Yes | A unique name for the agent. Must be a valid slug (lowercase letters, numbers, hyphens, and underscores only). |\n| `agent_card_url` | string | Yes | The URL to the agent's A2A card endpoint. |\n| `auth` | object | No | Authentication configuration. See [Authentication](#authentication). |\n\n### Single-subagent example\n\n```markdown\n---\nkind: remote\nname: my-remote-agent\nagent_card_url: https://example.com/agent-card\n---\n```\n\n### Multi-subagent example\n\nThe loader explicitly supports multiple remote subagents defined in a single\nMarkdown file.\n\n```markdown\n---\n- kind: remote\n name: remote-1\n agent_card_url: https://example.com/1\n- kind: remote\n name: remote-2\n agent_card_url: https://example.com/2\n---\n```\n\n\u003c!-- prettier-ignore -->\n> [!NOTE] Mixed local and remote agents, or multiple local agents, are not\n> supported in a single file; the list format is currently remote-only.\n\n## Authentication\n\nMany remote agents require authentication. Gemini CLI supports several\nauthentication methods aligned with the\n[A2A security specification](https://a2a-protocol.org/latest/specification/#451-securityscheme).\nAdd an `auth` block to your agent's frontmatter to configure credentials.\n\n### Supported auth types\n\nGemini CLI supports the following authentication types:\n\n| Type | Description |\n| :------------------- | :--------------------------------------------------------------------------------------------- |\n| `apiKey` | Send a static API key as an HTTP header. |\n| `http` | HTTP authentication (Bearer token, Basic credentials, or any IANA-registered scheme). |\n| `google-credentials` | Google Application Default Credentials (ADC). Automatically selects access or identity tokens. |\n| `oauth2` | OAuth 2.0 Authorization Code flow with PKCE. Opens a browser for interactive sign-in. |\n\n### Dynamic values\n\nFor `apiKey` and `http` auth types, secret values (`key`, `token`, `username`,\n`password`, `value`) support dynamic resolution:\n\n| Format | Description | Example |\n| :---------- | :-------------------------------------------------- | :------------------------- |\n| `$ENV_VAR` | Read from an environment variable. | `$MY_API_KEY` |\n| `!command` | Execute a shell command and use the trimmed output. | `!gcloud auth print-token` |\n| literal | Use the string as-is. | `sk-abc123` |\n| `$` / `!!` | Escape prefix. `$FOO` becomes the literal `$FOO`. | `$NOT_AN_ENV_VAR` |\n\n> **Security tip:** Prefer `$ENV_VAR` or `!command` over embedding secrets\n> directly in agent files, especially for project-level agents checked into\n> version control.\n\n### API key (`apiKey`)\n\nSends an API key as an HTTP header on every request.\n\n| Field | Type | Required | Description |\n| :----- | :----- | :------- | :---------------------------------------------------- |\n| `type` | string | Yes | Must be `apiKey`. |\n| `key` | string | Yes | The API key value. Supports dynamic values. |\n| `name` | string | No | Header name to send the key in. Default: `X-API-Key`. |\n\n```yaml\n---\nkind: remote\nname: my-agent\nagent_card_url: https://example.com/agent-card\nauth:\n type: apiKey\n key: $MY_API_KEY\n---\n```\n\n### HTTP authentication (`http`)\n\nSupports Bearer tokens, Basic auth, and arbitrary IANA-registered HTTP\nauthentication schemes.\n\n#### Bearer token\n\nUse the following fields to configure a Bearer token:\n\n| Field | Type | Required | Description |\n| :------- | :----- | :------- | :----------------------------------------- |\n| `type` | string | Yes | Must be `http`. |\n| `scheme` | string | Yes | Must be `Bearer`. |\n| `token` | string | Yes | The bearer token. Supports dynamic values. |\n\n```yaml\nauth:\n type: http\n scheme: Bearer\n token: $MY_BEARER_TOKEN\n```\n\n#### Basic authentication\n\nUse the following fields to configure Basic authentication:\n\n| Field | Type | Required | Description |\n| :--------- | :----- | :------- | :------------------------------------- |\n| `type` | string | Yes | Must be `http`. |\n| `scheme` | string | Yes | Must be `Basic`. |\n| `username` | string | Yes | The username. Supports dynamic values. |\n| `password` | string | Yes | The password. Supports dynamic values. |\n\n```yaml\nauth:\n type: http\n scheme: Basic\n username: $MY_USERNAME\n password: $MY_PASSWORD\n```\n\n#### Raw scheme\n\nFor any other IANA-registered scheme (for example, Digest, HOBA), provide the\nraw authorization value.\n\n| Field | Type | Required | Description |\n| :------- | :----- | :------- | :---------------------------------------------------------------------------- |\n| `type` | string | Yes | Must be `http`. |\n| `scheme` | string | Yes | The scheme name (for example, `Digest`). |\n| `value` | string | Yes | Raw value sent as `Authorization: \u003cscheme> \u003cvalue>`. Supports dynamic values. |\n\n```yaml\nauth:\n type: http\n scheme: Digest\n value: $MY_DIGEST_VALUE\n```\n\n### Google Application Default Credentials (`google-credentials`)\n\nUses\n[Google Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials)\nto authenticate with Google Cloud services and Cloud Run endpoints. This is the\nrecommended auth method for agents hosted on Google Cloud infrastructure.\n\n| Field | Type | Required | Description |\n| :------- | :------- | :------- | :-------------------------------------------------------------------------- |\n| `type` | string | Yes | Must be `google-credentials`. |\n| `scopes` | string[] | No | OAuth scopes. Defaults to `https://www.googleapis.com/auth/cloud-platform`. |\n\n```yaml\n---\nkind: remote\nname: my-gcp-agent\nagent_card_url: https://my-agent-xyz.run.app/.well-known/agent.json\nauth:\n type: google-credentials\n---\n```\n\n#### How token selection works\n\nThe provider automatically selects the correct token type based on the agent's\nhost:\n\n| Host pattern | Token type | Use case |\n| :----------------- | :----------------- | :------------------------------------------ |\n| `*.googleapis.com` | **Access token** | Google APIs (Agent Engine, Vertex AI, etc.) |\n| `*.run.app` | **Identity token** | Cloud Run services |\n\n- **Access tokens** authorize API calls to Google services. They are scoped\n (default: `cloud-platform`) and fetched via `GoogleAuth.getClient()`.\n- **Identity tokens** prove the caller's identity to a service that validates\n the token's audience. The audience is set to the target host. These are\n fetched via `GoogleAuth.getIdTokenClient()`.\n\nBoth token types are cached and automatically refreshed before expiry.\n\n#### Setup\n\n`google-credentials` relies on ADC, which means your environment must have\ncredentials configured. Common setups:\n\n- **Local development:** Run `gcloud auth application-default login` to\n authenticate with your Google account.\n- **CI / Cloud environments:** Use a service account. Set the\n `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of your\n service account key file, or use workload identity on GKE / Cloud Run.\n\n#### Allowed hosts\n\nFor security, `google-credentials` only sends tokens to known Google-owned\nhosts:\n\n- `*.googleapis.com`\n- `*.run.app`\n\nRequests to any other host will be rejected with an error. If your agent is\nhosted on a different domain, use one of the other auth types (`apiKey`, `http`,\nor `oauth2`).\n\n#### Examples\n\nThe following examples demonstrate how to configure Google Application Default\nCredentials.\n\n**Cloud Run agent:**\n\n```yaml\n---\nkind: remote\nname: cloud-run-agent\nagent_card_url: https://my-agent-xyz.run.app/.well-known/agent.json\nauth:\n type: google-credentials\n---\n```\n\n**Google API with custom scopes:**\n\n```yaml\n---\nkind: remote\nname: vertex-agent\nagent_card_url: https://us-central1-aiplatform.googleapis.com/.well-known/agent.json\nauth:\n type: google-credentials\n scopes:\n - https://www.googleapis.com/auth/cloud-platform\n - https://www.googleapis.com/auth/compute\n---\n```\n\n### OAuth 2.0 (`oauth2`)\n\nPerforms an interactive OAuth 2.0 Authorization Code flow with PKCE. On first\nuse, Gemini CLI opens your browser for sign-in and persists the resulting tokens\nfor subsequent requests.\n\n| Field | Type | Required | Description |\n| :------------------ | :------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `type` | string | Yes | Must be `oauth2`. |\n| `client_id` | string | Yes\\* | OAuth client ID. Required for interactive auth. |\n| `client_secret` | string | No\\* | OAuth client secret. Required by most authorization servers (confidential clients). Can be omitted for public clients that don't require a secret. |\n| `scopes` | string[] | No | Requested scopes. Can also be discovered from the agent card. |\n| `authorization_url` | string | No | Authorization endpoint. Discovered from the agent card if omitted. |\n| `token_url` | string | No | Token endpoint. Discovered from the agent card if omitted. |\n\n```yaml\n---\nkind: remote\nname: oauth-agent\nagent_card_url: https://example.com/.well-known/agent.json\nauth:\n type: oauth2\n client_id: my-client-id.apps.example.com\n---\n```\n\nIf the agent card advertises an `oauth2` security scheme with\n`authorizationCode` flow, the `authorization_url`, `token_url`, and `scopes` are\nautomatically discovered. You only need to provide `client_id` (and\n`client_secret` if required).\n\nTokens are persisted to disk and refreshed automatically when they expire.\n\n### Auth validation\n\nWhen Gemini CLI loads a remote agent, it validates your auth configuration\nagainst the agent card's declared `securitySchemes`. If the agent requires\nauthentication that you haven't configured, you'll see an error describing\nwhat's needed.\n\n`google-credentials` is treated as compatible with `http` Bearer security\nschemes, since it produces Bearer tokens.\n\n### Auth retry behavior\n\nAll auth providers automatically retry on `401` and `403` responses by\nre-fetching credentials (up to 2 retries). This handles cases like expired\ntokens or rotated credentials. For `apiKey` with `!command` values, the command\nis re-executed on retry to fetch a fresh key.\n\n### Agent card fetching and auth\n\nWhen connecting to a remote agent, Gemini CLI first fetches the agent card\n**without** authentication. If the card endpoint returns a `401` or `403`, it\nretries the fetch **with** the configured auth headers. This lets agents have\npublicly accessible cards while protecting their task endpoints, or to protect\nboth behind auth.\n\n## Managing Subagents\n\nUsers can manage subagents using the following commands within the Gemini CLI:\n\n- `/agents list`: Displays all available local and remote subagents.\n- `/agents reload`: Reloads the agent registry. Use this after adding or\n modifying agent definition files.\n- `/agents enable \u003cagent_name>`: Enables a specific subagent.\n- `/agents disable \u003cagent_name>`: Disables a specific subagent.\n\n\u003c!-- prettier-ignore -->\n> [!TIP]\n> You can use the `@cli_help` agent within Gemini CLI for assistance\n> with configuring subagents.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":15125,"content_sha256":"71519f2a83ee3c8d55bf5606558accdcf201dd5cae43b4eb825cdf65004d1808"},{"filename":"canonical/geminicli-com/docs/core/subagents.md","content":"---\nsource_url: http://geminicli.com/docs/core/subagents\nsource_type: llms-txt\ncontent_hash: sha256:1439fb742be963e3239a52e7518d994742fc0b76e9381b244a3c01239532f43e\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"67211fdfb03b9a378d15170f6f827fe1a00350351b737f239680ad789af9f8f9\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Subagents (experimental)\n\nSubagents are specialized agents that operate within your main Gemini CLI\nsession. They are designed to handle specific, complex tasks—like deep codebase\nanalysis, documentation lookup, or domain-specific reasoning—without cluttering\nthe main agent's context or toolset.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> Subagents are currently an experimental feature.\n> \nTo use custom subagents, you must ensure they are enabled in your\n`settings.json` (enabled by default):\n\n```json\n{\n \"experimental\": { \"enableAgents\": true }\n}\n```\n\n## What are subagents?\n\nSubagents are \"specialists\" that the main Gemini agent can hire for a specific\njob.\n\n- **Focused context:** Each subagent has its own system prompt and persona.\n- **Specialized tools:** Subagents can have a restricted or specialized set of\n tools.\n- **Independent context window:** Interactions with a subagent happen in a\n separate context loop, which saves tokens in your main conversation history.\n\nSubagents are exposed to the main agent as a tool of the same name. When the\nmain agent calls the tool, it delegates the task to the subagent. Once the\nsubagent completes its task, it reports back to the main agent with its\nfindings.\n\n## How to use subagents\n\nYou can use subagents through automatic delegation or by explicitly forcing them\nin your prompt.\n\n### Automatic delegation\n\nGemini CLI's main agent is instructed to use specialized subagents when a task\nmatches their expertise. For example, if you ask \"How does the auth system\nwork?\", the main agent may decide to call the `codebase_investigator` subagent\nto perform the research.\n\n### Forcing a subagent (@ syntax)\n\nYou can explicitly direct a task to a specific subagent by using the `@` symbol\nfollowed by the subagent's name at the beginning of your prompt. This is useful\nwhen you want to bypass the main agent's decision-making and go straight to a\nspecialist.\n\n**Example:**\n\n```bash\n@codebase_investigator Map out the relationship between the AgentRegistry and the LocalAgentExecutor.\n```\n\nWhen you use the `@` syntax, the CLI injects a system note that nudges the\nprimary model to use that specific subagent tool immediately.\n\n## Built-in subagents\n\nGemini CLI comes with the following built-in subagents:\n\n### Codebase Investigator\n\n- **Name:** `codebase_investigator`\n- **Purpose:** Analyze the codebase, reverse engineer, and understand complex\n dependencies.\n- **When to use:** \"How does the authentication system work?\", \"Map out the\n dependencies of the `AgentRegistry` class.\"\n- **Configuration:** Enabled by default. You can override its settings in\n `settings.json` under `agents.overrides`. Example (forcing a specific model\n and increasing turns):\n ```json\n {\n \"agents\": {\n \"overrides\": {\n \"codebase_investigator\": {\n \"modelConfig\": { \"model\": \"gemini-3-flash-preview\" },\n \"runConfig\": { \"maxTurns\": 50 }\n }\n }\n }\n }\n ```\n\n### CLI Help Agent\n\n- **Name:** `cli_help`\n- **Purpose:** Get expert knowledge about Gemini CLI itself, its commands,\n configuration, and documentation.\n- **When to use:** \"How do I configure a proxy?\", \"What does the `/rewind`\n command do?\"\n- **Configuration:** Enabled by default.\n\n### Generalist Agent\n\n- **Name:** `generalist_agent`\n- **Purpose:** Route tasks to the appropriate specialized subagent.\n- **When to use:** Implicitly used by the main agent for routing. Not directly\n invoked by the user.\n- **Configuration:** Enabled by default. No specific configuration options.\n\n### Browser Agent (experimental)\n\n- **Name:** `browser_agent`\n- **Purpose:** Automate web browser tasks — navigating websites, filling forms,\n clicking buttons, and extracting information from web pages — using the\n accessibility tree.\n- **When to use:** \"Go to example.com and fill out the contact form,\" \"Extract\n the pricing table from this page,\" \"Click the login button and enter my\n credentials.\"\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> This is a preview feature currently under active development.\n\n#### Prerequisites\n\nThe browser agent requires:\n\n- **Chrome** version 144 or later (any recent stable release will work).\n- **Node.js** with `npx` available (used to launch the\n [`chrome-devtools-mcp`](https://www.npmjs.com/package/chrome-devtools-mcp)\n server).\n\n#### Enabling the browser agent\n\nThe browser agent is disabled by default. Enable it in your `settings.json`:\n\n```json\n{\n \"agents\": {\n \"overrides\": {\n \"browser_agent\": {\n \"enabled\": true\n }\n }\n }\n}\n```\n\n#### Session modes\n\nThe `sessionMode` setting controls how Chrome is launched and managed. Set it\nunder `agents.browser`:\n\n```json\n{\n \"agents\": {\n \"overrides\": {\n \"browser_agent\": {\n \"enabled\": true\n }\n },\n \"browser\": {\n \"sessionMode\": \"persistent\"\n }\n }\n}\n```\n\nThe available modes are:\n\n| Mode | Description |\n| :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `persistent` | **(Default)** Launches Chrome with a persistent profile stored at `~/.gemini/cli-browser-profile/`. Cookies, history, and settings are preserved between sessions. |\n| `isolated` | Launches Chrome with a temporary profile that is deleted after each session. Use this for clean-state automation. |\n| `existing` | Attaches to an already-running Chrome instance. You must enable remote debugging first by navigating to `chrome://inspect/#remote-debugging` in Chrome. No new browser process is launched. |\n\n#### Configuration reference\n\nAll browser-specific settings go under `agents.browser` in your `settings.json`.\n\n| Setting | Type | Default | Description |\n| :------------ | :-------- | :------------- | :---------------------------------------------------------------------------------------------- |\n| `sessionMode` | `string` | `\"persistent\"` | How Chrome is managed: `\"persistent\"`, `\"isolated\"`, or `\"existing\"`. |\n| `headless` | `boolean` | `false` | Run Chrome in headless mode (no visible window). |\n| `profilePath` | `string` | — | Custom path to a browser profile directory. |\n| `visualModel` | `string` | — | Model override for the visual agent (for example, `\"gemini-2.5-computer-use-preview-10-2025\"`). |\n\n#### Security\n\nThe browser agent enforces the following security restrictions:\n\n- **Blocked URL patterns:** `file://`, `javascript:`, `data:text/html`,\n `chrome://extensions`, and `chrome://settings/passwords` are always blocked.\n- **Sensitive action confirmation:** Actions like form filling, file uploads,\n and form submissions require user confirmation through the standard policy\n engine.\n\n#### Visual agent\n\nBy default, the browser agent interacts with pages through the accessibility\ntree using element `uid` values. For tasks that require visual identification\n(for example, \"click the yellow button\" or \"find the red error message\"), you\ncan enable the visual agent by setting a `visualModel`:\n\n```json\n{\n \"agents\": {\n \"overrides\": {\n \"browser_agent\": {\n \"enabled\": true\n }\n },\n \"browser\": {\n \"visualModel\": \"gemini-2.5-computer-use-preview-10-2025\"\n }\n }\n}\n```\n\nWhen enabled, the agent gains access to the `analyze_screenshot` tool, which\ncaptures a screenshot and sends it to the vision model for analysis. The model\nreturns coordinates and element descriptions that the browser agent uses with\nthe `click_at` tool for precise, coordinate-based interactions.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> The visual agent requires API key or Vertex AI authentication. It is\n> not available when using \"Sign in with Google\".\n\n## Creating custom subagents\n\nYou can create your own subagents to automate specific workflows or enforce\nspecific personas. To use custom subagents, you must enable them in your\n`settings.json`:\n\n```json\n{\n \"experimental\": {\n \"enableAgents\": true\n }\n}\n```\n\n### Agent definition files\n\nCustom agents are defined as Markdown files (`.md`) with YAML frontmatter. You\ncan place them in:\n\n1. **Project-level:** `.gemini/agents/*.md` (Shared with your team)\n2. **User-level:** `~/.gemini/agents/*.md` (Personal agents)\n\n### File format\n\nThe file **MUST** start with YAML frontmatter enclosed in triple-dashes `---`.\nThe body of the markdown file becomes the agent's **System Prompt**.\n\n**Example: `.gemini/agents/security-auditor.md`**\n\n```markdown\n---\nname: security-auditor\ndescription: Specialized in finding security vulnerabilities in code.\nkind: local\ntools:\n - read_file\n - grep_search\nmodel: gemini-3-flash-preview\ntemperature: 0.2\nmax_turns: 10\n---\n\nYou are a ruthless Security Auditor. Your job is to analyze code for potential\nvulnerabilities.\n\nFocus on:\n\n1. SQL Injection\n2. XSS (Cross-Site Scripting)\n3. Hardcoded credentials\n4. Unsafe file operations\n\nWhen you find a vulnerability, explain it clearly and suggest a fix. Do not fix\nit yourself; just report it.\n```\n\n### Configuration schema\n\n| Field | Type | Required | Description |\n| :------------- | :----- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `name` | string | Yes | Unique identifier (slug) used as the tool name for the agent. Only lowercase letters, numbers, hyphens, and underscores. |\n| `description` | string | Yes | Short description of what the agent does. This is visible to the main agent to help it decide when to call this subagent. |\n| `kind` | string | No | `local` (default) or `remote`. |\n| `tools` | array | No | List of tool names this agent can use. Supports wildcards: `*` (all tools), `mcp_*` (all MCP tools), `mcp_server_*` (all tools from a server). **If omitted, it inherits all tools from the parent session.** |\n| `model` | string | No | Specific model to use (e.g., `gemini-3-preview`). Defaults to `inherit` (uses the main session model). |\n| `temperature` | number | No | Model temperature (0.0 - 2.0). Defaults to `1`. |\n| `max_turns` | number | No | Maximum number of conversation turns allowed for this agent before it must return. Defaults to `30`. |\n| `timeout_mins` | number | No | Maximum execution time in minutes. Defaults to `10`. |\n\n### Tool wildcards\n\nWhen defining `tools` for a subagent, you can use wildcards to quickly grant\naccess to groups of tools:\n\n- `*`: Grant access to all available built-in and discovered tools.\n- `mcp_*`: Grant access to all tools from all connected MCP servers.\n- `mcp_my-server_*`: Grant access to all tools from a specific MCP server named\n `my-server`.\n\n### Isolation and recursion protection\n\nEach subagent runs in its own isolated context loop. This means:\n\n- **Independent history:** The subagent's conversation history does not bloat\n the main agent's context.\n- **Isolated tools:** The subagent only has access to the tools you explicitly\n grant it.\n- **Recursion protection:** To prevent infinite loops and excessive token usage,\n subagents **cannot** call other subagents. If a subagent is granted the `*`\n tool wildcard, it will still be unable to see or invoke other agents.\n\n## Managing subagents\n\nYou can manage subagents interactively using the `/agents` command or\npersistently via `settings.json`.\n\n### Interactive management (/agents)\n\nIf you are in an interactive CLI session, you can use the `/agents` command to\nmanage subagents without editing configuration files manually. This is the\nrecommended way to quickly enable, disable, or re-configure agents on the fly.\n\nFor a full list of sub-commands and usage, see the\n[`/agents` command reference](/docs/reference/commands#agents).\n\n### Persistent configuration (settings.json)\n\nWhile the `/agents` command and agent definition files provide a starting point,\nyou can use `settings.json` for global, persistent overrides. This is useful for\nenforcing specific models or execution limits across all sessions.\n\n#### `agents.overrides`\n\nUse this to enable or disable specific agents or override their run\nconfigurations.\n\n```json\n{\n \"agents\": {\n \"overrides\": {\n \"security-auditor\": {\n \"enabled\": false,\n \"runConfig\": {\n \"maxTurns\": 20,\n \"maxTimeMinutes\": 10\n }\n }\n }\n }\n}\n```\n\n#### `modelConfigs.overrides`\n\nYou can target specific subagents with custom model settings (like system\ninstruction prefixes or specific safety settings) using the `overrideScope`\nfield.\n\n```json\n{\n \"modelConfigs\": {\n \"overrides\": [\n {\n \"match\": { \"overrideScope\": \"security-auditor\" },\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"temperature\": 0.1\n }\n }\n }\n ]\n }\n}\n```\n\n### Optimizing your subagent\n\nThe main agent's system prompt encourages it to use an expert subagent when one\nis available. It decides whether an agent is a relevant expert based on the\nagent's description. You can improve the reliability with which an agent is used\nby updating the description to more clearly indicate:\n\n- Its area of expertise.\n- When it should be used.\n- Some example scenarios.\n\nFor example, the following subagent description should be called fairly\nconsistently for Git operations.\n\n> Git expert agent which should be used for all local and remote git operations.\n> For example:\n>\n> - Making commits\n> - Searching for regressions with bisect\n> - Interacting with source control and issues providers such as GitHub.\n\nIf you need to further tune your subagent, you can do so by selecting the model\nto optimize for with `/model` and then asking the model why it does not think\nthat your subagent was called with a specific prompt and the given description.\n\n## Remote subagents (Agent2Agent) (experimental)\n\nGemini CLI can also delegate tasks to remote subagents using the Agent-to-Agent\n(A2A) protocol.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> Remote subagents are currently an experimental feature.\n\nSee the [Remote Subagents documentation](/docs/core/remote-agents) for detailed\nconfiguration, authentication, and usage instructions.\n\n## Extension subagents\n\nExtensions can bundle and distribute subagents. See the\n[Extensions documentation](/docs/extensions#subagents) for details on how\nto package agents within an extension.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":16384,"content_sha256":"2882747d2668fd13aceab95aad06d938a642739e5cefc8725e45715326c92f34"},{"filename":"canonical/geminicli-com/docs/core/tools-api.md","content":"---\nsource_url: https://geminicli.com/docs/core/tools-api\nsource_type: llms-txt\ncontent_hash: sha256:b86d0d5b7bd15fe79de84789db9f3ec968b24317a31452d859b1f20867c211b5\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"a35f4a77dcd03cf16850ab73e880e5f8f20dbba46ec20fc48ff2c683373bb85c\"'\nlast_modified: '2025-12-01T20:04:32Z'\n---\n\n# Gemini CLI core: Tools API\n\nThe Gemini CLI core (`packages/core`) features a robust system for defining,\nregistering, and executing tools. These tools extend the capabilities of the\nGemini model, allowing it to interact with the local environment, fetch web\ncontent, and perform various actions beyond simple text generation.\n\n## Core concepts\n\n- **Tool (`tools.ts`):** An interface and base class (`BaseTool`) that defines\n the contract for all tools. Each tool must have:\n - `name`: A unique internal name (used in API calls to Gemini).\n - `displayName`: A user-friendly name.\n - `description`: A clear explanation of what the tool does, which is provided\n to the Gemini model.\n - `parameterSchema`: A JSON schema defining the parameters that the tool\n accepts. This is crucial for the Gemini model to understand how to call the\n tool correctly.\n - `validateToolParams()`: A method to validate incoming parameters.\n - `getDescription()`: A method to provide a human-readable description of what\n the tool will do with specific parameters before execution.\n - `shouldConfirmExecute()`: A method to determine if user confirmation is\n required before execution (e.g., for potentially destructive operations).\n - `execute()`: The core method that performs the tool's action and returns a\n `ToolResult`.\n\n- **`ToolResult` (`tools.ts`):** An interface defining the structure of a tool's\n execution outcome:\n - `llmContent`: The factual content to be included in the history sent back to\n the LLM for context. This can be a simple string or a `PartListUnion` (an\n array of `Part` objects and strings) for rich content.\n - `returnDisplay`: A user-friendly string (often Markdown) or a special object\n (like `FileDiff`) for display in the CLI.\n\n- **Returning rich content:** Tools are not limited to returning simple text.\n The `llmContent` can be a `PartListUnion`, which is an array that can contain\n a mix of `Part` objects (for images, audio, etc.) and `string`s. This allows a\n single tool execution to return multiple pieces of rich content.\n\n- **Tool registry (`tool-registry.ts`):** A class (`ToolRegistry`) responsible\n for:\n - **Registering tools:** Holding a collection of all available built-in tools\n (e.g., `ReadFileTool`, `ShellTool`).\n - **Discovering tools:** It can also discover tools dynamically:\n - **Command-based discovery:** If `tools.discoveryCommand` is configured in\n settings, this command is executed. It's expected to output JSON\n describing custom tools, which are then registered as `DiscoveredTool`\n instances.\n - **MCP-based discovery:** If `mcp.serverCommand` is configured, the\n registry can connect to a Model Context Protocol (MCP) server to list and\n register tools (`DiscoveredMCPTool`).\n - **Providing schemas:** Exposing the `FunctionDeclaration` schemas of all\n registered tools to the Gemini model, so it knows what tools are available\n and how to use them.\n - **Retrieving tools:** Allowing the core to get a specific tool by name for\n execution.\n\n## Built-in tools\n\nThe core comes with a suite of pre-defined tools, typically found in\n`packages/core/src/tools/`. These include:\n\n- **File system tools:**\n - `LSTool` (`ls.ts`): Lists directory contents.\n - `ReadFileTool` (`read-file.ts`): Reads the content of a single file.\n - `WriteFileTool` (`write-file.ts`): Writes content to a file.\n - `GrepTool` (`grep.ts`): Searches for patterns in files.\n - `GlobTool` (`glob.ts`): Finds files matching glob patterns.\n - `EditTool` (`edit.ts`): Performs in-place modifications to files (often\n requiring confirmation).\n - `ReadManyFilesTool` (`read-many-files.ts`): Reads and concatenates content\n from multiple files or glob patterns (used by the `@` command in CLI).\n- **Execution tools:**\n - `ShellTool` (`shell.ts`): Executes arbitrary shell commands (requires\n careful sandboxing and user confirmation).\n- **Web tools:**\n - `WebFetchTool` (`web-fetch.ts`): Fetches content from a URL.\n - `WebSearchTool` (`web-search.ts`): Performs a web search.\n- **Memory tools:**\n - `MemoryTool` (`memoryTool.ts`): Interacts with the AI's memory.\n\nEach of these tools extends `BaseTool` and implements the required methods for\nits specific functionality.\n\n## Tool execution flow\n\n1. **Model request:** The Gemini model, based on the user's prompt and the\n provided tool schemas, decides to use a tool and returns a `FunctionCall`\n part in its response, specifying the tool name and arguments.\n2. **Core receives request:** The core parses this `FunctionCall`.\n3. **Tool retrieval:** It looks up the requested tool in the `ToolRegistry`.\n4. **Parameter validation:** The tool's `validateToolParams()` method is\n called.\n5. **Confirmation (if needed):**\n - The tool's `shouldConfirmExecute()` method is called.\n - If it returns details for confirmation, the core communicates this back to\n the CLI, which prompts the user.\n - The user's decision (e.g., proceed, cancel) is sent back to the core.\n6. **Execution:** If validated and confirmed (or if no confirmation is needed),\n the core calls the tool's `execute()` method with the provided arguments and\n an `AbortSignal` (for potential cancellation).\n7. **Result processing:** The `ToolResult` from `execute()` is received by the\n core.\n8. **Response to model:** The `llmContent` from the `ToolResult` is packaged as\n a `FunctionResponse` and sent back to the Gemini model so it can continue\n generating a user-facing response.\n9. **Display to user:** The `returnDisplay` from the `ToolResult` is sent to\n the CLI to show the user what the tool did.\n\n## Extending with custom tools\n\nWhile direct programmatic registration of new tools by users isn't explicitly\ndetailed as a primary workflow in the provided files for typical end-users, the\narchitecture supports extension through:\n\n- **Command-based discovery:** Advanced users or project administrators can\n define a `tools.discoveryCommand` in `settings.json`. This command, when run\n by the Gemini CLI core, should output a JSON array of `FunctionDeclaration`\n objects. The core will then make these available as `DiscoveredTool`\n instances. The corresponding `tools.callCommand` would then be responsible for\n actually executing these custom tools.\n- **MCP server(s):** For more complex scenarios, one or more MCP servers can be\n set up and configured via the `mcpServers` setting in `settings.json`. The\n Gemini CLI core can then discover and use tools exposed by these servers. As\n mentioned, if you have multiple MCP servers, the tool names will be prefixed\n with the server name from your configuration (e.g.,\n `serverAlias__actualToolName`).\n\nThis tool system provides a flexible and powerful way to augment the Gemini\nmodel's capabilities, making the Gemini CLI a versatile assistant for a wide\nrange of tasks.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7267,"content_sha256":"36e801858d713080dc83889733ba1e5dc2175c3a7d2eeef0dd7d14c39ea764e6"},{"filename":"canonical/geminicli-com/docs/examples/proxy-script.md","content":"---\nsource_url: https://geminicli.com/docs/examples/proxy-script\nsource_type: llms-txt\ncontent_hash: sha256:7d0b26c540e3984882e7c4781018ad0416ee366b0be60e7bd6f6c08ae5dedba3\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"432157ca78dbc0d80f7ac889f94bacc360a3bd94454ff40e584b40f11bf76108\"'\nlast_modified: '2025-12-01T20:04:32Z'\n---\n\n# Example proxy script\n\nThe following is an example of a proxy script that can be used with the\n`GEMINI_SANDBOX_PROXY_COMMAND` environment variable. This script only allows\n`HTTPS` connections to `example.com:443` and declines all other requests.\n\n```javascript\n#!/usr/bin/env node\n\n/**\n * @license\n * Copyright 2025 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Example proxy server that listens on :::8877 and only allows HTTPS connections to example.com.\n// Set `GEMINI_SANDBOX_PROXY_COMMAND=scripts/example-proxy.js` to run proxy alongside sandbox\n// Test via `curl https://example.com` inside sandbox (in shell mode or via shell tool)\n\nimport http from 'node:http';\nimport net from 'node:net';\nimport { URL } from 'node:url';\nimport console from 'node:console';\n\nconst PROXY_PORT = 8877;\nconst ALLOWED_DOMAINS = ['example.com', 'googleapis.com'];\nconst ALLOWED_PORT = '443';\n\nconst server = http.createServer((req, res) => {\n // Deny all requests other than CONNECT for HTTPS\n console.log(\n `[PROXY] Denying non-CONNECT request for: ${req.method} ${req.url}`,\n );\n res.writeHead(405, { 'Content-Type': 'text/plain' });\n res.end('Method Not Allowed');\n});\n\nserver.on('connect', (req, clientSocket, head) => {\n // req.url will be in the format \"hostname:port\" for a CONNECT request.\n const { port, hostname } = new URL(`http://${req.url}`);\n\n console.log(`[PROXY] Intercepted CONNECT request for: ${hostname}:${port}`);\n\n if (\n ALLOWED_DOMAINS.some(\n (domain) => hostname == domain || hostname.endsWith(`.${domain}`),\n ) &&\n port === ALLOWED_PORT\n ) {\n console.log(`[PROXY] Allowing connection to ${hostname}:${port}`);\n\n // Establish a TCP connection to the original destination.\n const serverSocket = net.connect(port, hostname, () => {\n clientSocket.write('HTTP/1.1 200 Connection Established\\r\\n\\r\\n');\n // Create a tunnel by piping data between the client and the destination server.\n serverSocket.write(head);\n serverSocket.pipe(clientSocket);\n clientSocket.pipe(serverSocket);\n });\n\n serverSocket.on('error', (err) => {\n console.error(`[PROXY] Error connecting to destination: ${err.message}`);\n clientSocket.end(`HTTP/1.1 502 Bad Gateway\\r\\n\\r\\n`);\n });\n } else {\n console.log(`[PROXY] Denying connection to ${hostname}:${port}`);\n clientSocket.end('HTTP/1.1 403 Forbidden\\r\\n\\r\\n');\n }\n\n clientSocket.on('error', (err) => {\n // This can happen if the client hangs up.\n console.error(`[PROXY] Client socket error: ${err.message}`);\n });\n});\n\nserver.listen(PROXY_PORT, () => {\n const address = server.address();\n console.log(`[PROXY] Proxy listening on ${address.address}:${address.port}`);\n console.log(\n `[PROXY] Allowing HTTPS connections to domains: ${ALLOWED_DOMAINS.join(', ')}`,\n );\n});\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":3181,"content_sha256":"b40f7497c5f2a3297de0f45659897b01a3c1fda06fcfacdc9b54987775ae41b8"},{"filename":"canonical/geminicli-com/docs/extensions.md","content":"---\nsource_url: http://geminicli.com/docs/extensions\nsource_type: llms-txt\ncontent_hash: sha256:0c3fdda2d4d53ff45902fd8732d14eb87ecf563a3c3ad6c2700d4d0216069a90\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"27f1c25d0b66face911e08f43b6aea88c2172c119c04cb0d6cb5457fb000631b\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Gemini CLI extensions\n\nGemini CLI extensions package prompts, MCP servers, custom commands, themes,\nhooks, sub-agents, and agent skills into a familiar and user-friendly format.\nWith extensions, you can expand the capabilities of Gemini CLI and share those\ncapabilities with others. They are designed to be easily installable and\nshareable.\n\nTo see what's possible, browse the\n[Gemini CLI extension gallery](https://geminicli.com/extensions/browse/).\n\n## Choose your path\n\nChoose the guide that best fits your needs.\n\n### I want to use extensions\n\nLearn how to discover, install, and manage extensions to enhance your Gemini CLI\nexperience.\n\n- **[Manage extensions](#manage-extensions):** List and verify your installed\n extensions.\n- **[Install extensions](#installation):** Add new capabilities from GitHub or\n local paths.\n\n### I want to build extensions\n\nLearn how to create, test, and share your own extensions with the community.\n\n- **[Build extensions](/docs/extensions/writing-extensions):** Create your first extension\n from a template.\n- **[Best practices](/docs/extensions/best-practices):** Learn how to build secure and\n reliable extensions.\n- **[Publish to the gallery](/docs/extensions/releasing):** Share your work with the world.\n\n## Manage extensions\n\nUse the interactive `/extensions` command to verify your installed extensions\nand their status:\n\n```bash\n/extensions list\n```\n\nYou can also manage extensions from your terminal using the `gemini extensions`\ncommand group:\n\n```bash\ngemini extensions list\n```\n\n## Installation\n\nInstall an extension by providing its GitHub repository URL. For example:\n\n```bash\ngemini extensions install https://github.com/gemini-cli-extensions/workspace\n```\n\nFor more advanced installation options, see the\n[Extension reference](/docs/extensions/reference#install-an-extension).\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2183,"content_sha256":"e626764f379177949e886166bab2faabb27452cca7adf82ea7fde2bd291cd1ef"},{"filename":"canonical/geminicli-com/docs/extensions/best-practices.md","content":"---\nsource_url: http://geminicli.com/docs/extensions/best-practices\nsource_type: llms-txt\ncontent_hash: sha256:b47e56747744f49495be60d87f8b8975b8d8935ecb0c3d74ccb6728f0bf92163\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"5a1a483cfa7bbf95d5846891fc8c0d634e437720e70e1a27cdade02fc2c29019\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Gemini CLI extension best practices\n\nThis guide covers best practices for developing, securing, and maintaining\nGemini CLI extensions.\n\n## Development\n\nDeveloping extensions for Gemini CLI is a lightweight, iterative process. Use\nthese strategies to build robust and efficient extensions.\n\n### Structure your extension\n\nWhile simple extensions may contain only a few files, we recommend a organized\nstructure for complex projects.\n\n```text\nmy-extension/\n├── package.json\n├── tsconfig.json\n├── gemini-extension.json\n├── src/\n│ ├── index.ts\n│ └── tools/\n└── dist/\n```\n\n- **Use TypeScript:** We strongly recommend using TypeScript for type safety and\n improved developer experience.\n- **Separate source and build:** Keep your source code in `src/` and output\n build artifacts to `dist/`.\n- **Bundle dependencies:** If your extension has many dependencies, bundle them\n using a tool like `esbuild` to reduce installation time and avoid conflicts.\n\n### Iterate with `link`\n\nUse the `gemini extensions link` command to develop locally without reinstalling\nyour extension after every change.\n\n```bash\ncd my-extension\ngemini extensions link .\n```\n\nChanges to your code are immediately available in the CLI after you rebuild the\nproject and restart the session.\n\n### Use `GEMINI.md` effectively\n\nYour `GEMINI.md` file provides essential context to the model.\n\n- **Focus on goals:** Explain the high-level purpose of the extension and how to\n interact with its tools.\n- **Be concise:** Avoid dumping exhaustive documentation into the file. Use\n clear, direct language.\n- **Provide examples:** Include brief examples of how the model should use\n specific tools or commands.\n\n## Security\n\nFollow the principle of least privilege and rigorous input validation when\nbuilding extensions.\n\n### Minimal permissions\n\nOnly request the permissions your MCP server needs to function. Avoid giving the\nmodel broad access (such as full shell access) if restricted tools are\nsufficient.\n\nIf your extension uses powerful tools like `run_shell_command`, restrict them in\nyour `gemini-extension.json` file:\n\n```json\n{\n \"name\": \"my-safe-extension\",\n \"excludeTools\": [\"run_shell_command(rm -rf *)\"]\n}\n```\n\nThis ensures the CLI blocks dangerous commands even if the model attempts to\nexecute them.\n\n### Validate inputs\n\nYour MCP server runs on the user's machine. Always validate tool inputs to\nprevent arbitrary code execution or unauthorized filesystem access.\n\n```typescript\n// Example: Validating paths\nif (!path.resolve(inputPath).startsWith(path.resolve(allowedDir) + path.sep)) {\n throw new Error('Access denied');\n}\n```\n\n### Secure sensitive settings\n\nIf your extension requires API keys or other secrets, use the `sensitive: true`\noption in your manifest. This ensures keys are stored in the system keychain and\nobfuscated in the CLI output.\n\n```json\n\"settings\": [\n {\n \"name\": \"API Key\",\n \"envVar\": \"MY_API_KEY\",\n \"sensitive\": true\n }\n]\n```\n\n## Release\n\nFollow standard versioning and release practices to ensure a smooth experience\nfor your users.\n\n### Semantic versioning\n\nFollow [Semantic Versioning (SemVer)](https://semver.org/) to communicate\nchanges clearly.\n\n- **Major:** Breaking changes (e.g., renaming tools or changing arguments).\n- **Minor:** New features (e.g., adding new tools or commands).\n- **Patch:** Bug fixes and performance improvements.\n\n### Release channels\n\nUse Git branches to manage release channels. This lets users choose between\nstability and the latest features.\n\n```bash\n# Install the stable version (default branch)\ngemini extensions install github.com/user/repo\n\n# Install the development version\ngemini extensions install github.com/user/repo --ref dev\n```\n\n### Clean artifacts\n\nWhen using GitHub Releases, ensure your archives only contain necessary files\n(such as `dist/`, `gemini-extension.json`, and `package.json`). Exclude\n`node_modules/` and `src/` to minimize download size.\n\n## Test and verify\n\nTest your extension thoroughly before releasing it to users.\n\n- **Manual verification:** Use `gemini extensions link` to test your extension\n in a live CLI session. Verify that tools appear in the debug console (F12) and\n that custom commands resolve correctly.\n- **Automated testing:** If your extension includes an MCP server, write unit\n tests for your tool logic using a framework like Vitest or Jest. You can test\n MCP tools in isolation by mocking the transport layer.\n\n## Troubleshooting\n\nUse these tips to diagnose and fix common extension issues.\n\n### Extension not loading\n\nIf your extension doesn't appear in `/extensions list`:\n\n- **Check the manifest:** Ensure `gemini-extension.json` is in the root\n directory and contains valid JSON.\n- **Verify the name:** The `name` field in the manifest must match the extension\n directory name exactly.\n- **Restart the CLI:** Extensions are loaded at the start of a session. Restart\n Gemini CLI after making changes to the manifest or linking a new extension.\n\n### MCP server failures\n\nIf your tools aren't working as expected:\n\n- **Check the logs:** View the CLI logs to see if the MCP server failed to\n start.\n- **Test the command:** Run the server's `command` and `args` directly in your\n terminal to ensure it starts correctly outside of Gemini CLI.\n- **Debug console:** In interactive mode, press **F12** to open the debug\n console and inspect tool calls and responses.\n\n### Command conflicts\n\nIf a custom command isn't responding:\n\n- **Check precedence:** Remember that user and project commands take precedence\n over extension commands. Use the prefixed name (e.g., `/extension.command`) to\n verify the extension's version.\n- **Help command:** Run `/help` to see a list of all available commands and\n their sources.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":6139,"content_sha256":"7736847dd4d9e9975edce94e8d9bd0bef8ee9c6c60f731e72be6ca65f8459ed0"},{"filename":"canonical/geminicli-com/docs/extensions/reference.md","content":"---\nsource_url: http://geminicli.com/docs/extensions/reference\nsource_type: llms-txt\ncontent_hash: sha256:ea1446907e033c13542c3cc80066f8d799238c25d3fe419abf6507798b9297d1\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"937f0123e26236f19b6af6fd49cdcd175187bdac70bddb552d2acfa2cd64f389\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Extension reference\n\nThis guide covers the `gemini extensions` commands and the structure of the\n`gemini-extension.json` configuration file.\n\n## Manage extensions\n\nUse the `gemini extensions` command group to manage your extensions from the\nterminal.\n\nNote that commands like `gemini extensions install` are not supported within the\nCLI's interactive mode. However, you can use the `/extensions list` command to\nview installed extensions. All management operations, including updates to slash\ncommands, take effect only after you restart the CLI session.\n\n### Install an extension\n\nInstall an extension by providing its GitHub repository URL or a local file\npath.\n\nGemini CLI creates a copy of the extension during installation. You must run\n`gemini extensions update` to pull changes from the source. To install from\nGitHub, you must have `git` installed on your machine.\n\n```bash\ngemini extensions install \u003csource> [--ref \u003cref>] [--auto-update] [--pre-release] [--consent] [--skip-settings]\n```\n\n- `\u003csource>`: The GitHub URL or local path of the extension.\n- `--ref`: The git ref (branch, tag, or commit) to install.\n- `--auto-update`: Enable automatic updates for this extension.\n- `--pre-release`: Enable installation of pre-release versions.\n- `--consent`: Acknowledge security risks and skip the confirmation prompt.\n- `--skip-settings`: Skip the configuration on install process.\n\n### Uninstall an extension\n\nTo uninstall one or more extensions, use the `uninstall` command:\n\n```bash\ngemini extensions uninstall \u003cname...>\n```\n\n### Disable an extension\n\nExtensions are enabled globally by default. You can disable an extension\nentirely or for a specific workspace.\n\n```bash\ngemini extensions disable \u003cname> [--scope \u003cscope>]\n```\n\n- `\u003cname>`: The name of the extension to disable.\n- `--scope`: The scope to disable the extension in (`user` or `workspace`).\n\n### Enable an extension\n\nRe-enable a disabled extension using the `enable` command:\n\n```bash\ngemini extensions enable \u003cname> [--scope \u003cscope>]\n```\n\n- `\u003cname>`: The name of the extension to enable.\n- `--scope`: The scope to enable the extension in (`user` or `workspace`).\n\n### Update an extension\n\nUpdate an extension to the version specified in its `gemini-extension.json`\nfile.\n\n```bash\ngemini extensions update \u003cname>\n```\n\nTo update all installed extensions at once:\n\n```bash\ngemini extensions update --all\n```\n\n### Create an extension from a template\n\nCreate a new extension directory using a built-in template.\n\n```bash\ngemini extensions new \u003cpath> [template]\n```\n\n- `\u003cpath>`: The directory to create.\n- `[template]`: The template to use (e.g., `mcp-server`, `context`,\n `custom-commands`).\n\n### Link a local extension\n\nCreate a symbolic link between your development directory and the Gemini CLI\nextensions directory. This lets you test changes immediately without\nreinstalling.\n\n```bash\ngemini extensions link \u003cpath>\n```\n\n## Extension format\n\nGemini CLI loads extensions from `\u003chome>/.gemini/extensions`. Each extension\nmust have a `gemini-extension.json` file in its root directory.\n\n### `gemini-extension.json`\n\nThe manifest file defines the extension's behavior and configuration.\n\n```json\n{\n \"name\": \"my-extension\",\n \"version\": \"1.0.0\",\n \"description\": \"My awesome extension\",\n \"mcpServers\": {\n \"my-server\": {\n \"command\": \"node\",\n \"args\": [\"${extensionPath}/my-server.js\"],\n \"cwd\": \"${extensionPath}\"\n }\n },\n \"contextFileName\": \"GEMINI.md\",\n \"excludeTools\": [\"run_shell_command\"],\n \"migratedTo\": \"https://github.com/new-owner/new-extension-repo\",\n \"plan\": {\n \"directory\": \".gemini/plans\"\n }\n}\n```\n\n- `name`: The name of the extension. This is used to uniquely identify the\n extension and for conflict resolution when extension commands have the same\n name as user or project commands. The name should be lowercase or numbers and\n use dashes instead of underscores or spaces. This is how users will refer to\n your extension in the CLI. Note that we expect this name to match the\n extension directory name.\n- `version`: The version of the extension.\n- `description`: A short description of the extension. This will be displayed on\n [geminicli.com/extensions](https://geminicli.com/extensions).\n- `migratedTo`: The URL of the new repository source for the extension. If this\n is set, the CLI will automatically check this new source for updates and\n migrate the extension's installation to the new source if an update is found.\n- `mcpServers`: A map of MCP servers to settings. The key is the name of the\n server, and the value is the server configuration. These servers will be\n loaded on startup just like MCP servers defined in a\n [`settings.json` file](/docs/reference/configuration). If both an extension\n and a `settings.json` file define an MCP server with the same name, the server\n defined in the `settings.json` file takes precedence.\n - Note that all MCP server configuration options are supported except for\n `trust`.\n - For portability, you should use `${extensionPath}` to refer to files within\n your extension directory.\n - Separate your executable and its arguments using `command` and `args`\n instead of putting them both in `command`.\n- `contextFileName`: The name of the file that contains the context for the\n extension. This will be used to load the context from the extension directory.\n If this property is not used but a `GEMINI.md` file is present in your\n extension directory, then that file will be loaded.\n- `excludeTools`: An array of tool names to exclude from the model. You can also\n specify command-specific restrictions for tools that support it, like the\n `run_shell_command` tool. For example,\n `\"excludeTools\": [\"run_shell_command(rm -rf)\"]` will block the `rm -rf`\n command. Note that this differs from the MCP server `excludeTools`\n functionality, which can be listed in the MCP server config.\n- `plan`: Planning features configuration.\n - `directory`: The directory where planning artifacts are stored. This serves\n as a fallback if the user hasn't specified a plan directory in their\n settings. If not specified by either the extension or the user, the default\n is `~/.gemini/tmp/\u003cproject>/\u003csession-id>/plans/`.\n\nWhen Gemini CLI starts, it loads all the extensions and merges their\nconfigurations. If there are any conflicts, the workspace configuration takes\nprecedence.\n\n### Extension settings\n\nExtensions can define settings that users provide during installation, such as\nAPI keys or URLs. These values are stored in a `.env` file within the extension\ndirectory.\n\nTo define settings, add a `settings` array to your manifest:\n\n```json\n{\n \"name\": \"my-api-extension\",\n \"version\": \"1.0.0\",\n \"settings\": [\n {\n \"name\": \"API Key\",\n \"description\": \"Your API key for the service.\",\n \"envVar\": \"MY_API_KEY\",\n \"sensitive\": true\n }\n ]\n}\n```\n\n- `name`: The setting's display name.\n- `description`: A clear explanation of the setting.\n- `envVar`: The environment variable name where the value is stored.\n- `sensitive`: If `true`, the value is stored in the system keychain and\n obfuscated in the UI.\n\nTo update an extension's settings:\n\n```bash\ngemini extensions config \u003cname> [setting] [--scope \u003cscope>]\n```\n\n### Custom commands\n\nProvide [custom commands](/docs/cli/custom-commands) by placing TOML files in a\n`commands/` subdirectory. Gemini CLI uses the directory structure to determine\nthe command name.\n\nFor an extension named `gcp`:\n\n- `commands/deploy.toml` becomes `/deploy`\n- `commands/gcs/sync.toml` becomes `/gcs:sync` (namespaced with a colon)\n\n### Hooks\n\nIntercept and customize CLI behavior using [hooks](/docs/hooks). Define\nhooks in a `hooks/hooks.json` file within your extension directory. Note that\nhooks are not defined in the `gemini-extension.json` manifest.\n\n### Agent skills\n\nBundle [agent skills](/docs/cli/skills) to provide specialized workflows. Place\nskill definitions in a `skills/` directory. For example,\n`skills/security-audit/SKILL.md` exposes a `security-audit` skill.\n\n### Sub-agents\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> Sub-agents are a preview feature currently under active development.\n\nProvide [sub-agents](/docs/core/subagents) that users can delegate tasks to. Add\nagent definition files (`.md`) to an `agents/` directory in your extension root.\n\n### \u003ca id=\"policy-engine\">\u003c/a>Policy Engine\n\nExtensions can contribute policy rules and safety checkers to the Gemini CLI\n[Policy Engine](/docs/reference/policy-engine). These rules are defined in\n`.toml` files and take effect when the extension is activated.\n\nTo add policies, create a `policies/` directory in your extension's root and\nplace your `.toml` policy files inside it. Gemini CLI automatically loads all\n`.toml` files from this directory.\n\nRules contributed by extensions run in their own tier (tier 2), alongside\nworkspace-defined policies. This tier has higher priority than the default rules\nbut lower priority than user or admin policies.\n\n\u003c!-- prettier-ignore -->\n> [!WARNING]\n> For security, Gemini CLI ignores any `allow` decisions or `yolo`\n> mode configurations in extension policies. This ensures that an extension\n> cannot automatically approve tool calls or bypass security measures without\n> your confirmation.\n\n**Example `policies.toml`**\n\n```toml\n[[rule]]\nmcpName = \"my_server\"\ntoolName = \"dangerous_tool\"\ndecision = \"ask_user\"\npriority = 100\n\n[[safety_checker]]\nmcpName = \"my_server\"\ntoolName = \"write_data\"\npriority = 200\n[safety_checker.checker]\ntype = \"in-process\"\nname = \"allowed-path\"\nrequired_context = [\"environment\"]\n```\n\n### Themes\n\nExtensions can provide custom themes to personalize the CLI UI. Themes are\ndefined in the `themes` array in `gemini-extension.json`.\n\n**Example**\n\n```json\n{\n \"name\": \"my-green-extension\",\n \"version\": \"1.0.0\",\n \"themes\": [\n {\n \"name\": \"shades-of-green\",\n \"type\": \"custom\",\n \"background\": {\n \"primary\": \"#1a362a\"\n },\n \"text\": {\n \"primary\": \"#a6e3a1\",\n \"secondary\": \"#6e8e7a\",\n \"link\": \"#89e689\"\n },\n \"status\": {\n \"success\": \"#76c076\",\n \"warning\": \"#d9e689\",\n \"error\": \"#b34e4e\"\n },\n \"border\": {\n \"default\": \"#4a6c5a\"\n },\n \"ui\": {\n \"comment\": \"#6e8e7a\"\n }\n }\n ]\n}\n```\n\nCustom themes provided by extensions can be selected using the `/theme` command\nor by setting the `ui.theme` property in your `settings.json` file. Note that\nwhen referring to a theme from an extension, the extension name is appended to\nthe theme name in parentheses, e.g., `shades-of-green (my-green-extension)`.\n\n### Conflict resolution\n\nExtension commands have the lowest precedence. If an extension command name\nconflicts with a user or project command, the extension command is prefixed with\nthe extension name (e.g., `/gcp.deploy`) using a dot separator.\n\n## Variables\n\nGemini CLI supports variable substitution in `gemini-extension.json` and\n`hooks/hooks.json`.\n\n| Variable | Description |\n| :----------------- | :---------------------------------------------- |\n| `${extensionPath}` | The absolute path to the extension's directory. |\n| `${workspacePath}` | The absolute path to the current workspace. |\n| `${/}` | The platform-specific path separator. |\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":11664,"content_sha256":"5c465ed9c9f460aa5dd079e3843a614cf493c1f699cb683fd19fe6a3c02c2386"},{"filename":"canonical/geminicli-com/docs/extensions/releasing.md","content":"---\nsource_url: http://geminicli.com/docs/extensions/releasing\nsource_type: llms-txt\ncontent_hash: sha256:f799e5fcc151e5cafe83304c4b66810edbc895ad3f7f8fb736cd252870332e8f\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"65a1e93bbec28d6aa6b6694731e7fb5eaa10345d89cfb6400419e05949cba58e\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Release extensions\n\nRelease Gemini CLI extensions to your users through a Git repository or GitHub\nReleases.\n\nGit repository releases are the simplest approach and offer the most flexibility\nfor managing development branches. GitHub Releases are more efficient for\ninitial installations because they ship as single archives rather than requiring\na full `git clone`. Use GitHub Releases if you need to include platform-specific\nbinary files.\n\n## List your extension in the gallery\n\nThe [Gemini CLI extension gallery](https://geminicli.com/extensions/browse/)\nautomatically indexes public extensions to help users discover your work. You\ndon't need to submit an issue or email us to list your extension.\n\nTo have your extension automatically discovered and listed:\n\n1. **Use a public repository:** Ensure your extension is hosted in a public\n GitHub repository.\n2. **Add the GitHub topic:** Add the `gemini-cli-extension` topic to your\n repository's **About** section. Our crawler uses this topic to find new\n extensions.\n3. **Place the manifest at the root:** Ensure your `gemini-extension.json` file\n is in the absolute root of the repository or the release archive.\n\nOur system crawls tagged repositories daily. Once you tag your repository, your\nextension will appear in the gallery if it passes validation.\n\n## Release through a Git repository\n\nReleasing through Git is the most flexible option. Create a public Git\nrepository and provide the URL to your users. They can then install your\nextension using `gemini extensions install \u003cyour-repo-uri>`.\n\nUsers can optionally depend on a specific branch, tag, or commit using the\n`--ref` argument. For example:\n\n```bash\ngemini extensions install \u003cyour-repo-uri> --ref=stable\n```\n\nWhenever you push commits to the referenced branch, the CLI prompts users to\nupdate their installation. The `HEAD` commit is always treated as the latest\nversion.\n\n### Manage release channels\n\nYou can use branches or tags to manage different release channels, such as\n`stable`, `preview`, or `dev`.\n\nWe recommend using your default branch as the stable release channel. This\nensures that the default installation command always provides the most reliable\nversion of your extension. You can then use a `dev` branch for active\ndevelopment and merge it into the default branch when you are ready for a\nrelease.\n\n## Release through GitHub Releases\n\nDistributing extensions through\n[GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases)\nprovides a faster installation experience by avoiding a repository clone.\n\nGemini CLI checks for updates by looking for the **Latest** release on GitHub.\nUsers can also install specific versions using the `--ref` argument with a\nrelease tag. Use the `--pre-release` flag to install the latest version even if\nit isn't marked as **Latest**.\n\n### Custom pre-built archives\n\nYou can attach custom archives directly to your GitHub Release as assets. This\nis useful if your extension requires a build step or includes platform-specific\nbinaries.\n\nCustom archives must be fully self-contained and follow the required\n[archive structure](#archive-structure). If your extension is\nplatform-independent, provide a single generic asset.\n\n#### Platform-specific archives\n\nTo let Gemini CLI find the correct asset for a user's platform, use the\nfollowing naming convention:\n\n1. **Platform and architecture-specific:**\n `{platform}.{arch}.{name}.{extension}`\n2. **Platform-specific:** `{platform}.{name}.{extension}`\n3. **Generic:** A single asset will be used as a fallback if no specific match\n is found.\n\nUse these values for the placeholders:\n\n- `{name}`: Your extension name.\n- `{platform}`: Use `darwin` (macOS), `linux`, or `win32` (Windows).\n- `{arch}`: Use `x64` or `arm64`.\n- `{extension}`: Use `.tar.gz` or `.zip`.\n\n**Examples:**\n\n- `darwin.arm64.my-tool.tar.gz` (specific to Apple Silicon Macs)\n- `darwin.my-tool.tar.gz` (fallback for all Macs, e.g. Intel)\n- `linux.x64.my-tool.tar.gz`\n- `win32.my-tool.zip`\n\n#### Archive structure\n\nArchives must be fully contained extensions. The `gemini-extension.json` file\nmust be at the root of the archive. The rest of the layout should match a\nstandard extension structure.\n\n#### Example GitHub Actions workflow\n\nUse this example workflow to build and release your extension for multiple\nplatforms:\n\n```yaml\nname: Release Extension\n\non:\n push:\n tags:\n - 'v*'\n\njobs:\n release:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n\n - name: Set up Node.js\n uses: actions/setup-node@v3\n with:\n node-version: '20'\n\n - name: Install dependencies\n run: npm ci\n\n - name: Build extension\n run: npm run build\n\n - name: Create release assets\n run: |\n npm run package -- --platform=darwin --arch=arm64\n npm run package -- --platform=linux --arch=x64\n npm run package -- --platform=win32 --arch=x64\n\n - name: Create GitHub Release\n uses: softprops/action-gh-release@v1\n with:\n files: |\n release/darwin.arm64.my-tool.tar.gz\n release/linux.arm64.my-tool.tar.gz\n release/win32.arm64.my-tool.zip\n```\n\n## Migrating an Extension Repository\n\nIf you need to move your extension to a new repository (e.g., from a personal\naccount to an organization) or rename it, you can use the `migratedTo` property\nin your `gemini-extension.json` file to seamlessly transition your users.\n\n1. **Create the new repository**: Setup your extension in its new location.\n2. **Update the old repository**: In your original repository, update the\n `gemini-extension.json` file to include the `migratedTo` property, pointing\n to the new repository URL, and bump the version number. You can optionally\n change the `name` of your extension at this time in the new repository.\n ```json\n {\n \"name\": \"my-extension\",\n \"version\": \"1.1.0\",\n \"migratedTo\": \"https://github.com/new-owner/new-extension-repo\"\n }\n ```\n3. **Release the update**: Publish this new version in your old repository.\n\nWhen users check for updates, the Gemini CLI will detect the `migratedTo` field,\nverify that the new repository contains a valid extension update, and\nautomatically update their local installation to track the new source and name\nmoving forward. All extension settings will automatically migrate to the new\ninstallation.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":6799,"content_sha256":"eb6f72aaa937effd1d73b59b4f88f70041448954c8fc92db05d4caa61a40c54a"},{"filename":"canonical/geminicli-com/docs/extensions/writing-extensions.md","content":"---\nsource_url: http://geminicli.com/docs/extensions/writing-extensions\nsource_type: llms-txt\ncontent_hash: sha256:f3bd4bb35915d2f66d474169f717aecfdeb363f52d7166bc43314d0672cbe9fe\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"74bc805f6176c902f36a93e0aac8188bf3c4e03f9d237c770d1022ea971ad770\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Build Gemini CLI extensions\n\nGemini CLI extensions let you expand the capabilities of Gemini CLI by adding\ncustom tools, commands, and context. This guide walks you through creating your\nfirst extension, from setting up a template to adding custom functionality and\nlinking it for local development.\n\n## Prerequisites\n\nBefore you start, ensure you have the Gemini CLI installed and a basic\nunderstanding of Node.js.\n\n## Extension features\n\nExtensions offer several ways to customize Gemini CLI. Use this table to decide\nwhich features your extension needs.\n\n| Feature | What it is | When to use it | Invoked by |\n| :------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- |\n| **[MCP server](/docs/extensions/reference#mcp-servers)** | A standard way to expose new tools and data sources to the model. | Use this when you want the model to be able to _do_ new things, like fetching data from an internal API, querying a database, or controlling a local application. We also support MCP resources (which can replace custom commands) and system instructions (which can replace custom context) | Model |\n| **[Custom commands](/docs/cli/custom-commands)** | A shortcut (like `/my-cmd`) that executes a pre-defined prompt or shell command. | Use this for repetitive tasks or to save long, complex prompts that you use frequently. Great for automation. | User |\n| **[Context file (`GEMINI.md`)](/docs/extensions/reference#contextfilename)** | A markdown file containing instructions that are loaded into the model's context at the start of every session. | Use this to define the \"personality\" of your extension, set coding standards, or provide essential knowledge that the model should always have. | CLI provides to model |\n| **[Agent skills](/docs/cli/skills)** | A specialized set of instructions and workflows that the model activates only when needed. | Use this for complex, occasional tasks (like \"create a PR\" or \"audit security\") to avoid cluttering the main context window when the skill isn't being used. | Model |\n| **[Hooks](/docs/hooks)** | A way to intercept and customize the CLI's behavior at specific lifecycle events (e.g., before/after a tool call). | Use this when you want to automate actions based on what the model is doing, like validating tool arguments, logging activity, or modifying the model's input/output. | CLI |\n| **[Custom themes](/docs/extensions/reference#themes)** | A set of color definitions to personalize the CLI UI. | Use this to provide a unique visual identity for your extension or to offer specialized high-contrast or thematic color schemes. | User (via /theme) |\n\n## Step 1: Create a new extension\n\nThe easiest way to start is by using a built-in template. We'll use the\n`mcp-server` example as our foundation.\n\nRun the following command to create a new directory called `my-first-extension`\nwith the template files:\n\n```bash\ngemini extensions new my-first-extension mcp-server\n```\n\nThis creates a directory with the following structure:\n\n```\nmy-first-extension/\n├── example.js\n├── gemini-extension.json\n└── package.json\n```\n\n## Step 2: Understand the extension files\n\nYour new extension contains several key files that define its behavior.\n\n### `gemini-extension.json`\n\nThe manifest file tells Gemini CLI how to load and use your extension.\n\n```json\n{\n \"name\": \"mcp-server-example\",\n \"version\": \"1.0.0\",\n \"mcpServers\": {\n \"nodeServer\": {\n \"command\": \"node\",\n \"args\": [\"${extensionPath}${/}example.js\"],\n \"cwd\": \"${extensionPath}\"\n }\n }\n}\n```\n\n- `name`: The unique name for your extension.\n- `version`: The version of your extension.\n- `mcpServers`: Defines Model Context Protocol (MCP) servers to add new tools.\n - `command`, `args`, `cwd`: Specify how to start your server. The\n `${extensionPath}` variable is replaced with the absolute path to your\n extension's directory.\n\n### `example.js`\n\nThis file contains the source code for your MCP server. It uses the\n`@modelcontextprotocol/sdk` to define tools.\n\n```javascript\n/**\n * @license\n * Copyright 2025 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\n\nconst server = new McpServer({\n name: 'prompt-server',\n version: '1.0.0',\n});\n\n// Registers a new tool named 'fetch_posts'\nserver.registerTool(\n 'fetch_posts',\n {\n description: 'Fetches a list of posts from a public API.',\n inputSchema: z.object({}).shape,\n },\n async () => {\n const apiResponse = await fetch(\n 'https://jsonplaceholder.typicode.com/posts',\n );\n const posts = await apiResponse.json();\n const response = { posts: posts.slice(0, 5) };\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(response),\n },\n ],\n };\n },\n);\n\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\n```\n\n### `package.json`\n\nThe standard configuration file for a Node.js project. It defines dependencies\nand scripts for your extension.\n\n## Step 3: Add extension settings\n\nSome extensions need configuration, such as API keys or user preferences. Let's\nadd a setting for an API key.\n\n1. Open `gemini-extension.json`.\n2. Add a `settings` array to the configuration:\n\n ```json\n {\n \"name\": \"mcp-server-example\",\n \"version\": \"1.0.0\",\n \"settings\": [\n {\n \"name\": \"API Key\",\n \"description\": \"The API key for the service.\",\n \"envVar\": \"MY_SERVICE_API_KEY\",\n \"sensitive\": true\n }\n ],\n \"mcpServers\": {\n // ...\n }\n }\n ```\n\nWhen a user installs this extension, Gemini CLI will prompt them to enter the\n\"API Key\". The value will be stored securely in the system keychain (because\n`sensitive` is true) and injected into the MCP server's process as the\n`MY_SERVICE_API_KEY` environment variable.\n\n## Step 4: Link your extension\n\nLink your extension to your Gemini CLI installation for local development.\n\n1. **Install dependencies:**\n\n ```bash\n cd my-first-extension\n npm install\n ```\n\n2. **Link the extension:**\n\n The `link` command creates a symbolic link from the Gemini CLI extensions\n directory to your development directory. Changes you make are reflected\n immediately.\n\n ```bash\n gemini extensions link .\n ```\n\nRestart your Gemini CLI session to use the new `fetch_posts` tool. Test it by\nasking: \"fetch posts\".\n\n## Step 5: Add a custom command\n\nCustom commands create shortcuts for complex prompts.\n\n1. Create a `commands` directory and a subdirectory for your command group:\n\n **macOS/Linux**\n\n ```bash\n mkdir -p commands/fs\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n New-Item -ItemType Directory -Force -Path \"commands\\fs\"\n ```\n\n2. Create a file named `commands/fs/grep-code.toml`:\n\n ```toml\n prompt = \"\"\"\n Please summarize the findings for the pattern `{{args}}`.\n\n Search Results:\n !{grep -r {{args}} .}\n \"\"\"\n ```\n\n This command, `/fs:grep-code`, takes an argument, runs the `grep` shell\n command, and pipes the results into a prompt for summarization.\n\nAfter saving the file, restart Gemini CLI. Run `/fs:grep-code \"some pattern\"` to\nuse your new command.\n\n## Step 6: Add a custom `GEMINI.md`\n\nProvide persistent context to the model by adding a `GEMINI.md` file to your\nextension. This is useful for setting behavior or providing essential tool\ninformation.\n\n1. Create a file named `GEMINI.md` in the root of your extension directory:\n\n ```markdown\n # My First Extension Instructions\n\n You are an expert developer assistant. When the user asks you to fetch\n posts, use the `fetch_posts` tool. Be concise in your responses.\n ```\n\n2. Update your `gemini-extension.json` to load this file:\n\n ```json\n {\n \"name\": \"my-first-extension\",\n \"version\": \"1.0.0\",\n \"contextFileName\": \"GEMINI.md\",\n \"mcpServers\": {\n \"nodeServer\": {\n \"command\": \"node\",\n \"args\": [\"${extensionPath}${/}example.js\"],\n \"cwd\": \"${extensionPath}\"\n }\n }\n }\n ```\n\nRestart Gemini CLI. The model now has the context from your `GEMINI.md` file in\nevery session where the extension is active.\n\n## (Optional) Step 7: Add an Agent Skill\n\n[Agent Skills](/docs/cli/skills) bundle specialized expertise and workflows.\nSkills are activated only when needed, which saves context tokens.\n\n1. Create a `skills` directory and a subdirectory for your skill:\n\n **macOS/Linux**\n\n ```bash\n mkdir -p skills/security-audit\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n New-Item -ItemType Directory -Force -Path \"skills\\security-audit\"\n ```\n\n2. Create a `skills/security-audit/SKILL.md` file:\n\n ```markdown\n ---\n name: security-audit\n description:\n Expertise in auditing code for security vulnerabilities. Use when the user\n asks to \"check for security issues\" or \"audit\" their changes.\n ---\n\n # Security Auditor\n\n You are an expert security researcher. When auditing code:\n\n 1. Look for common vulnerabilities (OWASP Top 10).\n 2. Check for hardcoded secrets or API keys.\n 3. Suggest remediation steps for any findings.\n ```\n\nGemini CLI automatically discovers skills bundled with your extension. The model\nactivates them when it identifies a relevant task.\n\n## Step 8: Release your extension\n\nWhen your extension is ready, share it with others via a Git repository or\nGitHub Releases. Refer to the [Extension Releasing Guide](/docs/extensions/releasing) for\ndetailed instructions and learn how to list your extension in the gallery.\n\n## Next steps\n\n- [Extension reference](/docs/extensions/reference): Deeply understand the extension format,\n commands, and configuration.\n- [Best practices](/docs/extensions/best-practices): Learn strategies for building great\n extensions.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":12288,"content_sha256":"af67ff2a7da076384ee3405c836a9e034c9b9a62c8ff71acf0b80c82bbc4d01d"},{"filename":"canonical/geminicli-com/docs/faq.md","content":"---\nsource_url: https://geminicli.com/docs/faq\nsource_type: llms-txt\ncontent_hash: sha256:ae180978d536b75477e27f998c2e5e4e56def804be22698e24cb3cbdc8d16ddc\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"1e365557c413a64bf9b765310ee574a66caf9202d270adbe04956e8df2a04fe9\"'\nlast_modified: '2025-12-01T20:04:32Z'\n---\n\n# Frequently asked questions (FAQ)\n\nThis page provides answers to common questions and solutions to frequent\nproblems encountered while using Gemini CLI.\n\n## General issues\n\n### Why am I getting an `API error: 429 - Resource exhausted`?\n\nThis error indicates that you have exceeded your API request limit. The Gemini\nAPI has rate limits to prevent abuse and ensure fair usage.\n\nTo resolve this, you can:\n\n- **Check your usage:** Review your API usage in the Google AI Studio or your\n Google Cloud project dashboard.\n- **Optimize your prompts:** If you are making many requests in a short period,\n try to batch your prompts or introduce delays between requests.\n- **Request a quota increase:** If you consistently need a higher limit, you can\n request a quota increase from Google.\n\n### Why am I getting an `ERR_REQUIRE_ESM` error when running `npm run start`?\n\nThis error typically occurs in Node.js projects when there is a mismatch between\nCommonJS and ES Modules.\n\nThis is often due to a misconfiguration in your `package.json` or\n`tsconfig.json`. Ensure that:\n\n1. Your `package.json` has `\"type\": \"module\"`.\n2. Your `tsconfig.json` has `\"module\": \"NodeNext\"` or a compatible setting in\n the `compilerOptions`.\n\nIf the problem persists, try deleting your `node_modules` directory and\n`package-lock.json` file, and then run `npm install` again.\n\n### Why don't I see cached token counts in my stats output?\n\nCached token information is only displayed when cached tokens are being used.\nThis feature is available for API key users (Gemini API key or Google Cloud\nVertex AI) but not for OAuth users (such as Google Personal/Enterprise accounts\nlike Google Gmail or Google Workspace, respectively). This is because the Gemini\nCode Assist API does not support cached content creation. You can still view\nyour total token usage using the `/stats` command in Gemini CLI.\n\n## Installation and updates\n\n### How do I update Gemini CLI to the latest version?\n\nIf you installed it globally via `npm`, update it using the command\n`npm install -g @google/gemini-cli@latest`. If you compiled it from source, pull\nthe latest changes from the repository, and then rebuild using the command\n`npm run build`.\n\n## Platform-specific issues\n\n### Why does the CLI crash on Windows when I run a command like `chmod +x`?\n\nCommands like `chmod` are specific to Unix-like operating systems (Linux,\nmacOS). They are not available on Windows by default.\n\nTo resolve this, you can:\n\n- **Use Windows-equivalent commands:** Instead of `chmod`, you can use `icacls`\n to modify file permissions on Windows.\n- **Use a compatibility layer:** Tools like Git Bash or Windows Subsystem for\n Linux (WSL) provide a Unix-like environment on Windows where these commands\n will work.\n\n## Configuration\n\n### How do I configure my `GOOGLE_CLOUD_PROJECT`?\n\nYou can configure your Google Cloud Project ID using an environment variable.\n\nSet the `GOOGLE_CLOUD_PROJECT` environment variable in your shell:\n\n```bash\nexport GOOGLE_CLOUD_PROJECT=\"your-project-id\"\n```\n\nTo make this setting permanent, add this line to your shell's startup file\n(e.g., `~/.bashrc`, `~/.zshrc`).\n\n### What is the best way to store my API keys securely?\n\nExposing API keys in scripts or checking them into source control is a security\nrisk.\n\nTo store your API keys securely, you can:\n\n- **Use a `.env` file:** Create a `.env` file in your project's `.gemini`\n directory (`.gemini/.env`) and store your keys there. Gemini CLI will\n automatically load these variables.\n- **Use your system's keyring:** For the most secure storage, use your operating\n system's secret management tool (like macOS Keychain, Windows Credential\n Manager, or a secret manager on Linux). You can then have your scripts or\n environment load the key from the secure storage at runtime.\n\n### Where are the Gemini CLI configuration and settings files stored?\n\nThe Gemini CLI configuration is stored in two `settings.json` files:\n\n1. In your home directory: `~/.gemini/settings.json`.\n2. In your project's root directory: `./.gemini/settings.json`.\n\nRefer to [Gemini CLI Configuration](/docs/get-started/configuration) for more\ndetails.\n\n## Google AI Pro/Ultra and subscription FAQs\n\n### Where can I learn more about my Google AI Pro or Google AI Ultra subscription?\n\nTo learn more about your Google AI Pro or Google AI Ultra subscription, visit\n**Manage subscription** in your [subscription settings](https://one.google.com).\n\n### How do I know if I have higher limits for Google AI Pro or Ultra?\n\nIf you're subscribed to Google AI Pro or Ultra, you automatically have higher\nlimits to Gemini Code Assist and Gemini CLI. These are shared across Gemini CLI\nand agent mode in the IDE. You can confirm you have higher limits by checking if\nyou are still subscribed to Google AI Pro or Ultra in your\n[subscription settings](https://one.google.com).\n\n### What is the privacy policy for using Gemini Code Assist or Gemini CLI if I've subscribed to Google AI Pro or Ultra?\n\nTo learn more about your privacy policy and terms of service governed by your\nsubscription, visit\n[Gemini Code Assist: Terms of Service and Privacy Policies](https://developers.google.com/gemini-code-assist/resources/privacy-notices).\n\n### I've upgraded to Google AI Pro or Ultra but it still says I am hitting quota limits. Is this a bug?\n\nThe higher limits in your Google AI Pro or Ultra subscription are for Gemini 2.5\nacross both Gemini 2.5 Pro and Flash. They are shared quota across Gemini CLI\nand agent mode in Gemini Code Assist IDE extensions. You can learn more about\nquota limits for Gemini CLI, Gemini Code Assist and agent mode in Gemini Code\nAssist at\n[Quotas and limits](https://developers.google.com/gemini-code-assist/resources/quotas).\n\n### If I upgrade to higher limits for Gemini CLI and Gemini Code Assist by purchasing a Google AI Pro or Ultra subscription, will Gemini start using my data to improve its machine learning models?\n\nGoogle does not use your data to improve Google's machine learning models if you\npurchase a paid plan. Note: If you decide to remain on the free version of\nGemini Code Assist, Gemini Code Assist for individuals, you can also opt out of\nusing your data to improve Google's machine learning models. See the\n[Gemini Code Assist for individuals privacy notice](https://developers.google.com/gemini-code-assist/resources/privacy-notice-gemini-code-assist-individuals)\nfor more information.\n\n## Not seeing your question?\n\nSearch the\n[Gemini CLI Q&A discussions on GitHub](https://github.com/google-gemini/gemini-cli/discussions/categories/q-a)\nor\n[start a new discussion on GitHub](https://github.com/google-gemini/gemini-cli/discussions/new?category=q-a)\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7028,"content_sha256":"1c7383602c6741cb0f0b5bb039b7b988bef0a9c0565c79e8961159f9508de110"},{"filename":"canonical/geminicli-com/docs/get-started.md","content":"---\nsource_url: http://geminicli.com/docs/get-started\nsource_type: llms-txt\ncontent_hash: sha256:ff6cdec93ec3ac4e7e2e7f8ece121d8aec52a528ca09c1227641baa3bd748ace\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"561b529326241903e6337dc9e9bc3f96535f6cd252d054dc7d1f1b9d268fd272\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Get started with Gemini CLI\n\nWelcome to Gemini CLI! This guide will help you install, configure, and start\nusing the Gemini CLI to enhance your workflow right from your terminal.\n\n## Quickstart: Install, authenticate, configure, and use Gemini CLI\n\nGemini CLI brings the power of advanced language models directly to your command\nline interface. As an AI-powered assistant, Gemini CLI can help you with a\nvariety of tasks, from understanding and generating code to reviewing and\nediting documents.\n\n## Install\n\nThe standard method to install and run Gemini CLI uses `npm`:\n\n```bash\nnpm install -g @google/gemini-cli\n```\n\nOnce Gemini CLI is installed, run Gemini CLI from your command line:\n\n```bash\ngemini\n```\n\nFor more installation options, see [Gemini CLI Installation](/docs/get-started/installation).\n\n## Authenticate\n\nTo begin using Gemini CLI, you must authenticate with a Google service. In most\ncases, you can log in with your existing Google account:\n\n1. Run Gemini CLI after installation:\n\n ```bash\n gemini\n ```\n\n2. When asked \"How would you like to authenticate for this project?\" select **1.\n Sign in with Google**.\n\n3. Select your Google account.\n\n4. Click on **Sign in**.\n\nCertain account types may require you to configure a Google Cloud project. For\nmore information, including other authentication methods, see\n[Gemini CLI Authentication Setup](/docs/get-started/authentication).\n\n## Configure\n\nGemini CLI offers several ways to configure its behavior, including environment\nvariables, command-line arguments, and settings files.\n\nTo explore your configuration options, see\n[Gemini CLI Configuration](/docs/reference/configuration).\n\n## Use\n\nOnce installed and authenticated, you can start using Gemini CLI by issuing\ncommands and prompts in your terminal. Ask it to generate code, explain files,\nand more.\n\nTo explore the power of Gemini CLI, see [Gemini CLI examples](/docs/get-started/examples).\n\n## Check usage and quota\n\nYou can check your current token usage and quota information using the\n`/stats model` command. This command provides a snapshot of your current\nsession's token usage, as well as your overall quota and usage for the supported\nmodels.\n\nFor more information on the `/stats` command and its subcommands, see the\n[Command Reference](/docs/reference/commands#stats).\n\n## Next steps\n\n- Follow the [File management](/docs/cli/tutorials/file-management) guide to\n start working with your codebase.\n- See [Shell commands](/docs/cli/tutorials/shell-commands) to learn about\n terminal integration.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2888,"content_sha256":"ecfb5f30366a61d8116e716afc6720b05c203430725b4817a19b3ba104d98dd7"},{"filename":"canonical/geminicli-com/docs/get-started/authentication.md","content":"---\nsource_url: http://geminicli.com/docs/get-started/authentication\nsource_type: llms-txt\ncontent_hash: sha256:0422b629596a593a5617cceefa0a8db3228d1155c362d5f8f955428abfd414b7\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"8b56f54f2eb98032532f548db80005d002baaf57d404b36f0b6c4162f925520e\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Gemini CLI authentication setup\n\nTo use Gemini CLI, you'll need to authenticate with Google. This guide helps you\nquickly find the best way to sign in based on your account type and how you're\nusing the CLI.\n\n\u003c!-- prettier-ignore -->\n> [!TIP]\n> Looking for a high-level comparison of all available subscriptions?\n> To compare features and find the right quota for your needs, see our\n> [Plans page](https://geminicli.com/plans/).\n\nFor most users, we recommend starting Gemini CLI and logging in with your\npersonal Google account.\n\n## Choose your authentication method \u003ca id=\"auth-methods\">\u003c/a>\n\nSelect the authentication method that matches your situation in the table below:\n\n| User Type / Scenario | Recommended Authentication Method | Google Cloud Project Required |\n| :--------------------------------------------------------------------- | :--------------------------------------------------------------- | :---------------------------------------------------------- |\n| Individual Google accounts | [Sign in with Google](#login-google) | No, with exceptions |\n| Organization users with a company, school, or Google Workspace account | [Sign in with Google](#login-google) | [Yes](#set-gcp) |\n| AI Studio user with a Gemini API key | [Use Gemini API Key](#gemini-api) | No |\n| Google Cloud Vertex AI user | [Vertex AI](#vertex-ai) | [Yes](#set-gcp) |\n| [Headless mode](#headless) | [Use Gemini API Key](#gemini-api) or\u003cbr> [Vertex AI](#vertex-ai) | No (for Gemini API Key)\u003cbr> [Yes](#set-gcp) (for Vertex AI) |\n\n### What is my Google account type?\n\n- **Individual Google accounts:** Includes all\n [free tier accounts](/docs/resources/quota-and-pricing#free-usage) such as\n Gemini Code Assist for individuals, as well as paid subscriptions for\n [Google AI Pro and Ultra](https://gemini.google/subscriptions/).\n\n- **Organization accounts:** Accounts using paid licenses through an\n organization such as a company, school, or\n [Google Workspace](https://workspace.google.com/). Includes\n [Google AI Ultra for Business](https://support.google.com/a/answer/16345165)\n subscriptions.\n\n## (Recommended) Sign in with Google \u003ca id=\"login-google\">\u003c/a>\n\nIf you run Gemini CLI on your local machine, the simplest authentication method\nis logging in with your Google account. This method requires a web browser on a\nmachine that can communicate with the terminal running Gemini CLI (for example,\nyour local machine).\n\nIf you are a **Google AI Pro** or **Google AI Ultra** subscriber, use the Google\naccount associated with your subscription.\n\nTo authenticate and use Gemini CLI:\n\n1. Start the CLI:\n\n ```bash\n gemini\n ```\n\n2. Select **Sign in with Google**. Gemini CLI opens a sign in prompt using your\n web browser. Follow the on-screen instructions. Your credentials will be\n cached locally for future sessions.\n\n### Do I need to set my Google Cloud project?\n\nMost individual Google accounts (free and paid) don't require a Google Cloud\nproject for authentication. However, you'll need to set a Google Cloud project\nwhen you meet at least one of the following conditions:\n\n- You are using a company, school, or Google Workspace account.\n- You are using a Gemini Code Assist license from the Google Developer Program.\n- You are using a license from a Gemini Code Assist subscription.\n\nFor instructions, see [Set your Google Cloud Project](#set-gcp).\n\n## Use Gemini API key \u003ca id=\"gemini-api\">\u003c/a>\n\nIf you don't want to authenticate using your Google account, you can use an API\nkey from Google AI Studio.\n\nTo authenticate and use Gemini CLI with a Gemini API key:\n\n1. Obtain your API key from\n [Google AI Studio](https://aistudio.google.com/app/apikey).\n\n2. Set the `GEMINI_API_KEY` environment variable to your key. For example:\n\n **macOS/Linux**\n\n ```bash\n # Replace YOUR_GEMINI_API_KEY with the key from AI Studio\n export GEMINI_API_KEY=\"YOUR_GEMINI_API_KEY\"\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n # Replace YOUR_GEMINI_API_KEY with the key from AI Studio\n $env:GEMINI_API_KEY=\"YOUR_GEMINI_API_KEY\"\n ```\n\n To make this setting persistent, see\n [Persisting Environment Variables](#persisting-vars).\n\n3. Start the CLI:\n\n ```bash\n gemini\n ```\n\n4. Select **Use Gemini API key**.\n\n\u003c!-- prettier-ignore -->\n> [!WARNING]\n> Treat API keys, especially for services like Gemini, as sensitive\n> credentials. Protect them to prevent unauthorized access and potential misuse\n> of the service under your account.\n\n## Use Vertex AI \u003ca id=\"vertex-ai\">\u003c/a>\n\nTo use Gemini CLI with Google Cloud's Vertex AI platform, choose from the\nfollowing authentication options:\n\n- A. Application Default Credentials (ADC) using `gcloud`.\n- B. Service account JSON key.\n- C. Google Cloud API key.\n\nRegardless of your authentication method for Vertex AI, you'll need to set\n`GOOGLE_CLOUD_PROJECT` to your Google Cloud project ID with the Vertex AI API\nenabled, and `GOOGLE_CLOUD_LOCATION` to the location of your Vertex AI resources\nor the location where you want to run your jobs.\n\nFor example:\n\n**macOS/Linux**\n\n```bash\n# Replace with your project ID and desired location (for example, us-central1)\nexport GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"\nexport GOOGLE_CLOUD_LOCATION=\"YOUR_PROJECT_LOCATION\"\n```\n\n**Windows (PowerShell)**\n\n```powershell\n# Replace with your project ID and desired location (for example, us-central1)\n$env:GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"\n$env:GOOGLE_CLOUD_LOCATION=\"YOUR_PROJECT_LOCATION\"\n```\n\nTo make any Vertex AI environment variable settings persistent, see\n[Persisting Environment Variables](#persisting-vars).\n\n#### A. Vertex AI - application default credentials (ADC) using `gcloud`\n\nConsider this authentication method if you have Google Cloud CLI installed.\n\nIf you have previously set `GOOGLE_API_KEY` or `GEMINI_API_KEY`, you must unset\nthem to use ADC.\n\n**macOS/Linux**\n\n```bash\nunset GOOGLE_API_KEY GEMINI_API_KEY\n```\n\n**Windows (PowerShell)**\n\n```powershell\nRemove-Item Env:\\GOOGLE_API_KEY, Env:\\GEMINI_API_KEY -ErrorAction Ignore\n```\n\n1. Verify you have a Google Cloud project and Vertex AI API is enabled.\n\n2. Log in to Google Cloud:\n\n ```bash\n gcloud auth application-default login\n ```\n\n3. [Configure your Google Cloud Project](#set-gcp).\n\n4. Start the CLI:\n\n ```bash\n gemini\n ```\n\n5. Select **Vertex AI**.\n\n#### B. Vertex AI - service account JSON key\n\nConsider this method of authentication in non-interactive environments, CI/CD\npipelines, or if your organization restricts user-based ADC or API key creation.\n\nIf you have previously set `GOOGLE_API_KEY` or `GEMINI_API_KEY`, you must unset\nthem:\n\n**macOS/Linux**\n\n```bash\nunset GOOGLE_API_KEY GEMINI_API_KEY\n```\n\n**Windows (PowerShell)**\n\n```powershell\nRemove-Item Env:\\GOOGLE_API_KEY, Env:\\GEMINI_API_KEY -ErrorAction Ignore\n```\n\n1. [Create a service account and key](https://cloud.google.com/iam/docs/keys-create-delete)\n and download the provided JSON file. Assign the \"Vertex AI User\" role to the\n service account.\n\n2. Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the JSON\n file's absolute path. For example:\n\n **macOS/Linux**\n\n ```bash\n # Replace /path/to/your/keyfile.json with the actual path\n export GOOGLE_APPLICATION_CREDENTIALS=\"/path/to/your/keyfile.json\"\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n # Replace C:\\path\\to\\your\\keyfile.json with the actual path\n $env:GOOGLE_APPLICATION_CREDENTIALS=\"C:\\path\\to\\your\\keyfile.json\"\n ```\n\n3. [Configure your Google Cloud Project](#set-gcp).\n\n4. Start the CLI:\n\n ```bash\n gemini\n ```\n\n5. Select **Vertex AI**.\n\n\u003c!-- prettier-ignore -->\n> [!WARNING]\n> Protect your service account key file as it gives access to\n> your resources.\n\n#### C. Vertex AI - Google Cloud API key\n\n1. Obtain a Google Cloud API key:\n [Get an API Key](https://cloud.google.com/vertex-ai/generative-ai/docs/start/api-keys?usertype=newuser).\n\n2. Set the `GOOGLE_API_KEY` environment variable:\n\n **macOS/Linux**\n\n ```bash\n # Replace YOUR_GOOGLE_API_KEY with your Vertex AI API key\n export GOOGLE_API_KEY=\"YOUR_GOOGLE_API_KEY\"\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n # Replace YOUR_GOOGLE_API_KEY with your Vertex AI API key\n $env:GOOGLE_API_KEY=\"YOUR_GOOGLE_API_KEY\"\n ```\n\n If you see errors like `\"API keys are not supported by this API...\"`, your\n organization might restrict API key usage for this service. Try the other\n Vertex AI authentication methods instead.\n\n3. [Configure your Google Cloud Project](#set-gcp).\n\n4. Start the CLI:\n\n ```bash\n gemini\n ```\n\n5. Select **Vertex AI**.\n\n## Set your Google Cloud project \u003ca id=\"set-gcp\">\u003c/a>\n\n\u003c!-- prettier-ignore -->\n> [!IMPORTANT]\n> Most individual Google accounts (free and paid) don't require a\n> Google Cloud project for authentication.\n\nWhen you sign in using your Google account, you may need to configure a Google\nCloud project for Gemini CLI to use. This applies when you meet at least one of\nthe following conditions:\n\n- You are using a Company, School, or Google Workspace account.\n- You are using a Gemini Code Assist license from the Google Developer Program.\n- You are using a license from a Gemini Code Assist subscription.\n\nTo configure Gemini CLI to use a Google Cloud project, do the following:\n\n1. [Find your Google Cloud Project ID](https://support.google.com/googleapi/answer/7014113).\n\n2. [Enable the Gemini for Cloud API](https://cloud.google.com/gemini/docs/discover/set-up-gemini#enable-api).\n\n3. [Configure necessary IAM access permissions](https://cloud.google.com/gemini/docs/discover/set-up-gemini#grant-iam).\n\n4. Configure your environment variables. Set either the `GOOGLE_CLOUD_PROJECT`\n or `GOOGLE_CLOUD_PROJECT_ID` variable to the project ID to use with Gemini\n CLI. Gemini CLI checks for `GOOGLE_CLOUD_PROJECT` first, then falls back to\n `GOOGLE_CLOUD_PROJECT_ID`.\n\n For example, to set the `GOOGLE_CLOUD_PROJECT_ID` variable:\n\n **macOS/Linux**\n\n ```bash\n # Replace YOUR_PROJECT_ID with your actual Google Cloud project ID\n export GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n # Replace YOUR_PROJECT_ID with your actual Google Cloud project ID\n $env:GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"\n ```\n\n To make this setting persistent, see\n [Persisting Environment Variables](#persisting-vars).\n\n## Persisting environment variables \u003ca id=\"persisting-vars\">\u003c/a>\n\nTo avoid setting environment variables for every terminal session, you can\npersist them with the following methods:\n\n1. **Add your environment variables to your shell configuration file:** Append\n the environment variable commands to your shell's startup file.\n\n **macOS/Linux** (for example, `~/.bashrc`, `~/.zshrc`, or `~/.profile`):\n\n ```bash\n echo 'export GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"' >> ~/.bashrc\n source ~/.bashrc\n ```\n\n **Windows (PowerShell)** (for example, `$PROFILE`):\n\n ```powershell\n Add-Content -Path $PROFILE -Value '$env:GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"'\n . $PROFILE\n ```\n\n\u003c!-- prettier-ignore -->\n> [!WARNING]\n> Be aware that when you export API keys or service account\n> paths in your shell configuration file, any process launched from that\n> shell can read them.\n\n2. **Use a `.env` file:** Create a `.gemini/.env` file in your project\n directory or home directory. Gemini CLI automatically loads variables from\n the first `.env` file it finds, searching up from the current directory,\n then in your home directory's `.gemini/.env` (for example, `~/.gemini/.env`\n or `%USERPROFILE%\\.gemini\\.env`).\n\n Example for user-wide settings:\n\n **macOS/Linux**\n\n ```bash\n mkdir -p ~/.gemini\n cat >> ~/.gemini/.env \u003c\u003c'EOF'\n GOOGLE_CLOUD_PROJECT=\"your-project-id\"\n # Add other variables like GEMINI_API_KEY as needed\n EOF\n ```\n\n **Windows (PowerShell)**\n\n ```powershell\n New-Item -ItemType Directory -Force -Path \"$env:USERPROFILE\\.gemini\"\n @\"\n GOOGLE_CLOUD_PROJECT=\"your-project-id\"\n # Add other variables like GEMINI_API_KEY as needed\n \"@ | Out-File -FilePath \"$env:USERPROFILE\\.gemini\\.env\" -Encoding utf8 -Append\n ```\n\nVariables are loaded from the first file found, not merged.\n\n## Running in Google Cloud environments \u003ca id=\"cloud-env\">\u003c/a>\n\nWhen running Gemini CLI within certain Google Cloud environments, authentication\nis automatic.\n\nIn a Google Cloud Shell environment, Gemini CLI typically authenticates\nautomatically using your Cloud Shell credentials. In Compute Engine\nenvironments, Gemini CLI automatically uses Application Default Credentials\n(ADC) from the environment's metadata server.\n\nIf automatic authentication fails, use one of the interactive methods described\non this page.\n\n## Running in headless mode \u003ca id=\"headless\">\u003c/a>\n\n[Headless mode](/docs/cli/headless) will use your existing authentication method,\nif an existing authentication credential is cached.\n\nIf you have not already signed in with an authentication credential, you must\nconfigure authentication using environment variables:\n\n- [Use Gemini API Key](#gemini-api)\n- [Vertex AI](#vertex-ai)\n\n## What's next?\n\nYour authentication method affects your quotas, pricing, Terms of Service, and\nprivacy notices. Review the following pages to learn more:\n\n- [Gemini CLI: Quotas and Pricing](/docs/resources/quota-and-pricing).\n- [Gemini CLI: Terms of Service and Privacy Notice](/docs/resources/tos-privacy).\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":14406,"content_sha256":"e3792ef09954e088c3cb133336a2c9dab9514cdf532403ab34103bc4e8543b3b"},{"filename":"canonical/geminicli-com/docs/get-started/configuration-v1.md","content":"---\nsource_url: https://geminicli.com/docs/get-started/configuration-v1\nsource_type: llms-txt\ncontent_hash: sha256:ea53553ecf9b7d703aa1ab961f4b1f04a9d732fd95ce4a837a495eb0d63b9b30\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"bfcc6331de261b901aa1089d49c239b72bcbfe3578fa5ed351afea43036546c3\"'\nlast_modified: '2026-02-13T20:13:35Z'\n---\n\n# Gemini CLI configuration\n\n**Note on deprecated configuration format**\n\nThis document describes the legacy v1 format for the `settings.json` file. This\nformat is now deprecated.\n\n- The new format will be supported in the stable release starting\n **[09/10/25]**.\n- Automatic migration from the old format to the new format will begin on\n **[09/17/25]**.\n\nFor details on the new, recommended format, please see the\n[current Configuration documentation](/docs/get-started/configuration).\n\nGemini CLI offers several ways to configure its behavior, including environment\nvariables, command-line arguments, and settings files. This document outlines\nthe different configuration methods and available settings.\n\n## Configuration layers\n\nConfiguration is applied in the following order of precedence (lower numbers are\noverridden by higher numbers):\n\n1. **Default values:** Hardcoded defaults within the application.\n2. **System defaults file:** System-wide default settings that can be\n overridden by other settings files.\n3. **User settings file:** Global settings for the current user.\n4. **Project settings file:** Project-specific settings.\n5. **System settings file:** System-wide settings that override all other\n settings files.\n6. **Environment variables:** System-wide or session-specific variables,\n potentially loaded from `.env` files.\n7. **Command-line arguments:** Values passed when launching the CLI.\n\n## Settings files\n\nGemini CLI uses JSON settings files for persistent configuration. There are four\nlocations for these files:\n\n- **System defaults file:**\n - **Location:** `/etc/gemini-cli/system-defaults.json` (Linux),\n `C:\\ProgramData\\gemini-cli\\system-defaults.json` (Windows) or\n `/Library/Application Support/GeminiCli/system-defaults.json` (macOS). The\n path can be overridden using the `GEMINI_CLI_SYSTEM_DEFAULTS_PATH`\n environment variable.\n - **Scope:** Provides a base layer of system-wide default settings. These\n settings have the lowest precedence and are intended to be overridden by\n user, project, or system override settings.\n- **User settings file:**\n - **Location:** `~/.gemini/settings.json` (where `~` is your home directory).\n - **Scope:** Applies to all Gemini CLI sessions for the current user. User\n settings override system defaults.\n- **Project settings file:**\n - **Location:** `.gemini/settings.json` within your project's root directory.\n - **Scope:** Applies only when running Gemini CLI from that specific project.\n Project settings override user settings and system defaults.\n- **System settings file:**\n - **Location:** `/etc/gemini-cli/settings.json` (Linux),\n `C:\\ProgramData\\gemini-cli\\settings.json` (Windows) or\n `/Library/Application Support/GeminiCli/settings.json` (macOS). The path can\n be overridden using the `GEMINI_CLI_SYSTEM_SETTINGS_PATH` environment\n variable.\n - **Scope:** Applies to all Gemini CLI sessions on the system, for all users.\n System settings act as overrides, taking precedence over all other settings\n files. May be useful for system administrators at enterprises to have\n controls over users' Gemini CLI setups.\n\n**Note on environment variables in settings:** String values within your\n`settings.json` files can reference environment variables using either\n`$VAR_NAME` or `${VAR_NAME}` syntax. These variables will be automatically\nresolved when the settings are loaded. For example, if you have an environment\nvariable `MY_API_TOKEN`, you could use it in `settings.json` like this:\n`\"apiKey\": \"$MY_API_TOKEN\"`.\n\n> **Note for Enterprise Users:** For guidance on deploying and managing Gemini\n> CLI in a corporate environment, please see the\n> [Enterprise Configuration](/docs/cli/enterprise) documentation.\n\n### The `.gemini` directory in your project\n\nIn addition to a project settings file, a project's `.gemini` directory can\ncontain other project-specific files related to Gemini CLI's operation, such as:\n\n- [Custom sandbox profiles](#sandboxing) (e.g.,\n `.gemini/sandbox-macos-custom.sb`, `.gemini/sandbox.Dockerfile`).\n\n### Available settings in `settings.json`:\n\n- **`contextFileName`** (string or array of strings):\n - **Description:** Specifies the filename for context files (e.g.,\n `GEMINI.md`, `AGENTS.md`). Can be a single filename or a list of accepted\n filenames.\n - **Default:** `GEMINI.md`\n - **Example:** `\"contextFileName\": \"AGENTS.md\"`\n\n- **`bugCommand`** (object):\n - **Description:** Overrides the default URL for the `/bug` command.\n - **Default:**\n `\"urlTemplate\": \"https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml&title={title}&info={info}\"`\n - **Properties:**\n - **`urlTemplate`** (string): A URL that can contain `{title}` and `{info}`\n placeholders.\n - **Example:**\n ```json\n \"bugCommand\": {\n \"urlTemplate\": \"https://bug.example.com/new?title={title}&info={info}\"\n }\n ```\n\n- **`fileFiltering`** (object):\n - **Description:** Controls git-aware file filtering behavior for @ commands\n and file discovery tools.\n - **Default:** `\"respectGitIgnore\": true, \"enableRecursiveFileSearch\": true`\n - **Properties:**\n - **`respectGitIgnore`** (boolean): Whether to respect .gitignore patterns\n when discovering files. When set to `true`, git-ignored files (like\n `node_modules/`, `dist/`, `.env`) are automatically excluded from @\n commands and file listing operations.\n - **`enableRecursiveFileSearch`** (boolean): Whether to enable searching\n recursively for filenames under the current tree when completing @\n prefixes in the prompt.\n - **`disableFuzzySearch`** (boolean): When `true`, disables the fuzzy search\n capabilities when searching for files, which can improve performance on\n projects with a large number of files.\n - **Example:**\n ```json\n \"fileFiltering\": {\n \"respectGitIgnore\": true,\n \"enableRecursiveFileSearch\": false,\n \"disableFuzzySearch\": true\n }\n ```\n\n### Troubleshooting file search performance\n\nIf you are experiencing performance issues with file searching (e.g., with `@`\ncompletions), especially in projects with a very large number of files, here are\na few things you can try in order of recommendation:\n\n1. **Use `.geminiignore`:** Create a `.geminiignore` file in your project root\n to exclude directories that contain a large number of files that you don't\n need to reference (e.g., build artifacts, logs, `node_modules`). Reducing\n the total number of files crawled is the most effective way to improve\n performance.\n\n2. **Disable fuzzy search:** If ignoring files is not enough, you can disable\n fuzzy search by setting `disableFuzzySearch` to `true` in your\n `settings.json` file. This will use a simpler, non-fuzzy matching algorithm,\n which can be faster.\n\n3. **Disable recursive file search:** As a last resort, you can disable\n recursive file search entirely by setting `enableRecursiveFileSearch` to\n `false`. This will be the fastest option as it avoids a recursive crawl of\n your project. However, it means you will need to type the full path to files\n when using `@` completions.\n\n- **`coreTools`** (array of strings):\n - **Description:** Allows you to specify a list of core tool names that should\n be made available to the model. This can be used to restrict the set of\n built-in tools. See [Built-in Tools](/docs/core/tools-api#built-in-tools)\n for a list of core tools. You can also specify command-specific restrictions\n for tools that support it, like the `ShellTool`. For example,\n `\"coreTools\": [\"ShellTool(ls -l)\"]` will only allow the `ls -l` command to\n be executed.\n - **Default:** All tools available for use by the Gemini model.\n - **Example:** `\"coreTools\": [\"ReadFileTool\", \"GlobTool\", \"ShellTool(ls)\"]`.\n\n- **`allowedTools`** (array of strings) [DEPRECATED]:\n - **Default:** `undefined`\n - **Description:** A list of tool names that will bypass the confirmation\n dialog. This is useful for tools that you trust and use frequently. The\n match semantics are the same as `coreTools`. **Deprecated**: Use the\n [Policy Engine](/docs/core/policy-engine) instead.\n - **Example:** `\"allowedTools\": [\"ShellTool(git status)\"]`.\n\n- **`excludeTools`** (array of strings) [DEPRECATED]:\n - **Description:** Allows you to specify a list of core tool names that should\n be excluded from the model. A tool listed in both `excludeTools` and\n `coreTools` is excluded. You can also specify command-specific restrictions\n for tools that support it, like the `ShellTool`. For example,\n `\"excludeTools\": [\"ShellTool(rm -rf)\"]` will block the `rm -rf` command.\n **Deprecated**: Use the [Policy Engine](/docs/core/policy-engine) instead.\n - **Default**: No tools excluded.\n - **Example:** `\"excludeTools\": [\"run_shell_command\", \"findFiles\"]`.\n - **Security Note:** Command-specific restrictions in `excludeTools` for\n `run_shell_command` are based on simple string matching and can be easily\n bypassed. This feature is **not a security mechanism** and should not be\n relied upon to safely execute untrusted code. It is recommended to use\n `coreTools` to explicitly select commands that can be executed.\n\n- **`allowMCPServers`** (array of strings):\n - **Description:** Allows you to specify a list of MCP server names that\n should be made available to the model. This can be used to restrict the set\n of MCP servers to connect to. Note that this will be ignored if\n `--allowed-mcp-server-names` is set.\n - **Default:** All MCP servers are available for use by the Gemini model.\n - **Example:** `\"allowMCPServers\": [\"myPythonServer\"]`.\n - **Security note:** This uses simple string matching on MCP server names,\n which can be modified. If you're a system administrator looking to prevent\n users from bypassing this, consider configuring the `mcpServers` at the\n system settings level such that the user will not be able to configure any\n MCP servers of their own. This should not be used as an airtight security\n mechanism.\n\n- **`excludeMCPServers`** (array of strings):\n - **Description:** Allows you to specify a list of MCP server names that\n should be excluded from the model. A server listed in both\n `excludeMCPServers` and `allowMCPServers` is excluded. Note that this will\n be ignored if `--allowed-mcp-server-names` is set.\n - **Default**: No MCP servers excluded.\n - **Example:** `\"excludeMCPServers\": [\"myNodeServer\"]`.\n - **Security note:** This uses simple string matching on MCP server names,\n which can be modified. If you're a system administrator looking to prevent\n users from bypassing this, consider configuring the `mcpServers` at the\n system settings level such that the user will not be able to configure any\n MCP servers of their own. This should not be used as an airtight security\n mechanism.\n\n- **`theme`** (string):\n - **Description:** Sets the visual [theme](/docs/cli/themes) for Gemini CLI.\n - **Default:** `\"Default\"`\n - **Example:** `\"theme\": \"GitHub\"`\n\n- **`vimMode`** (boolean):\n - **Description:** Enables or disables vim mode for input editing. When\n enabled, the input area supports vim-style navigation and editing commands\n with NORMAL and INSERT modes. The vim mode status is displayed in the footer\n and persists between sessions.\n - **Default:** `false`\n - **Example:** `\"vimMode\": true`\n\n- **`sandbox`** (boolean or string):\n - **Description:** Controls whether and how to use sandboxing for tool\n execution. If set to `true`, Gemini CLI uses a pre-built\n `gemini-cli-sandbox` Docker image. For more information, see\n [Sandboxing](#sandboxing).\n - **Default:** `false`\n - **Example:** `\"sandbox\": \"docker\"`\n\n- **`toolDiscoveryCommand`** (string):\n - **Description:** Defines a custom shell command for discovering tools from\n your project. The shell command must return on `stdout` a JSON array of\n [function declarations](https://ai.google.dev/gemini-api/docs/function-calling#function-declarations).\n Tool wrappers are optional.\n - **Default:** Empty\n - **Example:** `\"toolDiscoveryCommand\": \"bin/get_tools\"`\n\n- **`toolCallCommand`** (string):\n - **Description:** Defines a custom shell command for calling a specific tool\n that was discovered using `toolDiscoveryCommand`. The shell command must\n meet the following criteria:\n - It must take function `name` (exactly as in\n [function declaration](https://ai.google.dev/gemini-api/docs/function-calling#function-declarations))\n as first command line argument.\n - It must read function arguments as JSON on `stdin`, analogous to\n [`functionCall.args`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#functioncall).\n - It must return function output as JSON on `stdout`, analogous to\n [`functionResponse.response.content`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#functionresponse).\n - **Default:** Empty\n - **Example:** `\"toolCallCommand\": \"bin/call_tool\"`\n\n- **`mcpServers`** (object):\n - **Description:** Configures connections to one or more Model-Context\n Protocol (MCP) servers for discovering and using custom tools. Gemini CLI\n attempts to connect to each configured MCP server to discover available\n tools. If multiple MCP servers expose a tool with the same name, the tool\n names will be prefixed with the server alias you defined in the\n configuration (e.g., `serverAlias__actualToolName`) to avoid conflicts. Note\n that the system might strip certain schema properties from MCP tool\n definitions for compatibility. At least one of `command`, `url`, or\n `httpUrl` must be provided. If multiple are specified, the order of\n precedence is `httpUrl`, then `url`, then `command`.\n - **Default:** Empty\n - **Properties:**\n - **`\u003cSERVER_NAME>`** (object): The server parameters for the named server.\n - `command` (string, optional): The command to execute to start the MCP\n server via standard I/O.\n - `args` (array of strings, optional): Arguments to pass to the command.\n - `env` (object, optional): Environment variables to set for the server\n process.\n - `cwd` (string, optional): The working directory in which to start the\n server.\n - `url` (string, optional): The URL of an MCP server that uses Server-Sent\n Events (SSE) for communication.\n - `httpUrl` (string, optional): The URL of an MCP server that uses\n streamable HTTP for communication.\n - `headers` (object, optional): A map of HTTP headers to send with\n requests to `url` or `httpUrl`.\n - `timeout` (number, optional): Timeout in milliseconds for requests to\n this MCP server.\n - `trust` (boolean, optional): Trust this server and bypass all tool call\n confirmations.\n - `description` (string, optional): A brief description of the server,\n which may be used for display purposes.\n - `includeTools` (array of strings, optional): List of tool names to\n include from this MCP server. When specified, only the tools listed here\n will be available from this server (allowlist behavior). If not\n specified, all tools from the server are enabled by default.\n - `excludeTools` (array of strings, optional): List of tool names to\n exclude from this MCP server. Tools listed here will not be available to\n the model, even if they are exposed by the server. **Note:**\n `excludeTools` takes precedence over `includeTools` - if a tool is in\n both lists, it will be excluded.\n - **Example:**\n ```json\n \"mcpServers\": {\n \"myPythonServer\": {\n \"command\": \"python\",\n \"args\": [\"mcp_server.py\", \"--port\", \"8080\"],\n \"cwd\": \"./mcp_tools/python\",\n \"timeout\": 5000,\n \"includeTools\": [\"safe_tool\", \"file_reader\"],\n },\n \"myNodeServer\": {\n \"command\": \"node\",\n \"args\": [\"mcp_server.js\"],\n \"cwd\": \"./mcp_tools/node\",\n \"excludeTools\": [\"dangerous_tool\", \"file_deleter\"]\n },\n \"myDockerServer\": {\n \"command\": \"docker\",\n \"args\": [\"run\", \"-i\", \"--rm\", \"-e\", \"API_KEY\", \"ghcr.io/foo/bar\"],\n \"env\": {\n \"API_KEY\": \"$MY_API_TOKEN\"\n }\n },\n \"mySseServer\": {\n \"url\": \"http://localhost:8081/events\",\n \"headers\": {\n \"Authorization\": \"Bearer $MY_SSE_TOKEN\"\n },\n \"description\": \"An example SSE-based MCP server.\"\n },\n \"myStreamableHttpServer\": {\n \"httpUrl\": \"http://localhost:8082/stream\",\n \"headers\": {\n \"X-API-Key\": \"$MY_HTTP_API_KEY\"\n },\n \"description\": \"An example Streamable HTTP-based MCP server.\"\n }\n }\n ```\n\n- **`checkpointing`** (object):\n - **Description:** Configures the checkpointing feature, which allows you to\n save and restore conversation and file states. See the\n [Checkpointing documentation](/docs/cli/checkpointing) for more details.\n - **Default:** `{\"enabled\": false}`\n - **Properties:**\n - **`enabled`** (boolean): When `true`, the `/restore` command is available.\n\n- **`preferredEditor`** (string):\n - **Description:** Specifies the preferred editor to use for viewing diffs.\n - **Default:** `vscode`\n - **Example:** `\"preferredEditor\": \"vscode\"`\n\n- **`telemetry`** (object)\n - **Description:** Configures logging and metrics collection for Gemini CLI.\n For more information, see [Telemetry](/docs/cli/telemetry).\n - **Default:**\n `{\"enabled\": false, \"target\": \"local\", \"otlpEndpoint\": \"http://localhost:4317\", \"logPrompts\": true}`\n - **Properties:**\n - **`enabled`** (boolean): Whether or not telemetry is enabled.\n - **`target`** (string): The destination for collected telemetry. Supported\n values are `local` and `gcp`.\n - **`otlpEndpoint`** (string): The endpoint for the OTLP Exporter.\n - **`logPrompts`** (boolean): Whether or not to include the content of user\n prompts in the logs.\n - **Example:**\n ```json\n \"telemetry\": {\n \"enabled\": true,\n \"target\": \"local\",\n \"otlpEndpoint\": \"http://localhost:16686\",\n \"logPrompts\": false\n }\n ```\n- **`usageStatisticsEnabled`** (boolean):\n - **Description:** Enables or disables the collection of usage statistics. See\n [Usage Statistics](#usage-statistics) for more information.\n - **Default:** `true`\n - **Example:**\n ```json\n \"usageStatisticsEnabled\": false\n ```\n\n- **`hideTips`** (boolean):\n - **Description:** Enables or disables helpful tips in the CLI interface.\n - **Default:** `false`\n - **Example:**\n\n ```json\n \"hideTips\": true\n ```\n\n- **`hideBanner`** (boolean):\n - **Description:** Enables or disables the startup banner (ASCII art logo) in\n the CLI interface.\n - **Default:** `false`\n - **Example:**\n\n ```json\n \"hideBanner\": true\n ```\n\n- **`maxSessionTurns`** (number):\n - **Description:** Sets the maximum number of turns for a session. If the\n session exceeds this limit, the CLI will stop processing and start a new\n chat.\n - **Default:** `-1` (unlimited)\n - **Example:**\n ```json\n \"maxSessionTurns\": 10\n ```\n\n- **`summarizeToolOutput`** (object):\n - **Description:** Enables or disables the summarization of tool output. You\n can specify the token budget for the summarization using the `tokenBudget`\n setting.\n - Note: Currently only the `run_shell_command` tool is supported.\n - **Default:** `{}` (Disabled by default)\n - **Example:**\n ```json\n \"summarizeToolOutput\": {\n \"run_shell_command\": {\n \"tokenBudget\": 2000\n }\n }\n ```\n\n- **`excludedProjectEnvVars`** (array of strings):\n - **Description:** Specifies environment variables that should be excluded\n from being loaded from project `.env` files. This prevents project-specific\n environment variables (like `DEBUG=true`) from interfering with gemini-cli\n behavior. Variables from `.gemini/.env` files are never excluded.\n - **Default:** `[\"DEBUG\", \"DEBUG_MODE\"]`\n - **Example:**\n ```json\n \"excludedProjectEnvVars\": [\"DEBUG\", \"DEBUG_MODE\", \"NODE_ENV\"]\n ```\n\n- **`includeDirectories`** (array of strings):\n - **Description:** Specifies an array of additional absolute or relative paths\n to include in the workspace context. Missing directories will be skipped\n with a warning by default. Paths can use `~` to refer to the user's home\n directory. This setting can be combined with the `--include-directories`\n command-line flag.\n - **Default:** `[]`\n - **Example:**\n ```json\n \"includeDirectories\": [\n \"/path/to/another/project\",\n \"../shared-library\",\n \"~/common-utils\"\n ]\n ```\n\n- **`loadMemoryFromIncludeDirectories`** (boolean):\n - **Description:** Controls the behavior of the `/memory refresh` command. If\n set to `true`, `GEMINI.md` files should be loaded from all directories that\n are added. If set to `false`, `GEMINI.md` should only be loaded from the\n current directory.\n - **Default:** `false`\n - **Example:**\n ```json\n \"loadMemoryFromIncludeDirectories\": true\n ```\n\n- **`showLineNumbers`** (boolean):\n - **Description:** Controls whether line numbers are displayed in code blocks\n in the CLI output.\n - **Default:** `true`\n - **Example:**\n ```json\n \"showLineNumbers\": false\n ```\n\n- **`accessibility`** (object):\n - **Description:** Configures accessibility features for the CLI.\n - **Properties:**\n - **`screenReader`** (boolean): Enables screen reader mode, which adjusts\n the TUI for better compatibility with screen readers. This can also be\n enabled with the `--screen-reader` command-line flag, which will take\n precedence over the setting.\n - **`disableLoadingPhrases`** (boolean): Disables the display of loading\n phrases during operations.\n - **Default:** `{\"screenReader\": false, \"disableLoadingPhrases\": false}`\n - **Example:**\n ```json\n \"accessibility\": {\n \"screenReader\": true,\n \"disableLoadingPhrases\": true\n }\n ```\n\n### Example `settings.json`:\n\n```json\n{\n \"theme\": \"GitHub\",\n \"sandbox\": \"docker\",\n \"toolDiscoveryCommand\": \"bin/get_tools\",\n \"toolCallCommand\": \"bin/call_tool\",\n \"mcpServers\": {\n \"mainServer\": {\n \"command\": \"bin/mcp_server.py\"\n },\n \"anotherServer\": {\n \"command\": \"node\",\n \"args\": [\"mcp_server.js\", \"--verbose\"]\n }\n },\n \"telemetry\": {\n \"enabled\": true,\n \"target\": \"local\",\n \"otlpEndpoint\": \"http://localhost:4317\",\n \"logPrompts\": true\n },\n \"usageStatisticsEnabled\": true,\n \"hideTips\": false,\n \"hideBanner\": false,\n \"maxSessionTurns\": 10,\n \"summarizeToolOutput\": {\n \"run_shell_command\": {\n \"tokenBudget\": 100\n }\n },\n \"excludedProjectEnvVars\": [\"DEBUG\", \"DEBUG_MODE\", \"NODE_ENV\"],\n \"includeDirectories\": [\"path/to/dir1\", \"~/path/to/dir2\", \"../path/to/dir3\"],\n \"loadMemoryFromIncludeDirectories\": true\n}\n```\n\n## Shell history\n\nThe CLI keeps a history of shell commands you run. To avoid conflicts between\ndifferent projects, this history is stored in a project-specific directory\nwithin your user's home folder.\n\n- **Location:** `~/.gemini/tmp/\u003cproject_hash>/shell_history`\n - `\u003cproject_hash>` is a unique identifier generated from your project's root\n path.\n - The history is stored in a file named `shell_history`.\n\n## Environment variables and `.env` files\n\nEnvironment variables are a common way to configure applications, especially for\nsensitive information like API keys or for settings that might change between\nenvironments. For authentication setup, see the\n[Authentication documentation](/docs/get-started/authentication) which covers all available\nauthentication methods.\n\nThe CLI automatically loads environment variables from an `.env` file. The\nloading order is:\n\n1. `.env` file in the current working directory.\n2. If not found, it searches upwards in parent directories until it finds an\n `.env` file or reaches the project root (identified by a `.git` folder) or\n the home directory.\n3. If still not found, it looks for `~/.env` (in the user's home directory).\n\n**Environment variable exclusion:** Some environment variables (like `DEBUG` and\n`DEBUG_MODE`) are automatically excluded from being loaded from project `.env`\nfiles to prevent interference with gemini-cli behavior. Variables from\n`.gemini/.env` files are never excluded. You can customize this behavior using\nthe `excludedProjectEnvVars` setting in your `settings.json` file.\n\n- **`GEMINI_API_KEY`**:\n - Your API key for the Gemini API.\n - One of several available [authentication methods](/docs/get-started/authentication).\n - Set this in your shell profile (e.g., `~/.bashrc`, `~/.zshrc`) or an `.env`\n file.\n- **`GEMINI_MODEL`**:\n - Specifies the default Gemini model to use.\n - Overrides the hardcoded default\n - Example: `export GEMINI_MODEL=\"gemini-2.5-flash\"`\n- **`GOOGLE_API_KEY`**:\n - Your Google Cloud API key.\n - Required for using Vertex AI in express mode.\n - Ensure you have the necessary permissions.\n - Example: `export GOOGLE_API_KEY=\"YOUR_GOOGLE_API_KEY\"`.\n- **`GOOGLE_CLOUD_PROJECT`**:\n - Your Google Cloud Project ID.\n - Required for using Code Assist or Vertex AI.\n - If using Vertex AI, ensure you have the necessary permissions in this\n project.\n - **Cloud Shell note:** When running in a Cloud Shell environment, this\n variable defaults to a special project allocated for Cloud Shell users. If\n you have `GOOGLE_CLOUD_PROJECT` set in your global environment in Cloud\n Shell, it will be overridden by this default. To use a different project in\n Cloud Shell, you must define `GOOGLE_CLOUD_PROJECT` in a `.env` file.\n - Example: `export GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"`.\n- **`GOOGLE_APPLICATION_CREDENTIALS`** (string):\n - **Description:** The path to your Google Application Credentials JSON file.\n - **Example:**\n `export GOOGLE_APPLICATION_CREDENTIALS=\"/path/to/your/credentials.json\"`\n- **`OTLP_GOOGLE_CLOUD_PROJECT`**:\n - Your Google Cloud Project ID for Telemetry in Google Cloud\n - Example: `export OTLP_GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"`.\n- **`GOOGLE_CLOUD_LOCATION`**:\n - Your Google Cloud Project Location (e.g., us-central1).\n - Required for using Vertex AI in non express mode.\n - Example: `export GOOGLE_CLOUD_LOCATION=\"YOUR_PROJECT_LOCATION\"`.\n- **`GEMINI_SANDBOX`**:\n - Alternative to the `sandbox` setting in `settings.json`.\n - Accepts `true`, `false`, `docker`, `podman`, or a custom command string.\n- **`HTTP_PROXY` / `HTTPS_PROXY`**:\n - Specifies the proxy server to use for outgoing HTTP/HTTPS requests.\n - Example: `export HTTPS_PROXY=\"http://proxy.example.com:8080\"`\n- **`SEATBELT_PROFILE`** (macOS specific):\n - Switches the Seatbelt (`sandbox-exec`) profile on macOS.\n - `permissive-open`: (Default) Restricts writes to the project folder (and a\n few other folders, see\n `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) but allows other\n operations.\n - `strict`: Uses a strict profile that declines operations by default.\n - `\u003cprofile_name>`: Uses a custom profile. To define a custom profile, create\n a file named `sandbox-macos-\u003cprofile_name>.sb` in your project's `.gemini/`\n directory (e.g., `my-project/.gemini/sandbox-macos-custom.sb`).\n- **`DEBUG` or `DEBUG_MODE`** (often used by underlying libraries or the CLI\n itself):\n - Set to `true` or `1` to enable verbose debug logging, which can be helpful\n for troubleshooting.\n - **Note:** These variables are automatically excluded from project `.env`\n files by default to prevent interference with gemini-cli behavior. Use\n `.gemini/.env` files if you need to set these for gemini-cli specifically.\n- **`NO_COLOR`**:\n - Set to any value to disable all color output in the CLI.\n- **`CLI_TITLE`**:\n - Set to a string to customize the title of the CLI.\n- **`CODE_ASSIST_ENDPOINT`**:\n - Specifies the endpoint for the code assist server.\n - This is useful for development and testing.\n\n## Command-line arguments\n\nArguments passed directly when running the CLI can override other configurations\nfor that specific session.\n\n- **`--model \u003cmodel_name>`** (**`-m \u003cmodel_name>`**):\n - Specifies the Gemini model to use for this session.\n - Example: `npm start -- --model gemini-1.5-pro-latest`\n- **`--prompt \u003cyour_prompt>`** (**`-p \u003cyour_prompt>`**):\n - Used to pass a prompt directly to the command. This invokes Gemini CLI in a\n non-interactive mode.\n- **`--prompt-interactive \u003cyour_prompt>`** (**`-i \u003cyour_prompt>`**):\n - Starts an interactive session with the provided prompt as the initial input.\n - The prompt is processed within the interactive session, not before it.\n - Cannot be used when piping input from stdin.\n - Example: `gemini -i \"explain this code\"`\n- **`--sandbox`** (**`-s`**):\n - Enables sandbox mode for this session.\n- **`--sandbox-image`**:\n - Sets the sandbox image URI.\n- **`--debug`** (**`-d`**):\n - Enables debug mode for this session, providing more verbose output.\n\n- **`--help`** (or **`-h`**):\n - Displays help information about command-line arguments.\n- **`--show-memory-usage`**:\n - Displays the current memory usage.\n- **`--yolo`**:\n - Enables YOLO mode, which automatically approves all tool calls.\n- **`--approval-mode \u003cmode>`**:\n - Sets the approval mode for tool calls. Available modes:\n - `default`: Prompt for approval on each tool call (default behavior)\n - `auto_edit`: Automatically approve edit tools (replace, write_file) while\n prompting for others\n - `yolo`: Automatically approve all tool calls (equivalent to `--yolo`)\n - Cannot be used together with `--yolo`. Use `--approval-mode=yolo` instead of\n `--yolo` for the new unified approach.\n - Example: `gemini --approval-mode auto_edit`\n- **`--allowed-tools \u003ctool1,tool2,...>`**:\n - A comma-separated list of tool names that will bypass the confirmation\n dialog.\n - Example: `gemini --allowed-tools \"ShellTool(git status)\"`\n- **`--telemetry`**:\n - Enables [telemetry](/docs/cli/telemetry).\n- **`--telemetry-target`**:\n - Sets the telemetry target. See [telemetry](/docs/cli/telemetry) for more\n information.\n- **`--telemetry-otlp-endpoint`**:\n - Sets the OTLP endpoint for telemetry. See [telemetry](/docs/cli/telemetry)\n for more information.\n- **`--telemetry-otlp-protocol`**:\n - Sets the OTLP protocol for telemetry (`grpc` or `http`). Defaults to `grpc`.\n See [telemetry](/docs/cli/telemetry) for more information.\n- **`--telemetry-log-prompts`**:\n - Enables logging of prompts for telemetry. See\n [telemetry](/docs/cli/telemetry) for more information.\n- **`--extensions \u003cextension_name ...>`** (**`-e \u003cextension_name ...>`**):\n - Specifies a list of extensions to use for the session. If not provided, all\n available extensions are used.\n - Use the special term `gemini -e none` to disable all extensions.\n - Example: `gemini -e my-extension -e my-other-extension`\n- **`--list-extensions`** (**`-l`**):\n - Lists all available extensions and exits.\n- **`--include-directories \u003cdir1,dir2,...>`**:\n - Includes additional directories in the workspace for multi-directory\n support.\n - Can be specified multiple times or as comma-separated values.\n - 5 directories can be added at maximum.\n - Example: `--include-directories /path/to/project1,/path/to/project2` or\n `--include-directories /path/to/project1 --include-directories /path/to/project2`\n- **`--screen-reader`**:\n - Enables screen reader mode for accessibility.\n- **`--version`**:\n - Displays the version of the CLI.\n\n## Context files (hierarchical instructional context)\n\nWhile not strictly configuration for the CLI's _behavior_, context files\n(defaulting to `GEMINI.md` but configurable via the `contextFileName` setting)\nare crucial for configuring the _instructional context_ (also referred to as\n\"memory\") provided to the Gemini model. This powerful feature allows you to give\nproject-specific instructions, coding style guides, or any relevant background\ninformation to the AI, making its responses more tailored and accurate to your\nneeds. The CLI includes UI elements, such as an indicator in the footer showing\nthe number of loaded context files, to keep you informed about the active\ncontext.\n\n- **Purpose:** These Markdown files contain instructions, guidelines, or context\n that you want the Gemini model to be aware of during your interactions. The\n system is designed to manage this instructional context hierarchically.\n\n### Example context file content (e.g., `GEMINI.md`)\n\nHere's a conceptual example of what a context file at the root of a TypeScript\nproject might contain:\n\n```markdown\n# Project: My Awesome TypeScript Library\n\n## General Instructions:\n\n- When generating new TypeScript code, please follow the existing coding style.\n- Ensure all new functions and classes have JSDoc comments.\n- Prefer functional programming paradigms where appropriate.\n- All code should be compatible with TypeScript 5.0 and Node.js 20+.\n\n## Coding Style:\n\n- Use 2 spaces for indentation.\n- Interface names should be prefixed with `I` (e.g., `IUserService`).\n- Private class members should be prefixed with an underscore (`_`).\n- Always use strict equality (`===` and `!==`).\n\n## Specific Component: `src/api/client.ts`\n\n- This file handles all outbound API requests.\n- When adding new API call functions, ensure they include robust error handling\n and logging.\n- Use the existing `fetchWithRetry` utility for all GET requests.\n\n## Regarding Dependencies:\n\n- Avoid introducing new external dependencies unless absolutely necessary.\n- If a new dependency is required, please state the reason.\n```\n\nThis example demonstrates how you can provide general project context, specific\ncoding conventions, and even notes about particular files or components. The\nmore relevant and precise your context files are, the better the AI can assist\nyou. Project-specific context files are highly encouraged to establish\nconventions and context.\n\n- **Hierarchical loading and precedence:** The CLI implements a sophisticated\n hierarchical memory system by loading context files (e.g., `GEMINI.md`) from\n several locations. Content from files lower in this list (more specific)\n typically overrides or supplements content from files higher up (more\n general). The exact concatenation order and final context can be inspected\n using the `/memory show` command. The typical loading order is:\n 1. **Global context file:**\n - Location: `~/.gemini/\u003ccontextFileName>` (e.g., `~/.gemini/GEMINI.md` in\n your user home directory).\n - Scope: Provides default instructions for all your projects.\n 2. **Project root and ancestors context files:**\n - Location: The CLI searches for the configured context file in the\n current working directory and then in each parent directory up to either\n the project root (identified by a `.git` folder) or your home directory.\n - Scope: Provides context relevant to the entire project or a significant\n portion of it.\n 3. **Sub-directory context files (contextual/local):**\n - Location: The CLI also scans for the configured context file in\n subdirectories _below_ the current working directory (respecting common\n ignore patterns like `node_modules`, `.git`, etc.). The breadth of this\n search is limited to 200 directories by default, but can be configured\n with a `memoryDiscoveryMaxDirs` field in your `settings.json` file.\n - Scope: Allows for highly specific instructions relevant to a particular\n component, module, or subsection of your project.\n- **Concatenation and UI indication:** The contents of all found context files\n are concatenated (with separators indicating their origin and path) and\n provided as part of the system prompt to the Gemini model. The CLI footer\n displays the count of loaded context files, giving you a quick visual cue\n about the active instructional context.\n- **Importing content:** You can modularize your context files by importing\n other Markdown files using the `@path/to/file.md` syntax. For more details,\n see the [Memory Import Processor documentation](/docs/core/memport).\n- **Commands for memory management:**\n - Use `/memory refresh` to force a re-scan and reload of all context files\n from all configured locations. This updates the AI's instructional context.\n - Use `/memory show` to display the combined instructional context currently\n loaded, allowing you to verify the hierarchy and content being used by the\n AI.\n - See the [Commands documentation](/docs/cli/commands#memory) for full details\n on the `/memory` command and its sub-commands (`show` and `refresh`).\n\nBy understanding and utilizing these configuration layers and the hierarchical\nnature of context files, you can effectively manage the AI's memory and tailor\nthe Gemini CLI's responses to your specific needs and projects.\n\n## Sandboxing\n\nThe Gemini CLI can execute potentially unsafe operations (like shell commands\nand file modifications) within a sandboxed environment to protect your system.\n\nSandboxing is disabled by default, but you can enable it in a few ways:\n\n- Using `--sandbox` or `-s` flag.\n- Setting `GEMINI_SANDBOX` environment variable.\n- Sandbox is enabled when using `--yolo` or `--approval-mode=yolo` by default.\n\nBy default, it uses a pre-built `gemini-cli-sandbox` Docker image.\n\nFor project-specific sandboxing needs, you can create a custom Dockerfile at\n`.gemini/sandbox.Dockerfile` in your project's root directory. This Dockerfile\ncan be based on the base sandbox image:\n\n```dockerfile\nFROM gemini-cli-sandbox\n\n# Add your custom dependencies or configurations here\n# For example:\n# RUN apt-get update && apt-get install -y some-package\n# COPY ./my-config /app/my-config\n```\n\nWhen `.gemini/sandbox.Dockerfile` exists, you can use `BUILD_SANDBOX`\nenvironment variable when running Gemini CLI to automatically build the custom\nsandbox image:\n\n```bash\nBUILD_SANDBOX=1 gemini -s\n```\n\n## Usage statistics\n\nTo help us improve the Gemini CLI, we collect anonymized usage statistics. This\ndata helps us understand how the CLI is used, identify common issues, and\nprioritize new features.\n\n**What we collect:**\n\n- **Tool calls:** We log the names of the tools that are called, whether they\n succeed or fail, and how long they take to execute. We do not collect the\n arguments passed to the tools or any data returned by them.\n- **API requests:** We log the Gemini model used for each request, the duration\n of the request, and whether it was successful. We do not collect the content\n of the prompts or responses.\n- **Session information:** We collect information about the configuration of the\n CLI, such as the enabled tools and the approval mode.\n\n**What we DON'T collect:**\n\n- **Personally identifiable information (PII):** We do not collect any personal\n information, such as your name, email address, or API keys.\n- **Prompt and response content:** We do not log the content of your prompts or\n the responses from the Gemini model.\n- **File content:** We do not log the content of any files that are read or\n written by the CLI.\n\n**How to opt out:**\n\nYou can opt out of usage statistics collection at any time by setting the\n`usageStatisticsEnabled` property to `false` in your `settings.json` file:\n\n```json\n{\n \"usageStatisticsEnabled\": false\n}\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":39826,"content_sha256":"5c99b3096f27b1d4f35b63edb36cea11f0a75228e212627f5f7308c1d3eb1e62"},{"filename":"canonical/geminicli-com/docs/get-started/configuration.md","content":"---\nsource_url: https://geminicli.com/docs/get-started/configuration\nsource_type: llms-txt\ncontent_hash: sha256:5e0e1d0bd01d620ff278845dc9cdbcae9ef05c3ee5277ea79bd0c20238ab0664\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"bd4559e6dac39c6047119868ea7040d520703baf02831d01dcceb05e1c70d8e5\"'\nlast_modified: '2026-02-13T20:13:35Z'\n---\n\n# Gemini CLI configuration\n\n> **Note on configuration format, 9/17/25:** The format of the `settings.json`\n> file has been updated to a new, more organized structure.\n>\n> - The new format will be supported in the stable release starting\n> **[09/10/25]**.\n> - Automatic migration from the old format to the new format will begin on\n> **[09/17/25]**.\n>\n> For details on the previous format, please see the\n> [v1 Configuration documentation](/docs/get-started/configuration-v1).\n\nGemini CLI offers several ways to configure its behavior, including environment\nvariables, command-line arguments, and settings files. This document outlines\nthe different configuration methods and available settings.\n\n## Configuration layers\n\nConfiguration is applied in the following order of precedence (lower numbers are\noverridden by higher numbers):\n\n1. **Default values:** Hardcoded defaults within the application.\n2. **System defaults file:** System-wide default settings that can be\n overridden by other settings files.\n3. **User settings file:** Global settings for the current user.\n4. **Project settings file:** Project-specific settings.\n5. **System settings file:** System-wide settings that override all other\n settings files.\n6. **Environment variables:** System-wide or session-specific variables,\n potentially loaded from `.env` files.\n7. **Command-line arguments:** Values passed when launching the CLI.\n\n## Settings files\n\nGemini CLI uses JSON settings files for persistent configuration. There are four\nlocations for these files:\n\n> **Tip:** JSON-aware editors can use autocomplete and validation by pointing to\n> the generated schema at `schemas/settings.schema.json` in this repository.\n> When working outside the repo, reference the hosted schema at\n> `https://raw.githubusercontent.com/google-gemini/gemini-cli/main/schemas/settings.schema.json`.\n\n- **System defaults file:**\n - **Location:** `/etc/gemini-cli/system-defaults.json` (Linux),\n `C:\\ProgramData\\gemini-cli\\system-defaults.json` (Windows) or\n `/Library/Application Support/GeminiCli/system-defaults.json` (macOS). The\n path can be overridden using the `GEMINI_CLI_SYSTEM_DEFAULTS_PATH`\n environment variable.\n - **Scope:** Provides a base layer of system-wide default settings. These\n settings have the lowest precedence and are intended to be overridden by\n user, project, or system override settings.\n- **User settings file:**\n - **Location:** `~/.gemini/settings.json` (where `~` is your home directory).\n - **Scope:** Applies to all Gemini CLI sessions for the current user. User\n settings override system defaults.\n- **Project settings file:**\n - **Location:** `.gemini/settings.json` within your project's root directory.\n - **Scope:** Applies only when running Gemini CLI from that specific project.\n Project settings override user settings and system defaults.\n- **System settings file:**\n - **Location:** `/etc/gemini-cli/settings.json` (Linux),\n `C:\\ProgramData\\gemini-cli\\settings.json` (Windows) or\n `/Library/Application Support/GeminiCli/settings.json` (macOS). The path can\n be overridden using the `GEMINI_CLI_SYSTEM_SETTINGS_PATH` environment\n variable.\n - **Scope:** Applies to all Gemini CLI sessions on the system, for all users.\n System settings act as overrides, taking precedence over all other settings\n files. May be useful for system administrators at enterprises to have\n controls over users' Gemini CLI setups.\n\n**Note on environment variables in settings:** String values within your\n`settings.json` and `gemini-extension.json` files can reference environment\nvariables using either `$VAR_NAME` or `${VAR_NAME}` syntax. These variables will\nbe automatically resolved when the settings are loaded. For example, if you have\nan environment variable `MY_API_TOKEN`, you could use it in `settings.json` like\nthis: `\"apiKey\": \"$MY_API_TOKEN\"`. Additionally, each extension can have its own\n`.env` file in its directory, which will be loaded automatically.\n\n> **Note for Enterprise Users:** For guidance on deploying and managing Gemini\n> CLI in a corporate environment, please see the\n> [Enterprise Configuration](/docs/cli/enterprise) documentation.\n\n### The `.gemini` directory in your project\n\nIn addition to a project settings file, a project's `.gemini` directory can\ncontain other project-specific files related to Gemini CLI's operation, such as:\n\n- [Custom sandbox profiles](#sandboxing) (e.g.,\n `.gemini/sandbox-macos-custom.sb`, `.gemini/sandbox.Dockerfile`).\n\n### Available settings in `settings.json`\n\nSettings are organized into categories. All settings should be placed within\ntheir corresponding top-level category object in your `settings.json` file.\n\n\u003c!-- SETTINGS-AUTOGEN:START -->\n\n#### `policyPaths`\n\n- **`policyPaths`** (array):\n - **Description:** Additional policy files or directories to load.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n#### `general`\n\n- **`general.preferredEditor`** (string):\n - **Description:** The preferred editor to open files in.\n - **Default:** `undefined`\n\n- **`general.vimMode`** (boolean):\n - **Description:** Enable Vim keybindings\n - **Default:** `false`\n\n- **`general.defaultApprovalMode`** (enum):\n - **Description:** The default approval mode for tool execution. 'default'\n prompts for approval, 'auto_edit' auto-approves edit tools, and 'plan' is\n read-only mode. 'yolo' is not supported yet.\n - **Default:** `\"default\"`\n - **Values:** `\"default\"`, `\"auto_edit\"`, `\"plan\"`\n\n- **`general.devtools`** (boolean):\n - **Description:** Enable DevTools inspector on launch.\n - **Default:** `false`\n\n- **`general.enableAutoUpdate`** (boolean):\n - **Description:** Enable automatic updates.\n - **Default:** `true`\n\n- **`general.enableAutoUpdateNotification`** (boolean):\n - **Description:** Enable update notification prompts.\n - **Default:** `true`\n\n- **`general.checkpointing.enabled`** (boolean):\n - **Description:** Enable session checkpointing for recovery\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`general.enablePromptCompletion`** (boolean):\n - **Description:** Enable AI-powered prompt completion suggestions while\n typing.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`general.retryFetchErrors`** (boolean):\n - **Description:** Retry on \"exception TypeError: fetch failed sending\n request\" errors.\n - **Default:** `false`\n\n- **`general.debugKeystrokeLogging`** (boolean):\n - **Description:** Enable debug logging of keystrokes to the console.\n - **Default:** `false`\n\n- **`general.sessionRetention.enabled`** (boolean):\n - **Description:** Enable automatic session cleanup\n - **Default:** `false`\n\n- **`general.sessionRetention.maxAge`** (string):\n - **Description:** Maximum age of sessions to keep (e.g., \"30d\", \"7d\", \"24h\",\n \"1w\")\n - **Default:** `undefined`\n\n- **`general.sessionRetention.maxCount`** (number):\n - **Description:** Alternative: Maximum number of sessions to keep (most\n recent)\n - **Default:** `undefined`\n\n- **`general.sessionRetention.minRetention`** (string):\n - **Description:** Minimum retention period (safety limit, defaults to \"1d\")\n - **Default:** `\"1d\"`\n\n#### `output`\n\n- **`output.format`** (enum):\n - **Description:** The format of the CLI output. Can be `text` or `json`.\n - **Default:** `\"text\"`\n - **Values:** `\"text\"`, `\"json\"`\n\n#### `ui`\n\n- **`ui.theme`** (string):\n - **Description:** The color theme for the UI. See the CLI themes guide for\n available options.\n - **Default:** `undefined`\n\n- **`ui.autoThemeSwitching`** (boolean):\n - **Description:** Automatically switch between default light and dark themes\n based on terminal background color.\n - **Default:** `true`\n\n- **`ui.terminalBackgroundPollingInterval`** (number):\n - **Description:** Interval in seconds to poll the terminal background color.\n - **Default:** `60`\n\n- **`ui.customThemes`** (object):\n - **Description:** Custom theme definitions.\n - **Default:** `{}`\n\n- **`ui.hideWindowTitle`** (boolean):\n - **Description:** Hide the window title bar\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`ui.inlineThinkingMode`** (enum):\n - **Description:** Display model thinking inline: off or full.\n - **Default:** `\"off\"`\n - **Values:** `\"off\"`, `\"full\"`\n\n- **`ui.showStatusInTitle`** (boolean):\n - **Description:** Show Gemini CLI model thoughts in the terminal window title\n during the working phase\n - **Default:** `false`\n\n- **`ui.dynamicWindowTitle`** (boolean):\n - **Description:** Update the terminal window title with current status icons\n (Ready: ◇, Action Required: ✋, Working: ✦)\n - **Default:** `true`\n\n- **`ui.showHomeDirectoryWarning`** (boolean):\n - **Description:** Show a warning when running Gemini CLI in the home\n directory.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`ui.hideTips`** (boolean):\n - **Description:** Hide helpful tips in the UI\n - **Default:** `false`\n\n- **`ui.showShortcutsHint`** (boolean):\n - **Description:** Show the \"? for shortcuts\" hint above the input.\n - **Default:** `true`\n\n- **`ui.hideBanner`** (boolean):\n - **Description:** Hide the application banner\n - **Default:** `false`\n\n- **`ui.hideContextSummary`** (boolean):\n - **Description:** Hide the context summary (GEMINI.md, MCP servers) above the\n input.\n - **Default:** `false`\n\n- **`ui.footer.hideCWD`** (boolean):\n - **Description:** Hide the current working directory path in the footer.\n - **Default:** `false`\n\n- **`ui.footer.hideSandboxStatus`** (boolean):\n - **Description:** Hide the sandbox status indicator in the footer.\n - **Default:** `false`\n\n- **`ui.footer.hideModelInfo`** (boolean):\n - **Description:** Hide the model name and context usage in the footer.\n - **Default:** `false`\n\n- **`ui.footer.hideContextPercentage`** (boolean):\n - **Description:** Hides the context window remaining percentage.\n - **Default:** `true`\n\n- **`ui.hideFooter`** (boolean):\n - **Description:** Hide the footer from the UI\n - **Default:** `false`\n\n- **`ui.showMemoryUsage`** (boolean):\n - **Description:** Display memory usage information in the UI\n - **Default:** `false`\n\n- **`ui.showLineNumbers`** (boolean):\n - **Description:** Show line numbers in the chat.\n - **Default:** `true`\n\n- **`ui.showCitations`** (boolean):\n - **Description:** Show citations for generated text in the chat.\n - **Default:** `false`\n\n- **`ui.showModelInfoInChat`** (boolean):\n - **Description:** Show the model name in the chat for each model turn.\n - **Default:** `false`\n\n- **`ui.showUserIdentity`** (boolean):\n - **Description:** Show the logged-in user's identity (e.g. email) in the UI.\n - **Default:** `true`\n\n- **`ui.useAlternateBuffer`** (boolean):\n - **Description:** Use an alternate screen buffer for the UI, preserving shell\n history.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`ui.useBackgroundColor`** (boolean):\n - **Description:** Whether to use background colors in the UI.\n - **Default:** `true`\n\n- **`ui.incrementalRendering`** (boolean):\n - **Description:** Enable incremental rendering for the UI. This option will\n reduce flickering but may cause rendering artifacts. Only supported when\n useAlternateBuffer is enabled.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`ui.showSpinner`** (boolean):\n - **Description:** Show the spinner during operations.\n - **Default:** `true`\n\n- **`ui.customWittyPhrases`** (array):\n - **Description:** Custom witty phrases to display during loading. When\n provided, the CLI cycles through these instead of the defaults.\n - **Default:** `[]`\n\n- **`ui.accessibility.enableLoadingPhrases`** (boolean):\n - **Description:** Enable loading phrases during operations.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`ui.accessibility.screenReader`** (boolean):\n - **Description:** Render output in plain-text to be more screen reader\n accessible\n - **Default:** `false`\n - **Requires restart:** Yes\n\n#### `ide`\n\n- **`ide.enabled`** (boolean):\n - **Description:** Enable IDE integration mode.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`ide.hasSeenNudge`** (boolean):\n - **Description:** Whether the user has seen the IDE integration nudge.\n - **Default:** `false`\n\n#### `privacy`\n\n- **`privacy.usageStatisticsEnabled`** (boolean):\n - **Description:** Enable collection of usage statistics\n - **Default:** `true`\n - **Requires restart:** Yes\n\n#### `model`\n\n- **`model.name`** (string):\n - **Description:** The Gemini model to use for conversations.\n - **Default:** `undefined`\n\n- **`model.maxSessionTurns`** (number):\n - **Description:** Maximum number of user/model/tool turns to keep in a\n session. -1 means unlimited.\n - **Default:** `-1`\n\n- **`model.summarizeToolOutput`** (object):\n - **Description:** Enables or disables summarization of tool output. Configure\n per-tool token budgets (for example {\"run_shell_command\": {\"tokenBudget\":\n 2000}}). Currently only the run_shell_command tool supports summarization.\n - **Default:** `undefined`\n\n- **`model.compressionThreshold`** (number):\n - **Description:** The fraction of context usage at which to trigger context\n compression (e.g. 0.2, 0.3).\n - **Default:** `0.5`\n - **Requires restart:** Yes\n\n- **`model.disableLoopDetection`** (boolean):\n - **Description:** Disable automatic detection and prevention of infinite\n loops.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`model.skipNextSpeakerCheck`** (boolean):\n - **Description:** Skip the next speaker check.\n - **Default:** `true`\n\n#### `modelConfigs`\n\n- **`modelConfigs.aliases`** (object):\n - **Description:** Named presets for model configs. Can be used in place of a\n model name and can inherit from other aliases using an `extends` property.\n - **Default:**\n\n ```json\n {\n \"base\": {\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"temperature\": 0,\n \"topP\": 1\n }\n }\n },\n \"chat-base\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"thinkingConfig\": {\n \"includeThoughts\": true\n },\n \"temperature\": 1,\n \"topP\": 0.95,\n \"topK\": 64\n }\n }\n },\n \"chat-base-2.5\": {\n \"extends\": \"chat-base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"thinkingConfig\": {\n \"thinkingBudget\": 8192\n }\n }\n }\n },\n \"chat-base-3\": {\n \"extends\": \"chat-base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"thinkingConfig\": {\n \"thinkingLevel\": \"HIGH\"\n }\n }\n }\n },\n \"gemini-3-pro-preview\": {\n \"extends\": \"chat-base-3\",\n \"modelConfig\": {\n \"model\": \"gemini-3-pro-preview\"\n }\n },\n \"gemini-3-flash-preview\": {\n \"extends\": \"chat-base-3\",\n \"modelConfig\": {\n \"model\": \"gemini-3-flash-preview\"\n }\n },\n \"gemini-2.5-pro\": {\n \"extends\": \"chat-base-2.5\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-pro\"\n }\n },\n \"gemini-2.5-flash\": {\n \"extends\": \"chat-base-2.5\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash\"\n }\n },\n \"gemini-2.5-flash-lite\": {\n \"extends\": \"chat-base-2.5\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\"\n }\n },\n \"gemini-2.5-flash-base\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash\"\n }\n },\n \"gemini-3-flash-base\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-3-flash-preview\"\n }\n },\n \"classifier\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"maxOutputTokens\": 1024,\n \"thinkingConfig\": {\n \"thinkingBudget\": 512\n }\n }\n }\n },\n \"prompt-completion\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"temperature\": 0.3,\n \"maxOutputTokens\": 16000,\n \"thinkingConfig\": {\n \"thinkingBudget\": 0\n }\n }\n }\n },\n \"edit-corrector\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"thinkingConfig\": {\n \"thinkingBudget\": 0\n }\n }\n }\n },\n \"summarizer-default\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"maxOutputTokens\": 2000\n }\n }\n },\n \"summarizer-shell\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"maxOutputTokens\": 2000\n }\n }\n },\n \"web-search\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"tools\": [\n {\n \"googleSearch\": {}\n }\n ]\n }\n }\n },\n \"web-fetch\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"tools\": [\n {\n \"urlContext\": {}\n }\n ]\n }\n }\n },\n \"web-fetch-fallback\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {}\n },\n \"loop-detection\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {}\n },\n \"loop-detection-double-check\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-3-pro-preview\"\n }\n },\n \"llm-edit-fixer\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {}\n },\n \"next-speaker-checker\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {}\n },\n \"chat-compression-3-pro\": {\n \"modelConfig\": {\n \"model\": \"gemini-3-pro-preview\"\n }\n },\n \"chat-compression-3-flash\": {\n \"modelConfig\": {\n \"model\": \"gemini-3-flash-preview\"\n }\n },\n \"chat-compression-2.5-pro\": {\n \"modelConfig\": {\n \"model\": \"gemini-2.5-pro\"\n }\n },\n \"chat-compression-2.5-flash\": {\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash\"\n }\n },\n \"chat-compression-2.5-flash-lite\": {\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\"\n }\n },\n \"chat-compression-default\": {\n \"modelConfig\": {\n \"model\": \"gemini-3-pro-preview\"\n }\n }\n }\n ```\n\n- **`modelConfigs.customAliases`** (object):\n - **Description:** Custom named presets for model configs. These are merged\n with (and override) the built-in aliases.\n - **Default:** `{}`\n\n- **`modelConfigs.customOverrides`** (array):\n - **Description:** Custom model config overrides. These are merged with (and\n added to) the built-in overrides.\n - **Default:** `[]`\n\n- **`modelConfigs.overrides`** (array):\n - **Description:** Apply specific configuration overrides based on matches,\n with a primary key of model (or alias). The most specific match will be\n used.\n - **Default:** `[]`\n\n#### `agents`\n\n- **`agents.overrides`** (object):\n - **Description:** Override settings for specific agents, e.g. to disable the\n agent, set a custom model config, or run config.\n - **Default:** `{}`\n - **Requires restart:** Yes\n\n#### `context`\n\n- **`context.fileName`** (string | string[]):\n - **Description:** The name of the context file or files to load into memory.\n Accepts either a single string or an array of strings.\n - **Default:** `undefined`\n\n- **`context.importFormat`** (string):\n - **Description:** The format to use when importing memory.\n - **Default:** `undefined`\n\n- **`context.discoveryMaxDirs`** (number):\n - **Description:** Maximum number of directories to search for memory.\n - **Default:** `200`\n\n- **`context.includeDirectories`** (array):\n - **Description:** Additional directories to include in the workspace context.\n Missing directories will be skipped with a warning.\n - **Default:** `[]`\n\n- **`context.loadMemoryFromIncludeDirectories`** (boolean):\n - **Description:** Controls how /memory refresh loads GEMINI.md files. When\n true, include directories are scanned; when false, only the current\n directory is used.\n - **Default:** `false`\n\n- **`context.fileFiltering.respectGitIgnore`** (boolean):\n - **Description:** Respect .gitignore files when searching.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`context.fileFiltering.respectGeminiIgnore`** (boolean):\n - **Description:** Respect .geminiignore files when searching.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`context.fileFiltering.enableRecursiveFileSearch`** (boolean):\n - **Description:** Enable recursive file search functionality when completing\n @ references in the prompt.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`context.fileFiltering.enableFuzzySearch`** (boolean):\n - **Description:** Enable fuzzy search when searching for files.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`context.fileFiltering.customIgnoreFilePaths`** (array):\n - **Description:** Additional ignore file paths to respect. These files take\n precedence over .geminiignore and .gitignore. Files earlier in the array\n take precedence over files later in the array, e.g. the first file takes\n precedence over the second one.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n#### `tools`\n\n- **`tools.sandbox`** (boolean | string):\n - **Description:** Sandbox execution environment. Set to a boolean to enable\n or disable the sandbox, or provide a string path to a sandbox profile.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.shell.enableInteractiveShell`** (boolean):\n - **Description:** Use node-pty for an interactive shell experience. Fallback\n to child_process still applies.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`tools.shell.pager`** (string):\n - **Description:** The pager command to use for shell output. Defaults to\n `cat`.\n - **Default:** `\"cat\"`\n\n- **`tools.shell.showColor`** (boolean):\n - **Description:** Show color in shell output.\n - **Default:** `false`\n\n- **`tools.shell.inactivityTimeout`** (number):\n - **Description:** The maximum time in seconds allowed without output from the\n shell command. Defaults to 5 minutes.\n - **Default:** `300`\n\n- **`tools.shell.enableShellOutputEfficiency`** (boolean):\n - **Description:** Enable shell output efficiency optimizations for better\n performance.\n - **Default:** `true`\n\n- **`tools.core`** (array):\n - **Description:** Restrict the set of built-in tools with an allowlist. Match\n semantics mirror tools.allowed; see the built-in tools documentation for\n available names.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.allowed`** (array):\n - **Description:** Tool names that bypass the confirmation dialog. Useful for\n trusted commands (for example [\"run_shell_command(git)\",\n \"run_shell_command(npm test)\"]). See shell tool command restrictions for\n matching details.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.exclude`** (array):\n - **Description:** Tool names to exclude from discovery.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.discoveryCommand`** (string):\n - **Description:** Command to run for tool discovery.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.callCommand`** (string):\n - **Description:** Defines a custom shell command for invoking discovered\n tools. The command must take the tool name as the first argument, read JSON\n arguments from stdin, and emit JSON results on stdout.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.useRipgrep`** (boolean):\n - **Description:** Use ripgrep for file content search instead of the fallback\n implementation. Provides faster search performance.\n - **Default:** `true`\n\n- **`tools.truncateToolOutputThreshold`** (number):\n - **Description:** Maximum characters to show when truncating large tool\n outputs. Set to 0 or negative to disable truncation.\n - **Default:** `40000`\n - **Requires restart:** Yes\n\n- **`tools.disableLLMCorrection`** (boolean):\n - **Description:** Disable LLM-based error correction for edit tools. When\n enabled, tools will fail immediately if exact string matches are not found,\n instead of attempting to self-correct.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n#### `mcp`\n\n- **`mcp.serverCommand`** (string):\n - **Description:** Command to start an MCP server.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`mcp.allowed`** (array):\n - **Description:** A list of MCP servers to allow.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`mcp.excluded`** (array):\n - **Description:** A list of MCP servers to exclude.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n#### `useWriteTodos`\n\n- **`useWriteTodos`** (boolean):\n - **Description:** Enable the write_todos tool.\n - **Default:** `true`\n\n#### `security`\n\n- **`security.disableYoloMode`** (boolean):\n - **Description:** Disable YOLO mode, even if enabled by a flag.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`security.enablePermanentToolApproval`** (boolean):\n - **Description:** Enable the \"Allow for all future sessions\" option in tool\n confirmation dialogs.\n - **Default:** `false`\n\n- **`security.blockGitExtensions`** (boolean):\n - **Description:** Blocks installing and loading extensions from Git.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`security.allowedExtensions`** (array):\n - **Description:** List of Regex patterns for allowed extensions. If nonempty,\n only extensions that match the patterns in this list are allowed. Overrides\n the blockGitExtensions setting.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n- **`security.folderTrust.enabled`** (boolean):\n - **Description:** Setting to track whether Folder trust is enabled.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`security.environmentVariableRedaction.allowed`** (array):\n - **Description:** Environment variables to always allow (bypass redaction).\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n- **`security.environmentVariableRedaction.blocked`** (array):\n - **Description:** Environment variables to always redact.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n- **`security.environmentVariableRedaction.enabled`** (boolean):\n - **Description:** Enable redaction of environment variables that may contain\n secrets.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`security.auth.selectedType`** (string):\n - **Description:** The currently selected authentication type.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`security.auth.enforcedType`** (string):\n - **Description:** The required auth type. If this does not match the selected\n auth type, the user will be prompted to re-authenticate.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`security.auth.useExternal`** (boolean):\n - **Description:** Whether to use an external authentication flow.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n#### `advanced`\n\n- **`advanced.autoConfigureMemory`** (boolean):\n - **Description:** Automatically configure Node.js memory limits\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`advanced.dnsResolutionOrder`** (string):\n - **Description:** The DNS resolution order.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`advanced.excludedEnvVars`** (array):\n - **Description:** Environment variables to exclude from project context.\n - **Default:**\n\n ```json\n [\"DEBUG\", \"DEBUG_MODE\"]\n ```\n\n- **`advanced.bugCommand`** (object):\n - **Description:** Configuration for the bug report command.\n - **Default:** `undefined`\n\n#### `experimental`\n\n- **`experimental.toolOutputMasking.enabled`** (boolean):\n - **Description:** Enables tool output masking to save tokens.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.toolOutputMasking.toolProtectionThreshold`** (number):\n - **Description:** Minimum number of tokens to protect from masking (most\n recent tool outputs).\n - **Default:** `50000`\n - **Requires restart:** Yes\n\n- **`experimental.toolOutputMasking.minPrunableTokensThreshold`** (number):\n - **Description:** Minimum prunable tokens required to trigger a masking pass.\n - **Default:** `30000`\n - **Requires restart:** Yes\n\n- **`experimental.toolOutputMasking.protectLatestTurn`** (boolean):\n - **Description:** Ensures the absolute latest turn is never masked,\n regardless of token count.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.enableAgents`** (boolean):\n - **Description:** Enable local and remote subagents. Warning: Experimental\n feature, uses YOLO mode for subagents\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.extensionManagement`** (boolean):\n - **Description:** Enable extension management features.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.extensionConfig`** (boolean):\n - **Description:** Enable requesting and fetching of extension settings.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.extensionRegistry`** (boolean):\n - **Description:** Enable extension registry explore UI.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.extensionReloading`** (boolean):\n - **Description:** Enables extension loading/unloading within the CLI session.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.jitContext`** (boolean):\n - **Description:** Enable Just-In-Time (JIT) context loading.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.useOSC52Paste`** (boolean):\n - **Description:** Use OSC 52 sequence for pasting instead of clipboardy\n (useful for remote sessions).\n - **Default:** `false`\n\n- **`experimental.plan`** (boolean):\n - **Description:** Enable planning features (Plan Mode and tools).\n - **Default:** `false`\n - **Requires restart:** Yes\n\n#### `skills`\n\n- **`skills.enabled`** (boolean):\n - **Description:** Enable Agent Skills.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`skills.disabled`** (array):\n - **Description:** List of disabled skills.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n#### `hooksConfig`\n\n- **`hooksConfig.enabled`** (boolean):\n - **Description:** Canonical toggle for the hooks system. When disabled, no\n hooks will be executed.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`hooksConfig.disabled`** (array):\n - **Description:** List of hook names (commands) that should be disabled.\n Hooks in this list will not execute even if configured.\n - **Default:** `[]`\n\n- **`hooksConfig.notifications`** (boolean):\n - **Description:** Show visual indicators when hooks are executing.\n - **Default:** `true`\n\n#### `hooks`\n\n- **`hooks.BeforeTool`** (array):\n - **Description:** Hooks that execute before tool execution. Can intercept,\n validate, or modify tool calls.\n - **Default:** `[]`\n\n- **`hooks.AfterTool`** (array):\n - **Description:** Hooks that execute after tool execution. Can process\n results, log outputs, or trigger follow-up actions.\n - **Default:** `[]`\n\n- **`hooks.BeforeAgent`** (array):\n - **Description:** Hooks that execute before agent loop starts. Can set up\n context or initialize resources.\n - **Default:** `[]`\n\n- **`hooks.AfterAgent`** (array):\n - **Description:** Hooks that execute after agent loop completes. Can perform\n cleanup or summarize results.\n - **Default:** `[]`\n\n- **`hooks.Notification`** (array):\n - **Description:** Hooks that execute on notification events (errors,\n warnings, info). Can log or alert on specific conditions.\n - **Default:** `[]`\n\n- **`hooks.SessionStart`** (array):\n - **Description:** Hooks that execute when a session starts. Can initialize\n session-specific resources or state.\n - **Default:** `[]`\n\n- **`hooks.SessionEnd`** (array):\n - **Description:** Hooks that execute when a session ends. Can perform cleanup\n or persist session data.\n - **Default:** `[]`\n\n- **`hooks.PreCompress`** (array):\n - **Description:** Hooks that execute before chat history compression. Can\n back up or analyze conversation before compression.\n - **Default:** `[]`\n\n- **`hooks.BeforeModel`** (array):\n - **Description:** Hooks that execute before LLM requests. Can modify prompts,\n inject context, or control model parameters.\n - **Default:** `[]`\n\n- **`hooks.AfterModel`** (array):\n - **Description:** Hooks that execute after LLM responses. Can process\n outputs, extract information, or log interactions.\n - **Default:** `[]`\n\n- **`hooks.BeforeToolSelection`** (array):\n - **Description:** Hooks that execute before tool selection. Can filter or\n prioritize available tools dynamically.\n - **Default:** `[]`\n\n#### `admin`\n\n- **`admin.secureModeEnabled`** (boolean):\n - **Description:** If true, disallows yolo mode from being used.\n - **Default:** `false`\n\n- **`admin.extensions.enabled`** (boolean):\n - **Description:** If false, disallows extensions from being installed or\n used.\n - **Default:** `true`\n\n- **`admin.mcp.enabled`** (boolean):\n - **Description:** If false, disallows MCP servers from being used.\n - **Default:** `true`\n\n- **`admin.mcp.config`** (object):\n - **Description:** Admin-configured MCP servers.\n - **Default:** `{}`\n\n- **`admin.skills.enabled`** (boolean):\n - **Description:** If false, disallows agent skills from being used.\n - **Default:** `true`\n \u003c!-- SETTINGS-AUTOGEN:END -->\n\n#### `mcpServers`\n\nConfigures connections to one or more Model-Context Protocol (MCP) servers for\ndiscovering and using custom tools. Gemini CLI attempts to connect to each\nconfigured MCP server to discover available tools. If multiple MCP servers\nexpose a tool with the same name, the tool names will be prefixed with the\nserver alias you defined in the configuration (e.g.,\n`serverAlias__actualToolName`) to avoid conflicts. Note that the system might\nstrip certain schema properties from MCP tool definitions for compatibility. At\nleast one of `command`, `url`, or `httpUrl` must be provided. If multiple are\nspecified, the order of precedence is `httpUrl`, then `url`, then `command`.\n\n- **`mcpServers.\u003cSERVER_NAME>`** (object): The server parameters for the named\n server.\n - `command` (string, optional): The command to execute to start the MCP server\n via standard I/O.\n - `args` (array of strings, optional): Arguments to pass to the command.\n - `env` (object, optional): Environment variables to set for the server\n process.\n - `cwd` (string, optional): The working directory in which to start the\n server.\n - `url` (string, optional): The URL of an MCP server that uses Server-Sent\n Events (SSE) for communication.\n - `httpUrl` (string, optional): The URL of an MCP server that uses streamable\n HTTP for communication.\n - `headers` (object, optional): A map of HTTP headers to send with requests to\n `url` or `httpUrl`.\n - `timeout` (number, optional): Timeout in milliseconds for requests to this\n MCP server.\n - `trust` (boolean, optional): Trust this server and bypass all tool call\n confirmations.\n - `description` (string, optional): A brief description of the server, which\n may be used for display purposes.\n - `includeTools` (array of strings, optional): List of tool names to include\n from this MCP server. When specified, only the tools listed here will be\n available from this server (allowlist behavior). If not specified, all tools\n from the server are enabled by default.\n - `excludeTools` (array of strings, optional): List of tool names to exclude\n from this MCP server. Tools listed here will not be available to the model,\n even if they are exposed by the server. **Note:** `excludeTools` takes\n precedence over `includeTools` - if a tool is in both lists, it will be\n excluded.\n\n#### `telemetry`\n\nConfigures logging and metrics collection for Gemini CLI. For more information,\nsee [Telemetry](/docs/cli/telemetry).\n\n- **Properties:**\n - **`enabled`** (boolean): Whether or not telemetry is enabled.\n - **`target`** (string): The destination for collected telemetry. Supported\n values are `local` and `gcp`.\n - **`otlpEndpoint`** (string): The endpoint for the OTLP Exporter.\n - **`otlpProtocol`** (string): The protocol for the OTLP Exporter (`grpc` or\n `http`).\n - **`logPrompts`** (boolean): Whether or not to include the content of user\n prompts in the logs.\n - **`outfile`** (string): The file to write telemetry to when `target` is\n `local`.\n - **`useCollector`** (boolean): Whether to use an external OTLP collector.\n\n### Example `settings.json`\n\nHere is an example of a `settings.json` file with the nested structure, new as\nof v0.3.0:\n\n```json\n{\n \"general\": {\n \"vimMode\": true,\n \"preferredEditor\": \"code\",\n \"sessionRetention\": {\n \"enabled\": true,\n \"maxAge\": \"30d\",\n \"maxCount\": 100\n }\n },\n \"ui\": {\n \"theme\": \"GitHub\",\n \"hideBanner\": true,\n \"hideTips\": false,\n \"customWittyPhrases\": [\n \"You forget a thousand things every day. Make sure this is one of 'em\",\n \"Connecting to AGI\"\n ]\n },\n \"tools\": {\n \"sandbox\": \"docker\",\n \"discoveryCommand\": \"bin/get_tools\",\n \"callCommand\": \"bin/call_tool\",\n \"exclude\": [\"write_file\"]\n },\n \"mcpServers\": {\n \"mainServer\": {\n \"command\": \"bin/mcp_server.py\"\n },\n \"anotherServer\": {\n \"command\": \"node\",\n \"args\": [\"mcp_server.js\", \"--verbose\"]\n }\n },\n \"telemetry\": {\n \"enabled\": true,\n \"target\": \"local\",\n \"otlpEndpoint\": \"http://localhost:4317\",\n \"logPrompts\": true\n },\n \"privacy\": {\n \"usageStatisticsEnabled\": true\n },\n \"model\": {\n \"name\": \"gemini-1.5-pro-latest\",\n \"maxSessionTurns\": 10,\n \"summarizeToolOutput\": {\n \"run_shell_command\": {\n \"tokenBudget\": 100\n }\n }\n },\n \"context\": {\n \"fileName\": [\"CONTEXT.md\", \"GEMINI.md\"],\n \"includeDirectories\": [\"path/to/dir1\", \"~/path/to/dir2\", \"../path/to/dir3\"],\n \"loadFromIncludeDirectories\": true,\n \"fileFiltering\": {\n \"respectGitIgnore\": false\n }\n },\n \"advanced\": {\n \"excludedEnvVars\": [\"DEBUG\", \"DEBUG_MODE\", \"NODE_ENV\"]\n }\n}\n```\n\n## Shell history\n\nThe CLI keeps a history of shell commands you run. To avoid conflicts between\ndifferent projects, this history is stored in a project-specific directory\nwithin your user's home folder.\n\n- **Location:** `~/.gemini/tmp/\u003cproject_hash>/shell_history`\n - `\u003cproject_hash>` is a unique identifier generated from your project's root\n path.\n - The history is stored in a file named `shell_history`.\n\n## Environment variables and `.env` files\n\nEnvironment variables are a common way to configure applications, especially for\nsensitive information like API keys or for settings that might change between\nenvironments. For authentication setup, see the\n[Authentication documentation](/docs/get-started/authentication) which covers all available\nauthentication methods.\n\nThe CLI automatically loads environment variables from an `.env` file. The\nloading order is:\n\n1. `.env` file in the current working directory.\n2. If not found, it searches upwards in parent directories until it finds an\n `.env` file or reaches the project root (identified by a `.git` folder) or\n the home directory.\n3. If still not found, it looks for `~/.env` (in the user's home directory).\n\n**Environment variable exclusion:** Some environment variables (like `DEBUG` and\n`DEBUG_MODE`) are automatically excluded from being loaded from project `.env`\nfiles to prevent interference with gemini-cli behavior. Variables from\n`.gemini/.env` files are never excluded. You can customize this behavior using\nthe `advanced.excludedEnvVars` setting in your `settings.json` file.\n\n- **`GEMINI_API_KEY`**:\n - Your API key for the Gemini API.\n - One of several available [authentication methods](/docs/get-started/authentication).\n - Set this in your shell profile (e.g., `~/.bashrc`, `~/.zshrc`) or an `.env`\n file.\n- **`GEMINI_MODEL`**:\n - Specifies the default Gemini model to use.\n - Overrides the hardcoded default\n - Example: `export GEMINI_MODEL=\"gemini-3-flash-preview\"`\n- **`GEMINI_CLI_HOME`**:\n - Specifies the root directory for Gemini CLI's user-level configuration and\n storage.\n - By default, this is the user's system home directory. The CLI will create a\n `.gemini` folder inside this directory.\n - Useful for shared compute environments or keeping CLI state isolated.\n - Example: `export GEMINI_CLI_HOME=\"/path/to/user/config\"`\n- **`GOOGLE_API_KEY`**:\n - Your Google Cloud API key.\n - Required for using Vertex AI in express mode.\n - Ensure you have the necessary permissions.\n - Example: `export GOOGLE_API_KEY=\"YOUR_GOOGLE_API_KEY\"`.\n- **`GOOGLE_CLOUD_PROJECT`**:\n - Your Google Cloud Project ID.\n - Required for using Code Assist or Vertex AI.\n - If using Vertex AI, ensure you have the necessary permissions in this\n project.\n - **Cloud Shell note:** When running in a Cloud Shell environment, this\n variable defaults to a special project allocated for Cloud Shell users. If\n you have `GOOGLE_CLOUD_PROJECT` set in your global environment in Cloud\n Shell, it will be overridden by this default. To use a different project in\n Cloud Shell, you must define `GOOGLE_CLOUD_PROJECT` in a `.env` file.\n - Example: `export GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"`.\n- **`GOOGLE_APPLICATION_CREDENTIALS`** (string):\n - **Description:** The path to your Google Application Credentials JSON file.\n - **Example:**\n `export GOOGLE_APPLICATION_CREDENTIALS=\"/path/to/your/credentials.json\"`\n- **`GOOGLE_GENAI_API_VERSION`**:\n - Specifies the API version to use for Gemini API requests.\n - When set, overrides the default API version used by the SDK.\n - Example: `export GOOGLE_GENAI_API_VERSION=\"v1\"`\n- **`OTLP_GOOGLE_CLOUD_PROJECT`**:\n - Your Google Cloud Project ID for Telemetry in Google Cloud\n - Example: `export OTLP_GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"`.\n- **`GEMINI_TELEMETRY_ENABLED`**:\n - Set to `true` or `1` to enable telemetry. Any other value is treated as\n disabling it.\n - Overrides the `telemetry.enabled` setting.\n- **`GEMINI_TELEMETRY_TARGET`**:\n - Sets the telemetry target (`local` or `gcp`).\n - Overrides the `telemetry.target` setting.\n- **`GEMINI_TELEMETRY_OTLP_ENDPOINT`**:\n - Sets the OTLP endpoint for telemetry.\n - Overrides the `telemetry.otlpEndpoint` setting.\n- **`GEMINI_TELEMETRY_OTLP_PROTOCOL`**:\n - Sets the OTLP protocol (`grpc` or `http`).\n - Overrides the `telemetry.otlpProtocol` setting.\n- **`GEMINI_TELEMETRY_LOG_PROMPTS`**:\n - Set to `true` or `1` to enable or disable logging of user prompts. Any other\n value is treated as disabling it.\n - Overrides the `telemetry.logPrompts` setting.\n- **`GEMINI_TELEMETRY_OUTFILE`**:\n - Sets the file path to write telemetry to when the target is `local`.\n - Overrides the `telemetry.outfile` setting.\n- **`GEMINI_TELEMETRY_USE_COLLECTOR`**:\n - Set to `true` or `1` to enable or disable using an external OTLP collector.\n Any other value is treated as disabling it.\n - Overrides the `telemetry.useCollector` setting.\n- **`GOOGLE_CLOUD_LOCATION`**:\n - Your Google Cloud Project Location (e.g., us-central1).\n - Required for using Vertex AI in non-express mode.\n - Example: `export GOOGLE_CLOUD_LOCATION=\"YOUR_PROJECT_LOCATION\"`.\n- **`GEMINI_SANDBOX`**:\n - Alternative to the `sandbox` setting in `settings.json`.\n - Accepts `true`, `false`, `docker`, `podman`, or a custom command string.\n- **`GEMINI_SYSTEM_MD`**:\n - Replaces the built‑in system prompt with content from a Markdown file.\n - `true`/`1`: Use project default path `./.gemini/system.md`.\n - Any other string: Treat as a path (relative/absolute supported, `~`\n expands).\n - `false`/`0` or unset: Use the built‑in prompt. See\n [System Prompt Override](/docs/cli/system-prompt).\n- **`GEMINI_WRITE_SYSTEM_MD`**:\n - Writes the current built‑in system prompt to a file for review.\n - `true`/`1`: Write to `./.gemini/system.md`. Otherwise treat the value as a\n path.\n - Run the CLI once with this set to generate the file.\n- **`SEATBELT_PROFILE`** (macOS specific):\n - Switches the Seatbelt (`sandbox-exec`) profile on macOS.\n - `permissive-open`: (Default) Restricts writes to the project folder (and a\n few other folders, see\n `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) but allows other\n operations.\n - `restrictive-open`: Declines operations by default, allows network.\n - `strict-open`: Restricts both reads and writes to the working directory,\n allows network.\n - `strict-proxied`: Same as `strict-open` but routes network through proxy.\n - `\u003cprofile_name>`: Uses a custom profile. To define a custom profile, create\n a file named `sandbox-macos-\u003cprofile_name>.sb` in your project's `.gemini/`\n directory (e.g., `my-project/.gemini/sandbox-macos-custom.sb`).\n- **`DEBUG` or `DEBUG_MODE`** (often used by underlying libraries or the CLI\n itself):\n - Set to `true` or `1` to enable verbose debug logging, which can be helpful\n for troubleshooting.\n - **Note:** These variables are automatically excluded from project `.env`\n files by default to prevent interference with gemini-cli behavior. Use\n `.gemini/.env` files if you need to set these for gemini-cli specifically.\n- **`NO_COLOR`**:\n - Set to any value to disable all color output in the CLI.\n- **`CLI_TITLE`**:\n - Set to a string to customize the title of the CLI.\n- **`CODE_ASSIST_ENDPOINT`**:\n - Specifies the endpoint for the code assist server.\n - This is useful for development and testing.\n\n### Environment variable redaction\n\nTo prevent accidental leakage of sensitive information, Gemini CLI automatically\nredacts potential secrets from environment variables when executing tools (such\nas shell commands). This \"best effort\" redaction applies to variables inherited\nfrom the system or loaded from `.env` files.\n\n**Default Redaction Rules:**\n\n- **By Name:** Variables are redacted if their names contain sensitive terms\n like `TOKEN`, `SECRET`, `PASSWORD`, `KEY`, `AUTH`, `CREDENTIAL`, `PRIVATE`, or\n `CERT`.\n- **By Value:** Variables are redacted if their values match known secret\n patterns, such as:\n - Private keys (RSA, OpenSSH, PGP, etc.)\n - Certificates\n - URLs containing credentials\n - API keys and tokens (GitHub, Google, AWS, Stripe, Slack, etc.)\n- **Specific Blocklist:** Certain variables like `CLIENT_ID`, `DB_URI`,\n `DATABASE_URL`, and `CONNECTION_STRING` are always redacted by default.\n\n**Allowlist (Never Redacted):**\n\n- Common system variables (e.g., `PATH`, `HOME`, `USER`, `SHELL`, `TERM`,\n `LANG`).\n- Variables starting with `GEMINI_CLI_`.\n- GitHub Action specific variables.\n\n**Configuration:**\n\nYou can customize this behavior in your `settings.json` file:\n\n- **`security.allowedEnvironmentVariables`**: A list of variable names to\n _never_ redact, even if they match sensitive patterns.\n- **`security.blockedEnvironmentVariables`**: A list of variable names to\n _always_ redact, even if they don't match sensitive patterns.\n\n```json\n{\n \"security\": {\n \"allowedEnvironmentVariables\": [\"MY_PUBLIC_KEY\", \"NOT_A_SECRET_TOKEN\"],\n \"blockedEnvironmentVariables\": [\"INTERNAL_IP_ADDRESS\"]\n }\n}\n```\n\n## Command-line arguments\n\nArguments passed directly when running the CLI can override other configurations\nfor that specific session.\n\n- **`--model \u003cmodel_name>`** (**`-m \u003cmodel_name>`**):\n - Specifies the Gemini model to use for this session.\n - Example: `npm start -- --model gemini-3-pro-preview`\n- **`--prompt \u003cyour_prompt>`** (**`-p \u003cyour_prompt>`**):\n - Used to pass a prompt directly to the command. This invokes Gemini CLI in a\n non-interactive mode.\n - For scripting examples, use the `--output-format json` flag to get\n structured output.\n- **`--prompt-interactive \u003cyour_prompt>`** (**`-i \u003cyour_prompt>`**):\n - Starts an interactive session with the provided prompt as the initial input.\n - The prompt is processed within the interactive session, not before it.\n - Cannot be used when piping input from stdin.\n - Example: `gemini -i \"explain this code\"`\n- **`--output-format \u003cformat>`**:\n - **Description:** Specifies the format of the CLI output for non-interactive\n mode.\n - **Values:**\n - `text`: (Default) The standard human-readable output.\n - `json`: A machine-readable JSON output.\n - `stream-json`: A streaming JSON output that emits real-time events.\n - **Note:** For structured output and scripting, use the\n `--output-format json` or `--output-format stream-json` flag.\n- **`--sandbox`** (**`-s`**):\n - Enables sandbox mode for this session.\n- **`--debug`** (**`-d`**):\n - Enables debug mode for this session, providing more verbose output. Open the\n debug console with F12 to see the additional logging.\n\n- **`--help`** (or **`-h`**):\n - Displays help information about command-line arguments.\n- **`--yolo`**:\n - Enables YOLO mode, which automatically approves all tool calls.\n- **`--approval-mode \u003cmode>`**:\n - Sets the approval mode for tool calls. Available modes:\n - `default`: Prompt for approval on each tool call (default behavior)\n - `auto_edit`: Automatically approve edit tools (replace, write_file) while\n prompting for others\n - `yolo`: Automatically approve all tool calls (equivalent to `--yolo`)\n - `plan`: Read-only mode for tool calls (requires experimental planning to\n be enabled).\n > **Note:** This mode is currently under development and not yet fully\n > functional.\n - Cannot be used together with `--yolo`. Use `--approval-mode=yolo` instead of\n `--yolo` for the new unified approach.\n - Example: `gemini --approval-mode auto_edit`\n- **`--allowed-tools \u003ctool1,tool2,...>`**:\n - A comma-separated list of tool names that will bypass the confirmation\n dialog.\n - Example: `gemini --allowed-tools \"ShellTool(git status)\"`\n- **`--extensions \u003cextension_name ...>`** (**`-e \u003cextension_name ...>`**):\n - Specifies a list of extensions to use for the session. If not provided, all\n available extensions are used.\n - Use the special term `gemini -e none` to disable all extensions.\n - Example: `gemini -e my-extension -e my-other-extension`\n- **`--list-extensions`** (**`-l`**):\n - Lists all available extensions and exits.\n- **`--resume [session_id]`** (**`-r [session_id]`**):\n - Resume a previous chat session. Use \"latest\" for the most recent session,\n provide a session index number, or provide a full session UUID.\n - If no session_id is provided, defaults to \"latest\".\n - Example: `gemini --resume 5` or `gemini --resume latest` or\n `gemini --resume a1b2c3d4-e5f6-7890-abcd-ef1234567890` or `gemini --resume`\n - See [Session Management](/docs/cli/session-management) for more details.\n- **`--list-sessions`**:\n - List all available chat sessions for the current project and exit.\n - Shows session indices, dates, message counts, and preview of first user\n message.\n - Example: `gemini --list-sessions`\n- **`--delete-session \u003cidentifier>`**:\n - Delete a specific chat session by its index number or full session UUID.\n - Use `--list-sessions` first to see available sessions, their indices, and\n UUIDs.\n - Example: `gemini --delete-session 3` or\n `gemini --delete-session a1b2c3d4-e5f6-7890-abcd-ef1234567890`\n- **`--include-directories \u003cdir1,dir2,...>`**:\n - Includes additional directories in the workspace for multi-directory\n support.\n - Can be specified multiple times or as comma-separated values.\n - 5 directories can be added at maximum.\n - Example: `--include-directories /path/to/project1,/path/to/project2` or\n `--include-directories /path/to/project1 --include-directories /path/to/project2`\n- **`--screen-reader`**:\n - Enables screen reader mode, which adjusts the TUI for better compatibility\n with screen readers.\n- **`--version`**:\n - Displays the version of the CLI.\n- **`--experimental-acp`**:\n - Starts the agent in ACP mode.\n- **`--allowed-mcp-server-names`**:\n - Allowed MCP server names.\n- **`--fake-responses`**:\n - Path to a file with fake model responses for testing.\n- **`--record-responses`**:\n - Path to a file to record model responses for testing.\n\n## Context files (hierarchical instructional context)\n\nWhile not strictly configuration for the CLI's _behavior_, context files\n(defaulting to `GEMINI.md` but configurable via the `context.fileName` setting)\nare crucial for configuring the _instructional context_ (also referred to as\n\"memory\") provided to the Gemini model. This powerful feature allows you to give\nproject-specific instructions, coding style guides, or any relevant background\ninformation to the AI, making its responses more tailored and accurate to your\nneeds. The CLI includes UI elements, such as an indicator in the footer showing\nthe number of loaded context files, to keep you informed about the active\ncontext.\n\n- **Purpose:** These Markdown files contain instructions, guidelines, or context\n that you want the Gemini model to be aware of during your interactions. The\n system is designed to manage this instructional context hierarchically.\n\n### Example context file content (e.g., `GEMINI.md`)\n\nHere's a conceptual example of what a context file at the root of a TypeScript\nproject might contain:\n\n```markdown\n# Project: My Awesome TypeScript Library\n\n## General Instructions:\n\n- When generating new TypeScript code, please follow the existing coding style.\n- Ensure all new functions and classes have JSDoc comments.\n- Prefer functional programming paradigms where appropriate.\n- All code should be compatible with TypeScript 5.0 and Node.js 20+.\n\n## Coding Style:\n\n- Use 2 spaces for indentation.\n- Interface names should be prefixed with `I` (e.g., `IUserService`).\n- Private class members should be prefixed with an underscore (`_`).\n- Always use strict equality (`===` and `!==`).\n\n## Specific Component: `src/api/client.ts`\n\n- This file handles all outbound API requests.\n- When adding new API call functions, ensure they include robust error handling\n and logging.\n- Use the existing `fetchWithRetry` utility for all GET requests.\n\n## Regarding Dependencies:\n\n- Avoid introducing new external dependencies unless absolutely necessary.\n- If a new dependency is required, please state the reason.\n```\n\nThis example demonstrates how you can provide general project context, specific\ncoding conventions, and even notes about particular files or components. The\nmore relevant and precise your context files are, the better the AI can assist\nyou. Project-specific context files are highly encouraged to establish\nconventions and context.\n\n- **Hierarchical loading and precedence:** The CLI implements a sophisticated\n hierarchical memory system by loading context files (e.g., `GEMINI.md`) from\n several locations. Content from files lower in this list (more specific)\n typically overrides or supplements content from files higher up (more\n general). The exact concatenation order and final context can be inspected\n using the `/memory show` command. The typical loading order is:\n 1. **Global context file:**\n - Location: `~/.gemini/\u003cconfigured-context-filename>` (e.g.,\n `~/.gemini/GEMINI.md` in your user home directory).\n - Scope: Provides default instructions for all your projects.\n 2. **Project root and ancestors context files:**\n - Location: The CLI searches for the configured context file in the\n current working directory and then in each parent directory up to either\n the project root (identified by a `.git` folder) or your home directory.\n - Scope: Provides context relevant to the entire project or a significant\n portion of it.\n 3. **Sub-directory context files (contextual/local):**\n - Location: The CLI also scans for the configured context file in\n subdirectories _below_ the current working directory (respecting common\n ignore patterns like `node_modules`, `.git`, etc.). The breadth of this\n search is limited to 200 directories by default, but can be configured\n with the `context.discoveryMaxDirs` setting in your `settings.json`\n file.\n - Scope: Allows for highly specific instructions relevant to a particular\n component, module, or subsection of your project.\n- **Concatenation and UI indication:** The contents of all found context files\n are concatenated (with separators indicating their origin and path) and\n provided as part of the system prompt to the Gemini model. The CLI footer\n displays the count of loaded context files, giving you a quick visual cue\n about the active instructional context.\n- **Importing content:** You can modularize your context files by importing\n other Markdown files using the `@path/to/file.md` syntax. For more details,\n see the [Memory Import Processor documentation](/docs/core/memport).\n- **Commands for memory management:**\n - Use `/memory refresh` to force a re-scan and reload of all context files\n from all configured locations. This updates the AI's instructional context.\n - Use `/memory show` to display the combined instructional context currently\n loaded, allowing you to verify the hierarchy and content being used by the\n AI.\n - See the [Commands documentation](/docs/cli/commands#memory) for full details\n on the `/memory` command and its sub-commands (`show` and `refresh`).\n\nBy understanding and utilizing these configuration layers and the hierarchical\nnature of context files, you can effectively manage the AI's memory and tailor\nthe Gemini CLI's responses to your specific needs and projects.\n\n## Sandboxing\n\nThe Gemini CLI can execute potentially unsafe operations (like shell commands\nand file modifications) within a sandboxed environment to protect your system.\n\nSandboxing is disabled by default, but you can enable it in a few ways:\n\n- Using `--sandbox` or `-s` flag.\n- Setting `GEMINI_SANDBOX` environment variable.\n- Sandbox is enabled when using `--yolo` or `--approval-mode=yolo` by default.\n\nBy default, it uses a pre-built `gemini-cli-sandbox` Docker image.\n\nFor project-specific sandboxing needs, you can create a custom Dockerfile at\n`.gemini/sandbox.Dockerfile` in your project's root directory. This Dockerfile\ncan be based on the base sandbox image:\n\n```dockerfile\nFROM gemini-cli-sandbox\n\n# Add your custom dependencies or configurations here\n# For example:\n# RUN apt-get update && apt-get install -y some-package\n# COPY ./my-config /app/my-config\n```\n\nWhen `.gemini/sandbox.Dockerfile` exists, you can use `BUILD_SANDBOX`\nenvironment variable when running Gemini CLI to automatically build the custom\nsandbox image:\n\n```bash\nBUILD_SANDBOX=1 gemini -s\n```\n\n## Usage statistics\n\nTo help us improve the Gemini CLI, we collect anonymized usage statistics. This\ndata helps us understand how the CLI is used, identify common issues, and\nprioritize new features.\n\n**What we collect:**\n\n- **Tool calls:** We log the names of the tools that are called, whether they\n succeed or fail, and how long they take to execute. We do not collect the\n arguments passed to the tools or any data returned by them.\n- **API requests:** We log the Gemini model used for each request, the duration\n of the request, and whether it was successful. We do not collect the content\n of the prompts or responses.\n- **Session information:** We collect information about the configuration of the\n CLI, such as the enabled tools and the approval mode.\n\n**What we DON'T collect:**\n\n- **Personally identifiable information (PII):** We do not collect any personal\n information, such as your name, email address, or API keys.\n- **Prompt and response content:** We do not log the content of your prompts or\n the responses from the Gemini model.\n- **File content:** We do not log the content of any files that are read or\n written by the CLI.\n\n**How to opt out:**\n\nYou can opt out of usage statistics collection at any time by setting the\n`usageStatisticsEnabled` property to `false` under the `privacy` category in\nyour `settings.json` file:\n\n```json\n{\n \"privacy\": {\n \"usageStatisticsEnabled\": false\n }\n}\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":61372,"content_sha256":"1852ed1443d2a99e64d67adfe5c47b0ae8848feb220a936adee4d618787b6ab2"},{"filename":"canonical/geminicli-com/docs/get-started/examples.md","content":"---\nsource_url: http://geminicli.com/docs/get-started/examples\nsource_type: llms-txt\ncontent_hash: sha256:7feee7fdc5416f56cdb005a92830376c7fb529780f6c6e016c1f84c762416252\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"baded94b6d6450a6eb73e4d3bcf1210329395226a6c829b7c5f38d485873df57\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Gemini CLI examples\n\nGemini CLI helps you automate common engineering tasks by combining AI reasoning\nwith local system tools. This document provides examples of how to use the CLI\nfor file management, code analysis, and data transformation.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> These examples demonstrate potential capabilities. Your actual\n> results can vary based on the model used and your project environment.\n\n## Rename your photographs based on content\n\nYou can use Gemini CLI to automate file management tasks that require visual\nanalysis. In this example, Gemini CLI renames images based on their actual\nsubject matter.\n\nScenario: You have a folder containing the following files:\n\n```bash\nphotos/photo1.png\nphotos/photo2.png\nphotos/photo3.png\n```\n\nGive Gemini the following prompt:\n\n```cli\nRename the photos in my \"photos\" directory based on their contents.\n```\n\nResult: Gemini asks for permission to rename your files.\n\nSelect **Allow once** and your files are renamed:\n\n```bash\nphotos/yellow_flowers.png\nphotos/antique_dresser.png\nphotos/green_android_robot.png\n```\n\n## Explain a repository by reading its code\n\nGemini CLI is effective for rapid codebase exploration. The following example\nshows how to ask Gemini CLI to fetch, analyze, and summarize a remote project.\n\nScenario: You want to understand how a popular open-source utility works by\ninspecting its code, not just its README.\n\nGive Gemini CLI the following prompt:\n\n```cli\nClone the 'chalk' repository from https://github.com/chalk/chalk, read its key source files, and explain how it works.\n```\n\nResult: Gemini performs a sequence of actions to answer your request.\n\n1. First, it asks for permission to run `git clone` to download the repository.\n2. Next, it finds the important source files and asks for permission to read\n them.\n3. Finally, after analyzing the code, it provides a summary.\n\nGemini CLI returns an explanation based on the actual source code:\n\n```markdown\nThe `chalk` library is a popular npm package for styling terminal output with\ncolors. After analyzing the source code, here's how it works:\n\n- **Core functionality:** The main file sets up a chainable API. Each color or\n modifier (like `bold` or `italic`) is a getter that appends the corresponding\n ANSI escape code to an internal stack.\n\n- **Chainable API:** When you call `chalk.red.bold('Hello')`, you are accessing\n getters. The `red` getter adds the red color code, and the `bold` getter adds\n the bold code.\n\n- **Output generation:** When the chain is treated as a string (e.g., in\n `console.log`), a final `toString()` method is called. This method joins all\n the stored ANSI codes, wraps them around the input string ('Hello'), and adds\n a reset code at the end. This produces the final, styled string that the\n terminal can render.\n```\n\n## Combine two spreadsheets into one spreadsheet\n\nGemini CLI can process and transform data across multiple files. Use this\ncapability to merge reports or reformat data sets without manual copying.\n\nScenario: You have two .csv files: `Revenue - 2023.csv` and\n`Revenue - 2024.csv`. Each file contains monthly revenue figures.\n\nGive Gemini CLI the following prompt:\n\n```cli\nCombine the two .csv files into a single .csv file, with each year a different column.\n```\n\nResult: Gemini CLI reads each file and then asks for permission to write a new\nfile. Provide your permission and Gemini CLI provides the combined data:\n\n```csv\nMonth,2023,2024\nJanuary,0,1000\nFebruary,0,1200\nMarch,0,2400\nApril,900,500\nMay,1000,800\nJune,1000,900\nJuly,1200,1000\nAugust,1800,400\nSeptember,2000,2000\nOctober,2400,3400\nNovember,3400,1800\nDecember,2100,9000\n```\n\n## Run unit tests\n\nGemini CLI can generate boilerplate code and tests based on your existing\nimplementation. This example demonstrates how to request code coverage for a\nJavaScript component.\n\nScenario: You've written a simple login page. You wish to write unit tests to\nensure that your login page has code coverage.\n\nGive Gemini CLI the following prompt:\n\n```cli\nWrite unit tests for Login.js.\n```\n\nResult: Gemini CLI asks for permission to write a new file and creates a test\nfor your login page.\n\n## Next steps\n\n- Follow the [File management](/docs/cli/tutorials/file-management) guide to\n start working with your codebase.\n- Follow the [Quickstart](/docs/get-started) to start your first session.\n- See the [Cheatsheet](/docs/cli/cli-reference) for a quick reference of\n available commands.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4803,"content_sha256":"5e9423de7fd8476ca8536de8c4fffc301a18acd48b0a874a82765fc5f4acdb47"},{"filename":"canonical/geminicli-com/docs/get-started/gemini-3.md","content":"---\nsource_url: http://geminicli.com/docs/get-started/gemini-3\nsource_type: llms-txt\ncontent_hash: sha256:35d5f01f7ca2b72e451af3d321628107bf754915369cf082281653eff4a2f7df\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"ebd667a9acf54403c2d8e463e53e049ce6d56ff418102d6f5607de32253bd800\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Gemini 3 Pro and Gemini 3 Flash on Gemini CLI\n\nGemini 3 Pro and Gemini 3 Flash are available on Gemini CLI for all users!\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> Gemini 3.1 Pro Preview is rolling out. To determine whether you have\n> access to Gemini 3.1, use the `/model` command and select **Manual**. If you\n> have access, you will see `gemini-3.1-pro-preview`.\n>\n> If you have access to Gemini 3.1, it will be included in model routing when\n> you select **Auto (Gemini 3)**. You can also launch the Gemini 3.1 model\n> directly using the `-m` flag:\n>\n> ```\n> gemini -m gemini-3.1-pro-preview\n> ```\n>\n> Learn more about [models](/docs/cli/model) and\n> [model routing](/docs/cli/model-routing).\n\n## How to get started with Gemini 3 on Gemini CLI\n\nGet started by upgrading Gemini CLI to the latest version:\n\n```bash\nnpm install -g @google/gemini-cli@latest\n```\n\nIf your version is 0.21.1 or later:\n\n1. Run `/model`.\n2. Select **Auto (Gemini 3)**.\n\nFor more information, see [Gemini CLI model selection](/docs/cli/model).\n\n### Usage limits and fallback\n\nGemini CLI will tell you when you reach your Gemini 3 Pro daily usage limit.\nWhen you encounter that limit, you’ll be given the option to switch to Gemini\n2.5 Pro, upgrade for higher limits, or stop. You’ll also be told when your usage\nlimit resets and Gemini 3 Pro can be used again.\n\n\u003c!-- prettier-ignore -->\n> [!TIP]\n> Looking to upgrade for higher limits? To compare subscription\n> options and find the right quota for your needs, see our\n> [Plans page](https://geminicli.com/plans/).\n\nSimilarly, when you reach your daily usage limit for Gemini 2.5 Pro, you’ll see\na message prompting fallback to Gemini 2.5 Flash.\n\n### Capacity errors\n\nThere may be times when the Gemini 3 Pro model is overloaded. When that happens,\nGemini CLI will ask you to decide whether you want to keep trying Gemini 3 Pro\nor fallback to Gemini 2.5 Pro.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> The **Keep trying** option uses exponential backoff, in which Gemini\n> CLI waits longer between each retry, when the system is busy. If the retry\n> doesn't happen immediately, please wait a few minutes for the request to\n> process.\n\n### Model selection and routing types\n\nWhen using Gemini CLI, you may want to control how your requests are routed\nbetween models. By default, Gemini CLI uses **Auto** routing.\n\nWhen using Gemini 3 Pro, you may want to use Auto routing or Pro routing to\nmanage your usage limits:\n\n- **Auto routing:** Auto routing first determines whether a prompt involves a\n complex or simple operation. For simple prompts, it will automatically use\n Gemini 2.5 Flash. For complex prompts, if Gemini 3 Pro is enabled, it will use\n Gemini 3 Pro; otherwise, it will use Gemini 2.5 Pro.\n- **Pro routing:** If you want to ensure your task is processed by the most\n capable model, use `/model` and select **Pro**. Gemini CLI will prioritize the\n most capable model available, including Gemini 3 Pro if it has been enabled.\n\nTo learn more about selecting a model and routing, refer to\n[Gemini CLI Model Selection](/docs/cli/model).\n\n## How to enable Gemini 3 with Gemini CLI on Gemini Code Assist\n\nIf you're using Gemini Code Assist Standard or Gemini Code Assist Enterprise,\nenabling Gemini 3 Pro on Gemini CLI requires configuring your release channels.\nUsing Gemini 3 Pro will require two steps: administrative enablement and user\nenablement.\n\nTo learn more about these settings, refer to\n[Configure Gemini Code Assist release channels](https://developers.google.com/gemini-code-assist/docs/configure-release-channels).\n\n### Administrator instructions\n\nAn administrator with **Google Cloud Settings Admin** permissions must follow\nthese directions:\n\n- Navigate to the Google Cloud Project you're using with Gemini CLI for Code\n Assist.\n- Go to **Admin for Gemini** > **Settings**.\n- Under **Release channels for Gemini Code Assist in local IDEs** select\n **Preview**.\n- Click **Save changes**.\n\n### User instructions\n\nWait for two to three minutes after your administrator has enabled **Preview**,\nthen:\n\n- Open Gemini CLI.\n- Use the `/settings` command.\n- Set **Preview Features** to `true`.\n\nRestart Gemini CLI and you should have access to Gemini 3.\n\n## Next steps\n\nIf you need help, we recommend searching for an existing\n[GitHub issue](https://github.com/google-gemini/gemini-cli/issues). If you\ncannot find a GitHub issue that matches your concern, you can\n[create a new issue](https://github.com/google-gemini/gemini-cli/issues/new/choose).\nFor comments and feedback, consider opening a\n[GitHub discussion](https://github.com/google-gemini/gemini-cli/discussions).\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4979,"content_sha256":"ba8d348ea3c303684724c8978561c010a3e9e3f62e1e964898ac07b26c84dda4"},{"filename":"canonical/geminicli-com/docs/get-started/installation.md","content":"---\nsource_url: http://geminicli.com/docs/get-started/installation\nsource_type: llms-txt\ncontent_hash: sha256:8ac30e4a3d8810652a166a16997bc05bb6bbe05d971122dd86a8cfbc03b9a206\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"e8668d5a5cbdecabf674902311beb5dd0ac6a16f535ea166b74bc7edb779cb02\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Gemini CLI installation, execution, and releases\n\nThis document provides an overview of Gemini CLI's system requirements,\ninstallation methods, and release types.\n\n## Recommended system specifications\n\n- **Operating System:**\n - macOS 15+\n - Windows 11 24H2+\n - Ubuntu 20.04+\n- **Hardware:**\n - \"Casual\" usage: 4GB+ RAM (short sessions, common tasks and edits)\n - \"Power\" usage: 16GB+ RAM (long sessions, large codebases, deep context)\n- **Runtime:** Node.js 20.0.0+\n- **Shell:** Bash, Zsh, or PowerShell\n- **Location:**\n [Gemini Code Assist supported locations](https://developers.google.com/gemini-code-assist/resources/available-locations#americas)\n- **Internet connection required**\n\n## Install Gemini CLI\n\nWe recommend most users install Gemini CLI using one of the following\ninstallation methods:\n\n- npm\n- Homebrew\n- MacPorts\n- Anaconda\n\nNote that Gemini CLI comes pre-installed on\n[**Cloud Shell**](https://docs.cloud.google.com/shell/docs) and\n[**Cloud Workstations**](https://cloud.google.com/workstations).\n\n### Install globally with npm\n\n```bash\nnpm install -g @google/gemini-cli\n```\n\n### Install globally with Homebrew (macOS/Linux)\n\n```bash\nbrew install gemini-cli\n```\n\n### Install globally with MacPorts (macOS)\n\n```bash\nsudo port install gemini-cli\n```\n\n### Install with Anaconda (for restricted environments)\n\n```bash\n# Create and activate a new environment\nconda create -y -n gemini_env -c conda-forge nodejs\nconda activate gemini_env\n\n# Install Gemini CLI globally via npm (inside the environment)\nnpm install -g @google/gemini-cli\n```\n\n## Run Gemini CLI\n\nFor most users, we recommend running Gemini CLI with the `gemini` command:\n\n```bash\ngemini\n```\n\nFor a list of options and additional commands, see the\n[CLI cheatsheet](/docs/cli/cli-reference).\n\nYou can also run Gemini CLI using one of the following advanced methods:\n\n- Run instantly with npx. You can run Gemini CLI without permanent installation.\n- In a sandbox. This method offers increased security and isolation.\n- From the source. This is recommended for contributors to the project.\n\n### Run instantly with npx\n\n```bash\n# Using npx (no installation required)\nnpx @google/gemini-cli\n```\n\nYou can also execute the CLI directly from the main branch on GitHub, which is\nhelpful for testing features still in development:\n\n```bash\nnpx https://github.com/google-gemini/gemini-cli\n```\n\n### Run in a sandbox (Docker/Podman)\n\nFor security and isolation, Gemini CLI can be run inside a container. This is\nthe default way that the CLI executes tools that might have side effects.\n\n- **Directly from the registry:** You can run the published sandbox image\n directly. This is useful for environments where you only have Docker and want\n to run the CLI.\n ```bash\n # Run the published sandbox image\n docker run --rm -it us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.1\n ```\n- **Using the `--sandbox` flag:** If you have Gemini CLI installed locally\n (using the standard installation described above), you can instruct it to run\n inside the sandbox container.\n ```bash\n gemini --sandbox -y -p \"your prompt here\"\n ```\n\n### Run from source (recommended for Gemini CLI contributors)\n\nContributors to the project will want to run the CLI directly from the source\ncode.\n\n- **Development mode:** This method provides hot-reloading and is useful for\n active development.\n ```bash\n # From the root of the repository\n npm run start\n ```\n- **Production-like mode (linked package):** This method simulates a global\n installation by linking your local package. It's useful for testing a local\n build in a production workflow.\n\n ```bash\n # Link the local cli package to your global node_modules\n npm link packages/cli\n\n # Now you can run your local version using the `gemini` command\n gemini\n ```\n\n## Releases\n\nGemini CLI has three release channels: nightly, preview, and stable. For most\nusers, we recommend the stable release, which is the default installation.\n\n### Stable\n\nNew stable releases are published each week. The stable release is the promotion\nof last week's `preview` release along with any bug fixes. The stable release\nuses `latest` tag, but omitting the tag also installs the latest stable release\nby default:\n\n```bash\n# Both commands install the latest stable release.\nnpm install -g @google/gemini-cli\nnpm install -g @google/gemini-cli@latest\n```\n\n### Preview\n\nNew preview releases will be published each week. These releases are not fully\nvetted and may contain regressions or other outstanding issues. Try out the\npreview release by using the `preview` tag:\n\n```bash\nnpm install -g @google/gemini-cli@preview\n```\n\n### Nightly\n\nNightly releases are published every day. The nightly release includes all\nchanges from the main branch at time of release. It should be assumed there are\npending validations and issues. You can help test the latest changes by\ninstalling with the `nightly` tag:\n\n```bash\nnpm install -g @google/gemini-cli@nightly\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":5321,"content_sha256":"36ff328a9abb80597e470df93e020c8f3554a29250deb2b255581079960c68c6"},{"filename":"canonical/geminicli-com/docs/hooks.md","content":"---\nsource_url: http://geminicli.com/docs/hooks\nsource_type: llms-txt\ncontent_hash: sha256:1da6112beee921c9714da405c4e67cdaa77a8616f118f43d695f4f8936073409\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"993f2e76e78fa8a63fc90db454b7672ce3057cb637b8e4a7833dced928b2be74\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Gemini CLI hooks\n\nHooks are scripts or programs that Gemini CLI executes at specific points in the\nagentic loop, allowing you to intercept and customize behavior without modifying\nthe CLI's source code.\n\n## What are hooks?\n\nHooks run synchronously as part of the agent loop—when a hook event fires,\nGemini CLI waits for all matching hooks to complete before continuing.\n\nWith hooks, you can:\n\n- **Add context:** Inject relevant information (like git history) before the\n model processes a request.\n- **Validate actions:** Review tool arguments and block potentially dangerous\n operations.\n- **Enforce policies:** Implement security scanners and compliance checks.\n- **Log interactions:** Track tool usage and model responses for auditing.\n- **Optimize behavior:** Dynamically filter available tools or adjust model\n parameters.\n\n### Getting started\n\n- **[Writing hooks guide](/docs/hooks/writing-hooks)**: A tutorial on creating your\n first hook with comprehensive examples.\n- **[Best practices](/docs/hooks/best-practices)**: Guidelines on security,\n performance, and debugging.\n- **[Hooks reference](/docs/hooks/reference)**: The definitive technical\n specification of I/O schemas and exit codes.\n\n## Core concepts\n\n### Hook events\n\nHooks are triggered by specific events in Gemini CLI's lifecycle.\n\n| Event | When It Fires | Impact | Common Use Cases |\n| --------------------- | ---------------------------------------------- | ---------------------- | -------------------------------------------- |\n| `SessionStart` | When a session begins (startup, resume, clear) | Inject Context | Initialize resources, load context |\n| `SessionEnd` | When a session ends (exit, clear) | Advisory | Clean up, save state |\n| `BeforeAgent` | After user submits prompt, before planning | Block Turn / Context | Add context, validate prompts, block turns |\n| `AfterAgent` | When agent loop ends | Retry / Halt | Review output, force retry or halt execution |\n| `BeforeModel` | Before sending request to LLM | Block Turn / Mock | Modify prompts, swap models, mock responses |\n| `AfterModel` | After receiving LLM response | Block Turn / Redact | Filter/redact responses, log interactions |\n| `BeforeToolSelection` | Before LLM selects tools | Filter Tools | Filter available tools, optimize selection |\n| `BeforeTool` | Before a tool executes | Block Tool / Rewrite | Validate arguments, block dangerous ops |\n| `AfterTool` | After a tool executes | Block Result / Context | Process results, run tests, hide results |\n| `PreCompress` | Before context compression | Advisory | Save state, notify user |\n| `Notification` | When a system notification occurs | Advisory | Forward to desktop alerts, logging |\n\n### Global mechanics\n\nUnderstanding these core principles is essential for building robust hooks.\n\n#### Strict JSON requirements (The \"Golden Rule\")\n\nHooks communicate via `stdin` (Input) and `stdout` (Output).\n\n1. **Silence is Mandatory**: Your script **must not** print any plain text to\n `stdout` other than the final JSON object. **Even a single `echo` or `print`\n call before the JSON will break parsing.**\n2. **Pollution = Failure**: If `stdout` contains non-JSON text, parsing will\n fail. The CLI will default to \"Allow\" and treat the entire output as a\n `systemMessage`.\n3. **Debug via Stderr**: Use `stderr` for **all** logging and debugging (e.g.,\n `echo \"debug\" >&2`). Gemini CLI captures `stderr` but never attempts to parse\n it as JSON.\n\n#### Exit codes\n\nGemini CLI uses exit codes to determine the high-level outcome of a hook\nexecution:\n\n| Exit Code | Label | Behavioral Impact |\n| --------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **0** | **Success** | The `stdout` is parsed as JSON. **Preferred code** for all logic, including intentional blocks (e.g., `{\"decision\": \"deny\"}`). |\n| **2** | **System Block** | **Critical Block**. The target action (tool, turn, or stop) is aborted. `stderr` is used as the rejection reason. High severity; used for security stops or script failures. |\n| **Other** | **Warning** | Non-fatal failure. A warning is shown, but the interaction proceeds using original parameters. |\n\n#### Matchers\n\nYou can filter which specific tools or triggers fire your hook using the\n`matcher` field.\n\n- **Tool events** (`BeforeTool`, `AfterTool`): Matchers are **Regular\n Expressions**. (e.g., `\"write_.*\"`).\n- **Lifecycle events**: Matchers are **Exact Strings**. (e.g., `\"startup\"`).\n- **Wildcards**: `\"*\"` or `\"\"` (empty string) matches all occurrences.\n\n## Configuration\n\nHooks are configured in `settings.json`. Gemini CLI merges configurations from\nmultiple layers in the following order of precedence (highest to lowest):\n\n1. **Project settings**: `.gemini/settings.json` in the current directory.\n2. **User settings**: `~/.gemini/settings.json`.\n3. **System settings**: `/etc/gemini-cli/settings.json`.\n4. **Extensions**: Hooks defined by installed extensions.\n\n### Configuration schema\n\n```json\n{\n \"hooks\": {\n \"BeforeTool\": [\n {\n \"matcher\": \"write_file|replace\",\n \"hooks\": [\n {\n \"name\": \"security-check\",\n \"type\": \"command\",\n \"command\": \"$GEMINI_PROJECT_DIR/.gemini/hooks/security.sh\",\n \"timeout\": 5000\n }\n ]\n }\n ]\n }\n}\n```\n\n#### Hook configuration fields\n\n| Field | Type | Required | Description |\n| :------------ | :----- | :-------- | :------------------------------------------------------------------- |\n| `type` | string | **Yes** | The execution engine. Currently only `\"command\"` is supported. |\n| `command` | string | **Yes\\*** | The shell command to execute. (Required when `type` is `\"command\"`). |\n| `name` | string | No | A friendly name for identifying the hook in logs and CLI commands. |\n| `timeout` | number | No | Execution timeout in milliseconds (default: 60000). |\n| `description` | string | No | A brief explanation of the hook's purpose. |\n\n---\n\n### Environment variables\n\nHooks are executed with a sanitized environment.\n\n- `GEMINI_PROJECT_DIR`: The absolute path to the project root.\n- `GEMINI_SESSION_ID`: The unique ID for the current session.\n- `GEMINI_CWD`: The current working directory.\n- `CLAUDE_PROJECT_DIR`: (Alias) Provided for compatibility.\n\n## Security and risks\n\n\u003c!-- prettier-ignore -->\n> [!WARNING]\n> Hooks execute arbitrary code with your user privileges. By\n> configuring hooks, you are allowing scripts to run shell commands on your\n> machine.\n\n**Project-level hooks** are particularly risky when opening untrusted projects.\nGemini CLI **fingerprints** project hooks. If a hook's name or command changes\n(e.g., via `git pull`), it is treated as a **new, untrusted hook** and you will\nbe warned before it executes.\n\nSee [Security Considerations](/docs/hooks/best-practices#using-hooks-securely) for\na detailed threat model.\n\n## Managing hooks\n\nUse the CLI commands to manage hooks without editing JSON manually:\n\n- **View hooks:** `/hooks panel`\n- **Enable/Disable all:** `/hooks enable-all` or `/hooks disable-all`\n- **Toggle individual:** `/hooks enable \u003cname>` or `/hooks disable \u003cname>`\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":8589,"content_sha256":"94629244bd62d46310e6e9b34761b8d44c47dfda40ffc34b852e906ec392ff32"},{"filename":"canonical/geminicli-com/docs/hooks/best-practices.md","content":"---\nsource_url: http://geminicli.com/docs/hooks/best-practices\nsource_type: llms-txt\ncontent_hash: sha256:f106c8b566195323c7bbad60e664cfea03e15f9fa7060deaf8714695cbfe4d32\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"de8431db459ac6aa03f21cbef23455ad5b056e601269fc62d0a584dac21d1c8a\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Hooks Best Practices\n\nThis guide covers security considerations, performance optimization, debugging\ntechniques, and privacy considerations for developing and deploying hooks in\nGemini CLI.\n\n## Performance\n\n### Keep hooks fast\n\nHooks run synchronously—slow hooks delay the agent loop. Optimize for speed by\nusing parallel operations:\n\n```javascript\n// Sequential operations are slower\nconst data1 = await fetch(url1).then((r) => r.json());\nconst data2 = await fetch(url2).then((r) => r.json());\n\n// Prefer parallel operations for better performance\n// Start requests concurrently\nconst p1 = fetch(url1).then((r) => r.json());\nconst p2 = fetch(url2).then((r) => r.json());\n\n// Wait for all results\nconst [data1, data2] = await Promise.all([p1, p2]);\n```\n\n### Cache expensive operations\n\nStore results between invocations to avoid repeated computation, especially for\nhooks that run frequently (like `BeforeTool` or `AfterModel`).\n\n```javascript\nconst fs = require('fs');\nconst path = require('path');\n\nconst CACHE_FILE = '.gemini/hook-cache.json';\n\nfunction readCache() {\n try {\n return JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8'));\n } catch {\n return {};\n }\n}\n\nfunction writeCache(data) {\n fs.writeFileSync(CACHE_FILE, JSON.stringify(data, null, 2));\n}\n\nasync function main() {\n const cache = readCache();\n const cacheKey = `tool-list-${(Date.now() / 3600000) | 0}`; // Hourly cache\n\n if (cache[cacheKey]) {\n // Write JSON to stdout\n console.log(JSON.stringify(cache[cacheKey]));\n return;\n }\n\n // Expensive operation\n const result = await computeExpensiveResult();\n cache[cacheKey] = result;\n writeCache(cache);\n\n console.log(JSON.stringify(result));\n}\n```\n\n### Use appropriate events\n\nChoose hook events that match your use case to avoid unnecessary execution.\n\n- **`AfterAgent`**: Fires **once** per turn after the model finishes its final\n response. Use this for quality validation (Retries) or final logging.\n- **`AfterModel`**: Fires after **every chunk** of LLM output. Use this for\n real-time redaction, PII filtering, or monitoring output as it streams.\n\nIf you only need to check the final completion, use `AfterAgent` to save\nperformance.\n\n### Filter with matchers\n\nUse specific matchers to avoid unnecessary hook execution. Instead of matching\nall tools with `*`, specify only the tools you need. This saves the overhead of\nspawning a process for irrelevant events.\n\n```json\n{\n \"matcher\": \"write_file|replace\",\n \"hooks\": [\n {\n \"name\": \"validate-writes\",\n \"type\": \"command\",\n \"command\": \"./validate.sh\"\n }\n ]\n}\n```\n\n### Optimize JSON parsing\n\nFor large inputs (like `AfterModel` receiving a large context), standard JSON\nparsing can be slow. If you only need one field, consider streaming parsers or\nlightweight extraction logic, though for most shell scripts `jq` is sufficient.\n\n## Debugging\n\n### The \"Strict JSON\" rule\n\nThe most common cause of hook failure is \"polluting\" the standard output.\n\n- **stdout** is for **JSON only**.\n- **stderr** is for **logs and text**.\n\n**Good:**\n\n```bash\n#!/bin/bash\necho \"Starting check...\" >&2 # \u003c--- Redirect to stderr\necho '{\"decision\": \"allow\"}'\n\n```\n\n### Log to files\n\nSince hooks run in the background, writing to a dedicated log file is often the\neasiest way to debug complex logic.\n\n```bash\n#!/usr/bin/env bash\nLOG_FILE=\".gemini/hooks/debug.log\"\n\n# Log with timestamp\nlog() {\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] $*\" >> \"$LOG_FILE\"\n}\n\ninput=$(cat)\nlog \"Received input: ${input:0:100}...\"\n\n# Hook logic here\n\nlog \"Hook completed successfully\"\n# Always output valid JSON to stdout at the end, even if just empty\necho \"{}\"\n\n```\n\n### Use stderr for errors\n\nError messages on stderr are surfaced appropriately based on exit codes:\n\n```javascript\ntry {\n const result = dangerousOperation();\n console.log(JSON.stringify({ result }));\n} catch (error) {\n // Write the error description to stderr so the user/agent sees it\n console.error(`Hook error: ${error.message}`);\n process.exit(2); // Blocking error\n}\n```\n\n### Test hooks independently\n\nRun hook scripts manually with sample JSON input to verify they behave as\nexpected before hooking them up to the CLI.\n\n**macOS/Linux**\n\n```bash\n# Create test input\ncat > test-input.json \u003c\u003c 'EOF'\n{\n \"session_id\": \"test-123\",\n \"cwd\": \"/tmp/test\",\n \"hook_event_name\": \"BeforeTool\",\n \"tool_name\": \"write_file\",\n \"tool_input\": {\n \"file_path\": \"test.txt\",\n \"content\": \"Test content\"\n }\n}\nEOF\n\n# Test the hook\ncat test-input.json | .gemini/hooks/my-hook.sh\n\n# Check exit code\necho \"Exit code: $?\"\n```\n\n**Windows (PowerShell)**\n\n```powershell\n# Create test input\n@\"\n{\n \"session_id\": \"test-123\",\n \"cwd\": \"C:\\\\temp\\\\test\",\n \"hook_event_name\": \"BeforeTool\",\n \"tool_name\": \"write_file\",\n \"tool_input\": {\n \"file_path\": \"test.txt\",\n \"content\": \"Test content\"\n }\n}\n\"@ | Out-File -FilePath test-input.json -Encoding utf8\n\n# Test the hook\nGet-Content test-input.json | .\\.gemini\\hooks\\my-hook.ps1\n\n# Check exit code\nWrite-Host \"Exit code: $LASTEXITCODE\"\n```\n\n### Check exit codes\n\nGemini CLI uses exit codes for high-level flow control:\n\n- **Exit 0 (Success)**: The hook ran successfully. The CLI parses `stdout` for\n JSON decisions.\n- **Exit 2 (System Block)**: A critical block occurred. `stderr` is used as the\n reason.\n - For **Agent/Model** events, this aborts the turn.\n - For **Tool** events, this blocks the tool but allows the agent to continue.\n - For **AfterAgent**, this triggers an automatic retry turn.\n\n> **TIP**\n>\n> **Blocking vs. Stopping**: Use `decision: \"deny\"` (or Exit Code 2) to block a\n> **specific action**. Use `{\"continue\": false}` in your JSON output to **kill\n> the entire agent loop** immediately.\n\n```bash\n#!/usr/bin/env bash\nset -e\n\n# Hook logic\nif process_input; then\n echo '{\"decision\": \"allow\"}'\n exit 0\nelse\n echo \"Critical validation failure\" >&2\n exit 2\nfi\n\n```\n\n### Enable telemetry\n\nHook execution is logged when `telemetry.logPrompts` is enabled. You can view\nthese logs to debug execution flow.\n\n```json\n{\n \"telemetry\": {\n \"logPrompts\": true\n }\n}\n```\n\n### Use hook panel\n\nThe `/hooks panel` command inside the CLI shows execution status and recent\noutput:\n\n```bash\n/hooks panel\n```\n\nCheck for:\n\n- Hook execution counts\n- Recent successes/failures\n- Error messages\n- Execution timing\n\n## Development\n\n### Start simple\n\nBegin with basic logging hooks before implementing complex logic:\n\n```bash\n#!/usr/bin/env bash\n# Simple logging hook to understand input structure\ninput=$(cat)\necho \"$input\" >> .gemini/hook-inputs.log\n# Always return valid JSON\necho \"{}\"\n\n```\n\n### Documenting your hooks\n\nMaintainability is critical for complex hook systems. Use descriptions and\ncomments to help yourself and others understand why a hook exists.\n\n**Use the `description` field**: This text is displayed in the `/hooks panel` UI\nand helps diagnose issues.\n\n```json\n{\n \"hooks\": {\n \"BeforeTool\": [\n {\n \"matcher\": \"write_file|replace\",\n \"hooks\": [\n {\n \"name\": \"secret-scanner\",\n \"type\": \"command\",\n \"command\": \"$GEMINI_PROJECT_DIR/.gemini/hooks/block-secrets.sh\",\n \"description\": \"Scans code changes for API keys and secrets before writing\"\n }\n ]\n }\n ]\n }\n}\n```\n\n**Add comments in hook scripts**: Explain performance expectations and\ndependencies.\n\n```javascript\n#!/usr/bin/env node\n/**\n * RAG Tool Filter Hook\n *\n * Reduces the tool space by extracting keywords from the user's request.\n *\n * Performance: ~500ms average\n * Dependencies: @google/generative-ai\n */\n```\n\n### Use JSON libraries\n\nParse JSON with proper libraries instead of text processing.\n\n**Bad:**\n\n```bash\n# Fragile text parsing\ntool_name=$(echo \"$input\" | grep -oP '\"tool_name\":\\s*\"\\K[^\"]+')\n\n```\n\n**Good:**\n\n```bash\n# Robust JSON parsing\ntool_name=$(echo \"$input\" | jq -r '.tool_name')\n\n```\n\n### Make scripts executable\n\nAlways make hook scripts executable on macOS/Linux:\n\n```bash\nchmod +x .gemini/hooks/*.sh\nchmod +x .gemini/hooks/*.js\n\n```\n\n**Windows Note**: On Windows, PowerShell scripts (`.ps1`) don't use `chmod`, but\nyou may need to ensure your execution policy allows them to run (e.g.,\n`Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`).\n\n### Version control\n\nCommit hooks to share with your team:\n\n```bash\ngit add .gemini/hooks/\ngit add .gemini/settings.json\n\n```\n\n**`.gitignore` considerations:**\n\n```gitignore\n# Ignore hook cache and logs\n.gemini/hook-cache.json\n.gemini/hook-debug.log\n.gemini/memory/session-*.jsonl\n\n# Keep hook scripts\n!.gemini/hooks/*.sh\n!.gemini/hooks/*.js\n\n```\n\n## Hook security\n\n### Threat Model\n\nUnderstanding where hooks come from and what they can do is critical for secure\nusage.\n\n| Hook Source | Description |\n| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------- |\n| **System** | Configured by system administrators (e.g., `/etc/gemini-cli/settings.json`, `/Library/...`). Assumed to be the **safest**. |\n| **User** (`~/.gemini/...`) | Configured by you. You are responsible for ensuring they are safe. |\n| **Extensions** | You explicitly approve and install these. Security depends on the extension source (integrity). |\n| **Project** (`./.gemini/...`) | **Untrusted by default.** Safest in trusted internal repos; higher risk in third-party/public repos. |\n\n#### Project Hook Security\n\nWhen you open a project with hooks defined in `.gemini/settings.json`:\n\n1. **Detection**: Gemini CLI detects the hooks.\n2. **Identification**: A unique identity is generated for each hook based on its\n `name` and `command`.\n3. **Warning**: If this specific hook identity has not been seen before, a\n **warning** is displayed.\n4. **Execution**: The hook is executed (unless specific security settings block\n it).\n5. **Trust**: The hook is marked as \"trusted\" for this project.\n\n> **Modification detection**: If the `command` string of a project hook is\n> changed (e.g., by a `git pull`), its identity changes. Gemini CLI will treat\n> it as a **new, untrusted hook** and warn you again. This prevents malicious\n> actors from silently swapping a verified command for a malicious one.\n\n### Risks\n\n| Risk | Description |\n| :--------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- |\n| **Arbitrary Code Execution** | Hooks run as your user. They can do anything you can do (delete files, install software). |\n| **Data Exfiltration** | A hook could read your input (prompts), output (code), or environment variables (`GEMINI_API_KEY`) and send them to a remote server. |\n| **Prompt Injection** | Malicious content in a file or web page could trick an LLM into running a tool that triggers a hook in an unexpected way. |\n\n### Mitigation Strategies\n\n#### Verify the source\n\n**Verify the source** of any project hooks or extensions before enabling them.\n\n- For open-source projects, a quick review of the hook scripts is recommended.\n- For extensions, ensure you trust the author or publisher (e.g., verified\n publishers, well-known community members).\n- Be cautious with obfuscated scripts or compiled binaries from unknown sources.\n\n#### Sanitize environment\n\nHooks inherit the environment of the Gemini CLI process, which may include\nsensitive API keys. Gemini CLI provides a\n[redaction system](/docs/reference/configuration#environment-variable-redaction)\nthat automatically filters variables matching sensitive patterns (e.g., `KEY`,\n`TOKEN`).\n\n> **Disabled by Default**: Environment redaction is currently **OFF by\n> default**. We strongly recommend enabling it if you are running third-party\n> hooks or working in sensitive environments.\n\n**Impact on hooks:**\n\n- **Security**: Prevents your hook scripts from accidentally leaking secrets.\n- **Troubleshooting**: If your hook depends on a specific environment variable\n that is being blocked, you must explicitly allow it in `settings.json`.\n\n```json\n{\n \"security\": {\n \"environmentVariableRedaction\": {\n \"enabled\": true,\n \"allowed\": [\"MY_REQUIRED_TOOL_KEY\"]\n }\n }\n}\n```\n\n**System administrators:** You can enforce redaction for all users in the system\nconfiguration.\n\n## Troubleshooting\n\n### Hook not executing\n\n**Check hook name in `/hooks panel`:** Verify the hook appears in the list and\nis enabled.\n\n**Verify matcher pattern:**\n\n```bash\n# Test regex pattern\necho \"write_file|replace\" | grep -E \"write_.*|replace\"\n\n```\n\n**Check disabled list:** Verify the hook is not listed in your `settings.json`:\n\n```json\n{\n \"hooks\": {\n \"disabled\": [\"my-hook-name\"]\n }\n}\n```\n\n**Ensure script is executable**: For macOS and Linux users, verify the script\nhas execution permissions:\n\n```bash\nls -la .gemini/hooks/my-hook.sh\nchmod +x .gemini/hooks/my-hook.sh\n```\n\n**Windows Note**: On Windows, ensure your execution policy allows running\nscripts (e.g., `Get-ExecutionPolicy`).\n\n**Verify script path:** Ensure the path in `settings.json` resolves correctly.\n\n```bash\n# Check path expansion\necho \"$GEMINI_PROJECT_DIR/.gemini/hooks/my-hook.sh\"\n\n# Verify file exists\ntest -f \"$GEMINI_PROJECT_DIR/.gemini/hooks/my-hook.sh\" && echo \"File exists\"\n```\n\n### Hook timing out\n\n**Check configured timeout:** The default is 60000ms (1 minute). You can\nincrease this in `settings.json`:\n\n```json\n{\n \"name\": \"slow-hook\",\n \"timeout\": 120000\n}\n```\n\n**Optimize slow operations:** Move heavy processing to background tasks or use\ncaching.\n\n### Invalid JSON output\n\n**Validate JSON before outputting:**\n\n```bash\n#!/usr/bin/env bash\noutput='{\"decision\": \"allow\"}'\n\n# Validate JSON\nif echo \"$output\" | jq empty 2>/dev/null; then\n echo \"$output\"\nelse\n echo \"Invalid JSON generated\" >&2\n exit 1\nfi\n\n```\n\n### Environment variables not available\n\n**Check if variable is set:**\n\n```bash\n#!/usr/bin/env bash\nif [ -z \"$GEMINI_PROJECT_DIR\" ]; then\n echo \"GEMINI_PROJECT_DIR not set\" >&2\n exit 1\nfi\n\n```\n\n**Debug available variables:**\n\n```bash\nenv > .gemini/hook-env.log\n```\n\n## Authoring secure hooks\n\nWhen writing your own hooks, follow these practices to ensure they are robust\nand secure.\n\n### Validate all inputs\n\nNever trust data from hooks without validation. Hook inputs often come from the\nLLM or user prompts, which can be manipulated.\n\n```bash\n#!/usr/bin/env bash\ninput=$(cat)\n\n# Validate JSON structure\nif ! echo \"$input\" | jq empty 2>/dev/null; then\n echo \"Invalid JSON input\" >&2\n exit 1\nfi\n\n# Validate tool_name explicitly\ntool_name=$(echo \"$input\" | jq -r '.tool_name // empty')\nif [[ \"$tool_name\" != \"write_file\" && \"$tool_name\" != \"read_file\" ]]; then\n echo \"Unexpected tool: $tool_name\" >&2\n exit 1\nfi\n```\n\n### Use timeouts\n\nPrevent denial-of-service (hanging agents) by enforcing timeouts. Gemini CLI\ndefaults to 60 seconds, but you should set stricter limits for fast hooks.\n\n```json\n{\n \"hooks\": {\n \"BeforeTool\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"name\": \"fast-validator\",\n \"type\": \"command\",\n \"command\": \"./hooks/validate.sh\",\n \"timeout\": 5000 // 5 seconds\n }\n ]\n }\n ]\n }\n}\n```\n\n### Limit permissions\n\nRun hooks with minimal required permissions:\n\n```bash\n#!/usr/bin/env bash\n# Don't run as root\nif [ \"$EUID\" -eq 0 ]; then\n echo \"Hook should not run as root\" >&2\n exit 1\nfi\n\n# Check file permissions before writing\nif [ -w \"$file_path\" ]; then\n # Safe to write\nelse\n echo \"Insufficient permissions\" >&2\n exit 1\nfi\n```\n\n### Example: Secret Scanner\n\nUse `BeforeTool` hooks to prevent committing sensitive data. This is a powerful\npattern for enhancing security in your workflow.\n\n```javascript\nconst SECRET_PATTERNS = [\n /api[_-]?key\\s*[:=]\\s*['\"]?[a-zA-Z0-9_-]{20,}['\"]?/i,\n /password\\s*[:=]\\s*['\"]?[^\\s'\"]{8,}['\"]?/i,\n /secret\\s*[:=]\\s*['\"]?[a-zA-Z0-9_-]{20,}['\"]?/i,\n /AKIA[0-9A-Z]{16}/, // AWS access key\n /ghp_[a-zA-Z0-9]{36}/, // GitHub personal access token\n /sk-[a-zA-Z0-9]{48}/, // OpenAI API key\n];\n\nfunction containsSecret(content) {\n return SECRET_PATTERNS.some((pattern) => pattern.test(content));\n}\n```\n\n## Privacy considerations\n\nHook inputs and outputs may contain sensitive information.\n\n### What data is collected\n\nHook telemetry may include inputs (prompts, code) and outputs (decisions,\nreasons) unless disabled.\n\n### Privacy settings\n\n**Disable PII logging:** If you are working with sensitive data, disable prompt\nlogging in your settings:\n\n```json\n{\n \"telemetry\": {\n \"logPrompts\": false\n }\n}\n```\n\n**Suppress Output:** Individual hooks can request their metadata be hidden from\nlogs and telemetry by returning `\"suppressOutput\": true` in their JSON response.\n\n> **Note**\n\n> `suppressOutput` only affects background logging. Any `systemMessage` or\n> `reason` included in the JSON will still be displayed to the user in the\n> terminal.\n\n### Sensitive data in hooks\n\nIf your hooks process sensitive data:\n\n1. **Minimize logging:** Don't write sensitive data to log files.\n2. **Sanitize outputs:** Remove sensitive data before outputting JSON or writing\n to stderr.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":17932,"content_sha256":"d7f443afd2c41a44b28a5ee217e191b34815263dc53bbdaa53e445b4aa207784"},{"filename":"canonical/geminicli-com/docs/hooks/reference.md","content":"---\nsource_url: http://geminicli.com/docs/hooks/reference\nsource_type: llms-txt\ncontent_hash: sha256:16a1489c56efa233f28d367ddb85cfc934bd84957c7f9de848169395834e0223\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"a5e61b9627f5df2746e12b41c8f80cce2c90d570e914730cd817e6b64a6d56c0\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Hooks reference\n\nThis document provides the technical specification for Gemini CLI hooks,\nincluding JSON schemas and API details.\n\n## Global hook mechanics\n\n- **Communication**: `stdin` for Input (JSON), `stdout` for Output (JSON), and\n `stderr` for logs and feedback.\n- **Exit codes**:\n - `0`: Success. `stdout` is parsed as JSON. **Preferred for all logic.**\n - `2`: System Block. The action is blocked; `stderr` is used as the rejection\n reason.\n - `Other`: Warning. A non-fatal failure occurred; the CLI continues with a\n warning.\n- **Silence is Mandatory**: Your script **must not** print any plain text to\n `stdout` other than the final JSON.\n\n---\n\n## Configuration schema\n\nHooks are defined in `settings.json` within the `hooks` object. Each event\n(e.g., `BeforeTool`) contains an array of **hook definitions**.\n\n### Hook definition\n\n| Field | Type | Required | Description |\n| :----------- | :-------- | :------- | :-------------------------------------------------------------------------------------- |\n| `matcher` | `string` | No | A regex (for tools) or exact string (for lifecycle) to filter when the hook runs. |\n| `sequential` | `boolean` | No | If `true`, hooks in this group run one after another. If `false`, they run in parallel. |\n| `hooks` | `array` | **Yes** | An array of **hook configurations**. |\n\n### Hook configuration\n\n| Field | Type | Required | Description |\n| :------------ | :------- | :-------- | :------------------------------------------------------------------- |\n| `type` | `string` | **Yes** | The execution engine. Currently only `\"command\"` is supported. |\n| `command` | `string` | **Yes\\*** | The shell command to execute. (Required when `type` is `\"command\"`). |\n| `name` | `string` | No | A friendly name for identifying the hook in logs and CLI commands. |\n| `timeout` | `number` | No | Execution timeout in milliseconds (default: 60000). |\n| `description` | `string` | No | A brief explanation of the hook's purpose. |\n\n---\n\n## Base input schema\n\nAll hooks receive these common fields via `stdin`:\n\n```typescript\n{\n \"session_id\": string, // Unique ID for the current session\n \"transcript_path\": string, // Absolute path to session transcript JSON\n \"cwd\": string, // Current working directory\n \"hook_event_name\": string, // The firing event (e.g. \"BeforeTool\")\n \"timestamp\": string // ISO 8601 execution time\n}\n```\n\n---\n\n## Common output fields\n\nMost hooks support these fields in their `stdout` JSON:\n\n| Field | Type | Description |\n| :--------------- | :-------- | :----------------------------------------------------------------------------- |\n| `systemMessage` | `string` | Displayed immediately to the user in the terminal. |\n| `suppressOutput` | `boolean` | If `true`, hides internal hook metadata from logs/telemetry. |\n| `continue` | `boolean` | If `false`, stops the entire agent loop immediately. |\n| `stopReason` | `string` | Displayed to the user when `continue` is `false`. |\n| `decision` | `string` | `\"allow\"` or `\"deny\"` (alias `\"block\"`). Specific impact depends on the event. |\n| `reason` | `string` | The feedback/error message provided when a `decision` is `\"deny\"`. |\n\n---\n\n## Tool hooks\n\n### Matchers and tool names\n\nFor `BeforeTool` and `AfterTool` events, the `matcher` field in your settings is\ncompared against the name of the tool being executed.\n\n- **Built-in Tools**: You can match any built-in tool (e.g., `read_file`,\n `run_shell_command`). See the [Tools Reference](/docs/reference/tools) for a full\n list of available tool names.\n- **MCP Tools**: Tools from MCP servers follow the naming pattern\n `mcp_\u003cserver_name>_\u003ctool_name>`.\n- **Regex Support**: Matchers support regular expressions (e.g.,\n `matcher: \"read_.*\"` matches all file reading tools).\n\n### `BeforeTool`\n\nFires before a tool is invoked. Used for argument validation, security checks,\nand parameter rewriting.\n\n- **Input Fields**:\n - `tool_name`: (`string`) The name of the tool being called.\n - `tool_input`: (`object`) The raw arguments generated by the model.\n - `mcp_context`: (`object`) Optional metadata for MCP-based tools.\n - `original_request_name`: (`string`) The original name of the tool being\n called, if this is a tail tool call.\n- **Relevant Output Fields**:\n - `decision`: Set to `\"deny\"` (or `\"block\"`) to prevent the tool from\n executing.\n - `reason`: Required if denied. This text is sent **to the agent** as a tool\n error, allowing it to respond or retry.\n - `hookSpecificOutput.tool_input`: An object that **merges with and\n overrides** the model's arguments before execution.\n - `continue`: Set to `false` to **kill the entire agent loop** immediately.\n- **Exit Code 2 (Block Tool)**: Prevents execution. Uses `stderr` as the\n `reason` sent to the agent. **The turn continues.**\n\n### `AfterTool`\n\nFires after a tool executes. Used for result auditing, context injection, or\nhiding sensitive output from the agent.\n\n- **Input Fields**:\n - `tool_name`: (`string`)\n - `tool_input`: (`object`) The original arguments.\n - `tool_response`: (`object`) The result containing `llmContent`,\n `returnDisplay`, and optional `error`.\n - `mcp_context`: (`object`)\n - `original_request_name`: (`string`) The original name of the tool being\n called, if this is a tail tool call.\n- **Relevant Output Fields**:\n - `decision`: Set to `\"deny\"` to hide the real tool output from the agent.\n - `reason`: Required if denied. This text **replaces** the tool result sent\n back to the model.\n - `hookSpecificOutput.additionalContext`: Text that is **appended** to the\n tool result for the agent.\n - `hookSpecificOutput.tailToolCallRequest`: (`{ name: string, args: object }`)\n A request to execute another tool immediately after this one. The result of\n this \"tail call\" will replace the original tool's response. Ideal for\n programmatic tool routing.\n - `continue`: Set to `false` to **kill the entire agent loop** immediately.\n- **Exit Code 2 (Block Result)**: Hides the tool result. Uses `stderr` as the\n replacement content sent to the agent. **The turn continues.**\n\n---\n\n## Agent hooks\n\n### `BeforeAgent`\n\nFires after a user submits a prompt, but before the agent begins planning. Used\nfor prompt validation or injecting dynamic context.\n\n- **Input Fields**:\n - `prompt`: (`string`) The original text submitted by the user.\n- **Relevant Output Fields**:\n - `hookSpecificOutput.additionalContext`: Text that is **appended** to the\n prompt for this turn only.\n - `decision`: Set to `\"deny\"` to block the turn and **discard the user's\n message** (it will not appear in history).\n - `continue`: Set to `false` to block the turn but **save the message to\n history**.\n - `reason`: Required if denied or stopped.\n- **Exit Code 2 (Block Turn)**: Aborts the turn and erases the prompt from\n context. Same as `decision: \"deny\"`.\n\n### `AfterAgent`\n\nFires once per turn after the model generates its final response. Primary use\ncase is response validation and automatic retries.\n\n- **Input Fields**:\n - `prompt`: (`string`) The user's original request.\n - `prompt_response`: (`string`) The final text generated by the agent.\n - `stop_hook_active`: (`boolean`) Indicates if this hook is already running as\n part of a retry sequence.\n- **Relevant Output Fields**:\n - `decision`: Set to `\"deny\"` to **reject the response** and force a retry.\n - `reason`: Required if denied. This text is sent **to the agent as a new\n prompt** to request a correction.\n - `continue`: Set to `false` to **stop the session** without retrying.\n - `hookSpecificOutput.clearContext`: If `true`, clears conversation history\n (LLM memory) while preserving UI display.\n- **Exit Code 2 (Retry)**: Rejects the response and triggers an automatic retry\n turn using `stderr` as the feedback prompt.\n\n---\n\n## Model hooks\n\n### `BeforeModel`\n\nFires before sending a request to the LLM. Operates on a stable, SDK-agnostic\nrequest format.\n\n- **Input Fields**:\n - `llm_request`: (`object`) Contains `model`, `messages`, and `config`\n (generation params).\n- **Relevant Output Fields**:\n - `hookSpecificOutput.llm_request`: An object that **overrides** parts of the\n outgoing request (e.g., changing models or temperature).\n - `hookSpecificOutput.llm_response`: A **Synthetic Response** object. If\n provided, the CLI skips the LLM call entirely and uses this as the response.\n - `decision`: Set to `\"deny\"` to block the request and abort the turn.\n- **Exit Code 2 (Block Turn)**: Aborts the turn and skips the LLM call. Uses\n `stderr` as the error message.\n\n### `BeforeToolSelection`\n\nFires before the LLM decides which tools to call. Used to filter the available\ntoolset or force specific tool modes.\n\n- **Input Fields**:\n - `llm_request`: (`object`) Same format as `BeforeModel`.\n- **Relevant Output Fields**:\n - `hookSpecificOutput.toolConfig.mode`: (`\"AUTO\" | \"ANY\" | \"NONE\"`)\n - `\"NONE\"`: Disables all tools (Wins over other hooks).\n - `\"ANY\"`: Forces at least one tool call.\n - `hookSpecificOutput.toolConfig.allowedFunctionNames`: (`string[]`) Whitelist\n of tool names.\n- **Union Strategy**: Multiple hooks' whitelists are **combined**.\n- **Limitations**: Does **not** support `decision`, `continue`, or\n `systemMessage`.\n\n### `AfterModel`\n\nFires immediately after an LLM response chunk is received. Used for real-time\nredaction or PII filtering.\n\n- **Input Fields**:\n - `llm_request`: (`object`) The original request.\n - `llm_response`: (`object`) The model's response (or a single chunk during\n streaming).\n- **Relevant Output Fields**:\n - `hookSpecificOutput.llm_response`: An object that **replaces** the model's\n response chunk.\n - `decision`: Set to `\"deny\"` to discard the response chunk and block the\n turn.\n - `continue`: Set to `false` to **kill the entire agent loop** immediately.\n- **Note on Streaming**: Fired for **every chunk** generated by the model.\n Modifying the response only affects the current chunk.\n- **Exit Code 2 (Block Response)**: Aborts the turn and discards the model's\n output. Uses `stderr` as the error message.\n\n---\n\n## Lifecycle & system hooks\n\n### `SessionStart`\n\nFires on application startup, resuming a session, or after a `/clear` command.\nUsed for loading initial context.\n\n- **Input fields**:\n - `source`: (`\"startup\" | \"resume\" | \"clear\"`)\n- **Relevant output fields**:\n - `hookSpecificOutput.additionalContext`: (`string`)\n - **Interactive**: Injected as the first turn in history.\n - **Non-interactive**: Prepended to the user's prompt.\n - `systemMessage`: Shown at the start of the session.\n- **Advisory only**: `continue` and `decision` fields are **ignored**. Startup\n is never blocked.\n\n### `SessionEnd`\n\nFires when the CLI exits or a session is cleared. Used for cleanup or final\ntelemetry.\n\n- **Input Fields**:\n - `reason`: (`\"exit\" | \"clear\" | \"logout\" | \"prompt_input_exit\" | \"other\"`)\n- **Relevant Output Fields**:\n - `systemMessage`: Displayed to the user during shutdown.\n- **Best Effort**: The CLI **will not wait** for this hook to complete and\n ignores all flow-control fields (`continue`, `decision`).\n\n### `Notification`\n\nFires when the CLI emits a system alert (e.g., Tool Permissions). Used for\nexternal logging or cross-platform alerts.\n\n- **Input Fields**:\n - `notification_type`: (`\"ToolPermission\"`)\n - `message`: Summary of the alert.\n - `details`: JSON object with alert-specific metadata (e.g., tool name, file\n path).\n- **Relevant Output Fields**:\n - `systemMessage`: Displayed alongside the system alert.\n- **Observability Only**: This hook **cannot** block alerts or grant permissions\n automatically. Flow-control fields are ignored.\n\n### `PreCompress`\n\nFires before the CLI summarizes history to save tokens. Used for logging or\nstate saving.\n\n- **Input Fields**:\n - `trigger`: (`\"auto\" | \"manual\"`)\n- **Relevant Output Fields**:\n - `systemMessage`: Displayed to the user before compression.\n- **Advisory Only**: Fired asynchronously. It **cannot** block or modify the\n compression process. Flow-control fields are ignored.\n\n---\n\n## Stable Model API\n\nGemini CLI uses these structures to ensure hooks don't break across SDK updates.\n\n**LLMRequest**:\n\n```typescript\n{\n \"model\": string,\n \"messages\": Array\u003c{\n \"role\": \"user\" | \"model\" | \"system\",\n \"content\": string // Non-text parts are filtered out for hooks\n }>,\n \"config\": { \"temperature\": number, ... },\n \"toolConfig\": { \"mode\": string, \"allowedFunctionNames\": string[] }\n}\n\n```\n\n**LLMResponse**:\n\n```typescript\n{\n \"candidates\": Array\u003c{\n \"content\": { \"role\": \"model\", \"parts\": string[] },\n \"finishReason\": string\n }>,\n \"usageMetadata\": { \"totalTokenCount\": number }\n}\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":13624,"content_sha256":"67e39d91dbeef1a9ebde1a50f59a2df8ffcf887ee79c97da4f702ffb2a552446"},{"filename":"canonical/geminicli-com/docs/hooks/writing-hooks.md","content":"---\nsource_url: http://geminicli.com/docs/hooks/writing-hooks\nsource_type: llms-txt\ncontent_hash: sha256:09b54285a44502abe95396b0c740279d31f01c53d98a77a17974da2b66984775\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"18367081bcdd224da936a95392498c41baac178626c14c460cbbd130bbf4e49f\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Writing hooks for Gemini CLI\n\nThis guide will walk you through creating hooks for Gemini CLI, from a simple\nlogging hook to a comprehensive workflow assistant.\n\n## Prerequisites\n\nBefore you start, make sure you have:\n\n- Gemini CLI installed and configured\n- Basic understanding of shell scripting or JavaScript/Node.js\n- Familiarity with JSON for hook input/output\n\n## Quick start\n\nLet's create a simple hook that logs all tool executions to understand the\nbasics.\n\n**Crucial Rule:** Always write logs to `stderr`. Write only the final JSON to\n`stdout`.\n\n### Step 1: Create your hook script\n\nCreate a directory for hooks and a simple logging script.\n\n> **Note**:\n>\n> This example uses `jq` to parse JSON. If you don't have it installed, you can\n> perform similar logic using Node.js or Python.\n\n**macOS/Linux**\n\n```bash\nmkdir -p .gemini/hooks\ncat > .gemini/hooks/log-tools.sh \u003c\u003c 'EOF'\n#!/usr/bin/env bash\n# Read hook input from stdin\ninput=$(cat)\n\n# Extract tool name (requires jq)\ntool_name=$(echo \"$input\" | jq -r '.tool_name')\n\n# Log to stderr (visible in terminal if hook fails, or captured in logs)\necho \"Logging tool: $tool_name\" >&2\n\n# Log to file\necho \"[$(date)] Tool executed: $tool_name\" >> .gemini/tool-log.txt\n\n# Return success (exit 0) with empty JSON\necho \"{}\"\nexit 0\nEOF\n\nchmod +x .gemini/hooks/log-tools.sh\n```\n\n**Windows (PowerShell)**\n\n```powershell\nNew-Item -ItemType Directory -Force -Path \".gemini\\hooks\"\n@\"\n# Read hook input from stdin\n`$inputJson = `$input | Out-String | ConvertFrom-Json\n\n# Extract tool name\n`$toolName = `$inputJson.tool_name\n\n# Log to stderr (visible in terminal if hook fails, or captured in logs)\n[Console]::Error.WriteLine(\"Logging tool: `$toolName\")\n\n# Log to file\n\"[`$(Get-Date -Format 'o')] Tool executed: `$toolName\" | Out-File -FilePath \".gemini\\tool-log.txt\" -Append -Encoding utf8\n\n# Return success with empty JSON\n\"{}\"\n\"@ | Out-File -FilePath \".gemini\\hooks\\log-tools.ps1\" -Encoding utf8\n```\n\n## Exit Code Strategies\n\nThere are two ways to control or block an action in Gemini CLI:\n\n| Strategy | Exit Code | Implementation | Best For |\n| :------------------------- | :-------- | :----------------------------------------------------------------- | :---------------------------------------------------------- |\n| **Structured (Idiomatic)** | `0` | Return a JSON object like `{\"decision\": \"deny\", \"reason\": \"...\"}`. | Production hooks, custom user feedback, and complex logic. |\n| **Emergency Brake** | `2` | Print the error message to `stderr` and exit. | Simple security gates, script errors, or rapid prototyping. |\n\n## Practical examples\n\n### Security: Block secrets in commits\n\nPrevent committing files containing API keys or passwords. Note that we use\n**Exit Code 0** to provide a structured denial message to the agent.\n\n**`.gemini/hooks/block-secrets.sh`:**\n\n```bash\n#!/usr/bin/env bash\ninput=$(cat)\n\n# Extract content being written\ncontent=$(echo \"$input\" | jq -r '.tool_input.content // .tool_input.new_string // \"\"')\n\n# Check for secrets\nif echo \"$content\" | grep -qE 'api[_-]?key|password|secret'; then\n # Log to stderr\n echo \"Blocked potential secret\" >&2\n\n # Return structured denial to stdout\n cat \u003c\u003cEOF\n{\n \"decision\": \"deny\",\n \"reason\": \"Security Policy: Potential secret detected in content.\",\n \"systemMessage\": \"🔒 Security scanner blocked operation\"\n}\nEOF\n exit 0\nfi\n\n# Allow\necho '{\"decision\": \"allow\"}'\nexit 0\n```\n\n### Dynamic context injection (Git History)\n\nAdd relevant project context before each agent interaction.\n\n**`.gemini/hooks/inject-context.sh`:**\n\n```bash\n#!/usr/bin/env bash\n\n# Get recent git commits for context\ncontext=$(git log -5 --oneline 2>/dev/null || echo \"No git history\")\n\n# Return as JSON\ncat \u003c\u003cEOF\n{\n \"hookSpecificOutput\": {\n \"hookEventName\": \"BeforeAgent\",\n \"additionalContext\": \"Recent commits:\\n$context\"\n }\n}\nEOF\n```\n\n### RAG-based Tool Filtering (BeforeToolSelection)\n\nUse `BeforeToolSelection` to intelligently reduce the tool space. This example\nuses a Node.js script to check the user's prompt and allow only relevant tools.\n\n**`.gemini/hooks/filter-tools.js`:**\n\n```javascript\n#!/usr/bin/env node\nconst fs = require('fs');\n\nasync function main() {\n const input = JSON.parse(fs.readFileSync(0, 'utf-8'));\n const { llm_request } = input;\n\n // Decoupled API: Access messages from llm_request\n const messages = llm_request.messages || [];\n const lastUserMessage = messages\n .slice()\n .reverse()\n .find((m) => m.role === 'user');\n\n if (!lastUserMessage) {\n console.log(JSON.stringify({})); // Do nothing\n return;\n }\n\n const text = lastUserMessage.content;\n const allowed = ['write_todos']; // Always allow memory\n\n // Simple keyword matching\n if (text.includes('read') || text.includes('check')) {\n allowed.push('read_file', 'list_directory');\n }\n if (text.includes('test')) {\n allowed.push('run_shell_command');\n }\n\n // If we found specific intent, filter tools. Otherwise allow all.\n if (allowed.length > 1) {\n console.log(\n JSON.stringify({\n hookSpecificOutput: {\n hookEventName: 'BeforeToolSelection',\n toolConfig: {\n mode: 'ANY', // Force usage of one of these tools (or AUTO)\n allowedFunctionNames: allowed,\n },\n },\n }),\n );\n } else {\n console.log(JSON.stringify({}));\n }\n}\n\nmain().catch((err) => {\n console.error(err);\n process.exit(1);\n});\n```\n\n**`.gemini/settings.json`:**\n\n```json\n{\n \"hooks\": {\n \"BeforeToolSelection\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"name\": \"intent-filter\",\n \"type\": \"command\",\n \"command\": \"node .gemini/hooks/filter-tools.js\"\n }\n ]\n }\n ]\n }\n}\n```\n\n> **TIP**\n>\n> **Union Aggregation Strategy**: `BeforeToolSelection` is unique in that it\n> combines the results of all matching hooks. If you have multiple filtering\n> hooks, the agent will receive the **union** of all whitelisted tools. Only\n> using `mode: \"NONE\"` will override other hooks to disable all tools.\n\n## Complete example: Smart Development Workflow Assistant\n\nThis comprehensive example demonstrates all hook events working together. We\nwill build a system that maintains memory, filters tools, and checks for\nsecurity.\n\n### Architecture\n\n1. **SessionStart**: Load project memories.\n2. **BeforeAgent**: Inject memories into context.\n3. **BeforeToolSelection**: Filter tools based on intent.\n4. **BeforeTool**: Scan for secrets.\n5. **AfterModel**: Record interactions.\n6. **AfterAgent**: Validate final response quality (Retry).\n7. **SessionEnd**: Consolidate memories.\n\n### Configuration (`.gemini/settings.json`)\n\n```json\n{\n \"hooks\": {\n \"SessionStart\": [\n {\n \"matcher\": \"startup\",\n \"hooks\": [\n {\n \"name\": \"init\",\n \"type\": \"command\",\n \"command\": \"node .gemini/hooks/init.js\"\n }\n ]\n }\n ],\n \"BeforeAgent\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"name\": \"memory\",\n \"type\": \"command\",\n \"command\": \"node .gemini/hooks/inject-memories.js\"\n }\n ]\n }\n ],\n \"BeforeToolSelection\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"name\": \"filter\",\n \"type\": \"command\",\n \"command\": \"node .gemini/hooks/rag-filter.js\"\n }\n ]\n }\n ],\n \"BeforeTool\": [\n {\n \"matcher\": \"write_file\",\n \"hooks\": [\n {\n \"name\": \"security\",\n \"type\": \"command\",\n \"command\": \"node .gemini/hooks/security.js\"\n }\n ]\n }\n ],\n \"AfterModel\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"name\": \"record\",\n \"type\": \"command\",\n \"command\": \"node .gemini/hooks/record.js\"\n }\n ]\n }\n ],\n \"AfterAgent\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"name\": \"validate\",\n \"type\": \"command\",\n \"command\": \"node .gemini/hooks/validate.js\"\n }\n ]\n }\n ],\n \"SessionEnd\": [\n {\n \"matcher\": \"exit\",\n \"hooks\": [\n {\n \"name\": \"save\",\n \"type\": \"command\",\n \"command\": \"node .gemini/hooks/consolidate.js\"\n }\n ]\n }\n ]\n }\n}\n```\n\n### Hook Scripts\n\n> **Note**: For brevity, these scripts use `console.error` for logging and\n> standard `console.log` for JSON output.\n\n#### 1. Initialize (`init.js`)\n\n```javascript\n#!/usr/bin/env node\n// Initialize DB or resources\nconsole.error('Initializing assistant...');\n\n// Output to user\nconsole.log(\n JSON.stringify({\n systemMessage: '🧠 Smart Assistant Loaded',\n }),\n);\n```\n\n#### 2. Inject Memories (`inject-memories.js`)\n\n```javascript\n#!/usr/bin/env node\nconst fs = require('fs');\n\nasync function main() {\n const input = JSON.parse(fs.readFileSync(0, 'utf-8'));\n // Assume we fetch memories from a DB here\n const memories = '- [Memory] Always use TypeScript for this project.';\n\n console.log(\n JSON.stringify({\n hookSpecificOutput: {\n hookEventName: 'BeforeAgent',\n additionalContext: `\\n## Relevant Memories\\n${memories}`,\n },\n }),\n );\n}\nmain();\n```\n\n#### 3. Security Check (`security.js`)\n\n```javascript\n#!/usr/bin/env node\nconst fs = require('fs');\nconst input = JSON.parse(fs.readFileSync(0));\nconst content = input.tool_input.content || '';\n\nif (content.includes('SECRET_KEY')) {\n console.log(\n JSON.stringify({\n decision: 'deny',\n reason: 'Found SECRET_KEY in content',\n systemMessage: '🚨 Blocked sensitive commit',\n }),\n );\n process.exit(0);\n}\n\nconsole.log(JSON.stringify({ decision: 'allow' }));\n```\n\n#### 4. Record Interaction (`record.js`)\n\n```javascript\n#!/usr/bin/env node\nconst fs = require('fs');\nconst path = require('path');\n\nconst input = JSON.parse(fs.readFileSync(0));\nconst { llm_request, llm_response } = input;\nconst logFile = path.join(\n process.env.GEMINI_PROJECT_DIR,\n '.gemini/memory/session.jsonl',\n);\n\nfs.appendFileSync(\n logFile,\n JSON.stringify({\n request: llm_request,\n response: llm_response,\n timestamp: new Date().toISOString(),\n }) + '\\n',\n);\n\nconsole.log(JSON.stringify({}));\n```\n\n#### 5. Validate Response (`validate.js`)\n\n```javascript\n#!/usr/bin/env node\nconst fs = require('fs');\nconst input = JSON.parse(fs.readFileSync(0));\nconst response = input.prompt_response;\n\n// Example: Check if the agent forgot to include a summary\nif (!response.includes('Summary:')) {\n console.log(\n JSON.stringify({\n decision: 'block', // Triggers an automatic retry turn\n reason: 'Your response is missing a Summary section. Please add one.',\n systemMessage: '🔄 Requesting missing summary...',\n }),\n );\n process.exit(0);\n}\n\nconsole.log(JSON.stringify({ decision: 'allow' }));\n```\n\n#### 6. Consolidate Memories (`consolidate.js`)\n\n```javascript\n#!/usr/bin/env node\n// Logic to save final session state\nconsole.error('Consolidating memories for session end...');\n```\n\n## Packaging as an extension\n\nWhile project-level hooks are great for specific repositories, you can share\nyour hooks across multiple projects by packaging them as a\n[Gemini CLI extension](/docs/extensions). This provides version control,\neasy distribution, and centralized management.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":11888,"content_sha256":"bb5a99e89b44bab4f1a9da0fea7a7ede873c1d6ad6b451b7e73c7efa2171518a"},{"filename":"canonical/geminicli-com/docs/ide-integration.md","content":"---\nsource_url: http://geminicli.com/docs/ide-integration\nsource_type: llms-txt\ncontent_hash: sha256:463440102013d3dd504cb5d4b89dbd85989dcf884751913fc6bddbcc988fee4d\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"9bfa55aa029c04d001059a35cb06e5789b7706a241149bdb96488c39ed5825ec\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# IDE integration\n\nGemini CLI can integrate with your IDE to provide a more seamless and\ncontext-aware experience. This integration allows the CLI to understand your\nworkspace better and enables powerful features like native in-editor diffing.\n\nCurrently, the supported IDEs are [Antigravity](https://antigravity.google),\n[Visual Studio Code](https://code.visualstudio.com/), and other editors that\nsupport VS Code extensions. To build support for other editors, see the\n[IDE Companion Extension Spec](/docs/ide-integration/ide-companion-spec).\n\n## Features\n\n- **Workspace context:** The CLI automatically gains awareness of your workspace\n to provide more relevant and accurate responses. This context includes:\n - The **10 most recently accessed files** in your workspace.\n - Your active cursor position.\n - Any text you have selected (up to a 16KB limit; longer selections will be\n truncated).\n\n- **Native diffing:** When Gemini suggests code modifications, you can view the\n changes directly within your IDE's native diff viewer. This allows you to\n review, edit, and accept or reject the suggested changes seamlessly.\n\n- **VS Code commands:** You can access Gemini CLI features directly from the VS\n Code Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`):\n - `Gemini CLI: Run`: Starts a new Gemini CLI session in the integrated\n terminal.\n - `Gemini CLI: Accept Diff`: Accepts the changes in the active diff editor.\n - `Gemini CLI: Close Diff Editor`: Rejects the changes and closes the active\n diff editor.\n - `Gemini CLI: View Third-Party Notices`: Displays the third-party notices for\n the extension.\n\n## Installation and setup\n\nThere are three ways to set up the IDE integration:\n\n### 1. Automatic nudge (recommended)\n\nWhen you run Gemini CLI inside a supported editor, it will automatically detect\nyour environment and prompt you to connect. Answering \"Yes\" will automatically\nrun the necessary setup, which includes installing the companion extension and\nenabling the connection.\n\n### 2. Manual installation from CLI\n\nIf you previously dismissed the prompt or want to install the extension\nmanually, you can run the following command inside Gemini CLI:\n\n```\n/ide install\n```\n\nThis will find the correct extension for your IDE and install it.\n\n### 3. Manual installation from a marketplace\n\nYou can also install the extension directly from a marketplace.\n\n- **For Visual Studio Code:** Install from the\n [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=google.gemini-cli-vscode-ide-companion).\n- **For VS Code forks:** To support forks of VS Code, the extension is also\n published on the\n [Open VSX Registry](https://open-vsx.org/extension/google/gemini-cli-vscode-ide-companion).\n Follow your editor's instructions for installing extensions from this\n registry.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> The \"Gemini CLI Companion\" extension may appear towards the bottom of\n> search results. If you don't see it immediately, try scrolling down or\n> sorting by \"Newly Published\".\n>\n> After manually installing the extension, you must run `/ide enable` in the CLI\n> to activate the integration.\n\n## Usage\n\n### Enabling and disabling\n\nYou can control the IDE integration from within the CLI:\n\n- To enable the connection to the IDE, run:\n ```\n /ide enable\n ```\n- To disable the connection, run:\n ```\n /ide disable\n ```\n\nWhen enabled, Gemini CLI will automatically attempt to connect to the IDE\ncompanion extension.\n\n### Checking the status\n\nTo check the connection status and see the context the CLI has received from the\nIDE, run:\n\n```\n/ide status\n```\n\nIf connected, this command will show the IDE it's connected to and a list of\nrecently opened files it is aware of.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> The file list is limited to 10 recently accessed files within your\n> workspace and only includes local files on disk.)\n\n### Working with diffs\n\nWhen you ask Gemini to modify a file, it can open a diff view directly in your\neditor.\n\n**To accept a diff**, you can perform any of the following actions:\n\n- Click the **checkmark icon** in the diff editor's title bar.\n- Save the file (e.g., with `Cmd+S` or `Ctrl+S`).\n- Open the Command Palette and run **Gemini CLI: Accept Diff**.\n- Respond with `yes` in the CLI when prompted.\n\n**To reject a diff**, you can:\n\n- Click the **'x' icon** in the diff editor's title bar.\n- Close the diff editor tab.\n- Open the Command Palette and run **Gemini CLI: Close Diff Editor**.\n- Respond with `no` in the CLI when prompted.\n\nYou can also **modify the suggested changes** directly in the diff view before\naccepting them.\n\nIf you select ‘Allow for this session’ in the CLI, changes will no longer show\nup in the IDE as they will be auto-accepted.\n\n## Using with sandboxing\n\nIf you are using Gemini CLI within a sandbox, please be aware of the following:\n\n- **On macOS:** The IDE integration requires network access to communicate with\n the IDE companion extension. You must use a Seatbelt profile that allows\n network access.\n- **In a Docker container:** If you run Gemini CLI inside a Docker (or Podman)\n container, the IDE integration can still connect to the VS Code extension\n running on your host machine. The CLI is configured to automatically find the\n IDE server on `host.docker.internal`. No special configuration is usually\n required, but you may need to ensure your Docker networking setup allows\n connections from the container to the host.\n\n## Troubleshooting\n\nIf you encounter issues with IDE integration, here are some common error\nmessages and how to resolve them.\n\n### Connection errors\n\n- **Message:**\n `🔴 Disconnected: Failed to connect to IDE companion extension in [IDE Name]. Please ensure the extension is running. To install the extension, run /ide install.`\n - **Cause:** Gemini CLI could not find the necessary environment variables\n (`GEMINI_CLI_IDE_WORKSPACE_PATH` or `GEMINI_CLI_IDE_SERVER_PORT`) to connect\n to the IDE. This usually means the IDE companion extension is not running or\n did not initialize correctly.\n - **Solution:**\n 1. Make sure you have installed the **Gemini CLI Companion** extension in\n your IDE and that it is enabled.\n 2. Open a new terminal window in your IDE to ensure it picks up the correct\n environment.\n\n- **Message:**\n `🔴 Disconnected: IDE connection error. The connection was lost unexpectedly. Please try reconnecting by running /ide enable`\n - **Cause:** The connection to the IDE companion was lost.\n - **Solution:** Run `/ide enable` to try and reconnect. If the issue\n continues, open a new terminal window or restart your IDE.\n\n### Manual PID override\n\nIf automatic IDE detection fails, or if you are running Gemini CLI in a\nstandalone terminal and want to manually associate it with a specific IDE\ninstance, you can set the `GEMINI_CLI_IDE_PID` environment variable to the\nprocess ID (PID) of your IDE.\n\n**macOS/Linux**\n\n```bash\nexport GEMINI_CLI_IDE_PID=12345\n```\n\n**Windows (PowerShell)**\n\n```powershell\n$env:GEMINI_CLI_IDE_PID=12345\n```\n\nWhen this variable is set, Gemini CLI will skip automatic detection and attempt\nto connect using the provided PID.\n\n### Configuration errors\n\n- **Message:**\n `🔴 Disconnected: Directory mismatch. Gemini CLI is running in a different location than the open workspace in [IDE Name]. Please run the CLI from one of the following directories: [List of directories]`\n - **Cause:** The CLI's current working directory is outside the workspace you\n have open in your IDE.\n - **Solution:** `cd` into the same directory that is open in your IDE and\n restart the CLI.\n\n- **Message:**\n `🔴 Disconnected: To use this feature, please open a workspace folder in [IDE Name] and try again.`\n - **Cause:** You have no workspace open in your IDE.\n - **Solution:** Open a workspace in your IDE and restart the CLI.\n\n### General errors\n\n- **Message:**\n `IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: [List of IDEs]`\n - **Cause:** You are running Gemini CLI in a terminal or environment that is\n not a supported IDE.\n - **Solution:** Run Gemini CLI from the integrated terminal of a supported\n IDE, like Antigravity or VS Code.\n\n- **Message:**\n `No installer is available for IDE. Please install the Gemini CLI Companion extension manually from the marketplace.`\n - **Cause:** You ran `/ide install`, but the CLI does not have an automated\n installer for your specific IDE.\n - **Solution:** Open your IDE's extension marketplace, search for \"Gemini CLI\n Companion\", and\n [install it manually](#3-manual-installation-from-a-marketplace).\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":9058,"content_sha256":"5a99b3177829841300d9533fdceea5dbc9d3747dc3dbf6dc75f6bfbd763cc4a5"},{"filename":"canonical/geminicli-com/docs/ide-integration/ide-companion-spec.md","content":"---\nsource_url: http://geminicli.com/docs/ide-integration/ide-companion-spec\nsource_type: llms-txt\ncontent_hash: sha256:0f0560d9e88f0c021fa41e89049fd6820d9ef25c65ebb3d5f8893ceec6f9691e\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"9734bbb5bd4092f8ad934122b840dd0bf6181e18a92422955b1d4f81085f8135\"'\nlast_modified: '2026-03-22T19:06:33Z'\npublished_at: '2025-09-15'\n---\n\n# Gemini CLI companion plugin: Interface specification\n\n> Last Updated: September 15, 2025\n\nThis document defines the contract for building a companion plugin to enable\nGemini CLI's IDE mode. For VS Code, these features (native diffing, context\nawareness) are provided by the official extension\n([marketplace](https://marketplace.visualstudio.com/items?itemName=Google.gemini-cli-vscode-ide-companion)).\nThis specification is for contributors who wish to bring similar functionality\nto other editors like JetBrains IDEs, Sublime Text, etc.\n\n## I. The communication interface\n\nGemini CLI and the IDE plugin communicate through a local communication channel.\n\n### 1. Transport layer: MCP over HTTP\n\nThe plugin **MUST** run a local HTTP server that implements the **Model Context\nProtocol (MCP)**.\n\n- **Protocol:** The server must be a valid MCP server. We recommend using an\n existing MCP SDK for your language of choice if available.\n- **Endpoint:** The server should expose a single endpoint (e.g., `/mcp`) for\n all MCP communication.\n- **Port:** The server **MUST** listen on a dynamically assigned port (i.e.,\n listen on port `0`).\n\n### 2. Discovery mechanism: The port file\n\nFor Gemini CLI to connect, it needs to discover which IDE instance it's running\nin and what port your server is using. The plugin **MUST** facilitate this by\ncreating a \"discovery file.\"\n\n- **How the CLI finds the file:** The CLI determines the Process ID (PID) of the\n IDE it's running in by traversing the process tree. It then looks for a\n discovery file that contains this PID in its name.\n- **File location:** The file must be created in a specific directory:\n `os.tmpdir()/gemini/ide/`. Your plugin must create this directory if it\n doesn't exist.\n- **File naming convention:** The filename is critical and **MUST** follow the\n pattern: `gemini-ide-server-${PID}-${PORT}.json`\n - `${PID}`: The process ID of the parent IDE process. Your plugin must\n determine this PID and include it in the filename.\n - `${PORT}`: The port your MCP server is listening on.\n- **File content and workspace validation:** The file **MUST** contain a JSON\n object with the following structure:\n\n ```json\n {\n \"port\": 12345,\n \"workspacePath\": \"/path/to/project1:/path/to/project2\",\n \"authToken\": \"a-very-secret-token\",\n \"ideInfo\": {\n \"name\": \"vscode\",\n \"displayName\": \"VS Code\"\n }\n }\n ```\n - `port` (number, required): The port of the MCP server.\n - `workspacePath` (string, required): A list of all open workspace root paths,\n delimited by the OS-specific path separator (`:` for Linux/macOS, `;` for\n Windows). The CLI uses this path to ensure it's running in the same project\n folder that's open in the IDE. If the CLI's current working directory is not\n a sub-directory of `workspacePath`, the connection will be rejected. Your\n plugin **MUST** provide the correct, absolute path(s) to the root of the\n open workspace(s).\n - `authToken` (string, required): A secret token for securing the connection.\n The CLI will include this token in an `Authorization: Bearer \u003ctoken>` header\n on all requests.\n - `ideInfo` (object, required): Information about the IDE.\n - `name` (string, required): A short, lowercase identifier for the IDE\n (e.g., `vscode`, `jetbrains`).\n - `displayName` (string, required): A user-friendly name for the IDE (e.g.,\n `VS Code`, `JetBrains IDE`).\n\n- **Authentication:** To secure the connection, the plugin **MUST** generate a\n unique, secret token and include it in the discovery file. The CLI will then\n include this token in the `Authorization` header for all requests to the MCP\n server (e.g., `Authorization: Bearer a-very-secret-token`). Your server\n **MUST** validate this token on every request and reject any that are\n unauthorized.\n- **Tie-breaking with environment variables (recommended):** For the most\n reliable experience, your plugin **SHOULD** both create the discovery file and\n set the `GEMINI_CLI_IDE_SERVER_PORT` environment variable in the integrated\n terminal. The file serves as the primary discovery mechanism, but the\n environment variable is crucial for tie-breaking. If a user has multiple IDE\n windows open for the same workspace, the CLI uses the\n `GEMINI_CLI_IDE_SERVER_PORT` variable to identify and connect to the correct\n window's server.\n\n## II. The context interface\n\nTo enable context awareness, the plugin **MAY** provide the CLI with real-time\ninformation about the user's activity in the IDE.\n\n### `ide/contextUpdate` notification\n\nThe plugin **MAY** send an `ide/contextUpdate`\n[notification](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#notifications)\nto the CLI whenever the user's context changes.\n\n- **Triggering events:** This notification should be sent (with a recommended\n debounce of 50ms) when:\n - A file is opened, closed, or focused.\n - The user's cursor position or text selection changes in the active file.\n- **Payload (`IdeContext`):** The notification parameters **MUST** be an\n `IdeContext` object:\n\n ```typescript\n interface IdeContext {\n workspaceState?: {\n openFiles?: File[];\n isTrusted?: boolean;\n };\n }\n\n interface File {\n // Absolute path to the file\n path: string;\n // Last focused Unix timestamp (for ordering)\n timestamp: number;\n // True if this is the currently focused file\n isActive?: boolean;\n cursor?: {\n // 1-based line number\n line: number;\n // 1-based character number\n character: number;\n };\n // The text currently selected by the user\n selectedText?: string;\n }\n ```\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> The `openFiles` list should only include files that exist on disk.\n> Virtual files (e.g., unsaved files without a path, editor settings pages)\n> **MUST** be excluded.\n\n### How the CLI uses this context\n\nAfter receiving the `IdeContext` object, the CLI performs several normalization\nand truncation steps before sending the information to the model.\n\n- **File ordering:** The CLI uses the `timestamp` field to determine the most\n recently used files. It sorts the `openFiles` list based on this value.\n Therefore, your plugin **MUST** provide an accurate Unix timestamp for when a\n file was last focused.\n- **Active file:** The CLI considers only the most recent file (after sorting)\n to be the \"active\" file. It will ignore the `isActive` flag on all other files\n and clear their `cursor` and `selectedText` fields. Your plugin should focus\n on setting `isActive: true` and providing cursor/selection details only for\n the currently focused file.\n- **Truncation:** To manage token limits, the CLI truncates both the file list\n (to 10 files) and the `selectedText` (to 16KB).\n\nWhile the CLI handles the final truncation, it is highly recommended that your\nplugin also limits the amount of context it sends.\n\n## III. The diffing interface\n\nTo enable interactive code modifications, the plugin **MAY** expose a diffing\ninterface. This allows the CLI to request that the IDE open a diff view, showing\nproposed changes to a file. The user can then review, edit, and ultimately\naccept or reject these changes directly within the IDE.\n\n### `openDiff` tool\n\nThe plugin **MUST** register an `openDiff` tool on its MCP server.\n\n- **Description:** This tool instructs the IDE to open a modifiable diff view\n for a specific file.\n- **Request (`OpenDiffRequest`):** The tool is invoked via a `tools/call`\n request. The `arguments` field within the request's `params` **MUST** be an\n `OpenDiffRequest` object.\n\n ```typescript\n interface OpenDiffRequest {\n // The absolute path to the file to be diffed.\n filePath: string;\n // The proposed new content for the file.\n newContent: string;\n }\n ```\n\n- **Response (`CallToolResult`):** The tool **MUST** immediately return a\n `CallToolResult` to acknowledge the request and report whether the diff view\n was successfully opened.\n - On Success: If the diff view was opened successfully, the response **MUST**\n contain empty content (i.e., `content: []`).\n - On Failure: If an error prevented the diff view from opening, the response\n **MUST** have `isError: true` and include a `TextContent` block in the\n `content` array describing the error.\n\n The actual outcome of the diff (acceptance or rejection) is communicated\n asynchronously via notifications.\n\n### `closeDiff` tool\n\nThe plugin **MUST** register a `closeDiff` tool on its MCP server.\n\n- **Description:** This tool instructs the IDE to close an open diff view for a\n specific file.\n- **Request (`CloseDiffRequest`):** The tool is invoked via a `tools/call`\n request. The `arguments` field within the request's `params` **MUST** be an\n `CloseDiffRequest` object.\n\n ```typescript\n interface CloseDiffRequest {\n // The absolute path to the file whose diff view should be closed.\n filePath: string;\n }\n ```\n\n- **Response (`CallToolResult`):** The tool **MUST** return a `CallToolResult`.\n - On Success: If the diff view was closed successfully, the response **MUST**\n include a single **TextContent** block in the content array containing the\n file's final content before closing.\n - On Failure: If an error prevented the diff view from closing, the response\n **MUST** have `isError: true` and include a `TextContent` block in the\n `content` array describing the error.\n\n### `ide/diffAccepted` notification\n\nWhen the user accepts the changes in a diff view (e.g., by clicking an \"Apply\"\nor \"Save\" button), the plugin **MUST** send an `ide/diffAccepted` notification\nto the CLI.\n\n- **Payload:** The notification parameters **MUST** include the file path and\n the final content of the file. The content may differ from the original\n `newContent` if the user made manual edits in the diff view.\n\n ```typescript\n {\n // The absolute path to the file that was diffed.\n filePath: string;\n // The full content of the file after acceptance.\n content: string;\n }\n ```\n\n### `ide/diffRejected` notification\n\nWhen the user rejects the changes (e.g., by closing the diff view without\naccepting), the plugin **MUST** send an `ide/diffRejected` notification to the\nCLI.\n\n- **Payload:** The notification parameters **MUST** include the file path of the\n rejected diff.\n\n ```typescript\n {\n // The absolute path to the file that was diffed.\n filePath: string;\n }\n ```\n\n## IV. The lifecycle interface\n\nThe plugin **MUST** manage its resources and the discovery file correctly based\non the IDE's lifecycle.\n\n- **On activation (IDE startup/plugin enabled):**\n 1. Start the MCP server.\n 2. Create the discovery file.\n- **On deactivation (IDE shutdown/plugin disabled):**\n 1. Stop the MCP server.\n 2. Delete the discovery file.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":11161,"content_sha256":"0635eacd3a68863d712c677408aa5fd3785e06ad476b73055473a56232a88604"},{"filename":"canonical/geminicli-com/docs/integration-tests.md","content":"---\nsource_url: https://geminicli.com/docs/integration-tests\nsource_type: llms-txt\ncontent_hash: sha256:02597b22508023bb674a66370a9a439dd6686938e40d7d12d7efceb085f6632c\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"7328f5003b1bbf34dae914aa3e85e26acf78614ebcb49ec3d507a9307c182fae\"'\nlast_modified: '2025-12-09T17:19:48Z'\n---\n\n# Integration tests\n\nThis document provides information about the integration testing framework used\nin this project.\n\n## Overview\n\nThe integration tests are designed to validate the end-to-end functionality of\nthe Gemini CLI. They execute the built binary in a controlled environment and\nverify that it behaves as expected when interacting with the file system.\n\nThese tests are located in the `integration-tests` directory and are run using a\ncustom test runner.\n\n## Building the tests\n\nPrior to running any integration tests, you need to create a release bundle that\nyou want to actually test:\n\n```bash\nnpm run bundle\n```\n\nYou must re-run this command after making any changes to the CLI source code,\nbut not after making changes to tests.\n\n## Running the tests\n\nThe integration tests are not run as part of the default `npm run test` command.\nThey must be run explicitly using the `npm run test:integration:all` script.\n\nThe integration tests can also be run using the following shortcut:\n\n```bash\nnpm run test:e2e\n```\n\n## Running a specific set of tests\n\nTo run a subset of test files, you can use\n`npm run \u003cintegration test command> \u003cfile_name1> ....` where <integration\ntest command> is either `test:e2e` or `test:integration*` and `\u003cfile_name>`\nis any of the `.test.js` files in the `integration-tests/` directory. For\nexample, the following command runs `list_directory.test.js` and\n`write_file.test.js`:\n\n```bash\nnpm run test:e2e list_directory write_file\n```\n\n### Running a single test by name\n\nTo run a single test by its name, use the `--test-name-pattern` flag:\n\n```bash\nnpm run test:e2e -- --test-name-pattern \"reads a file\"\n```\n\n### Regenerating model responses\n\nSome integration tests use faked out model responses, which may need to be\nregenerated from time to time as the implementations change.\n\nTo regenerate these golden files, set the REGENERATE_MODEL_GOLDENS environment\nvariable to \"true\" when running the tests, for example:\n\n**WARNING**: If running locally you should review these updated responses for\nany information about yourself or your system that gemini may have included in\nthese responses.\n\n```bash\nREGENERATE_MODEL_GOLDENS=\"true\" npm run test:e2e\n```\n\n**WARNING**: Make sure you run **await rig.cleanup()** at the end of your test,\nelse the golden files will not be updated.\n\n### Deflaking a test\n\nBefore adding a **new** integration test, you should test it at least 5 times\nwith the deflake script or workflow to make sure that it is not flaky.\n\n### Deflake script\n\n```bash\nnpm run deflake -- --runs=5 --command=\"npm run test:e2e -- -- --test-name-pattern '\u003cyour-new-test-name>'\"\n```\n\n#### Deflake workflow\n\n```bash\ngh workflow run deflake.yml --ref \u003cyour-branch> -f test_name_pattern=\"\u003cyour-test-name-pattern>\"\n```\n\n### Running all tests\n\nTo run the entire suite of integration tests, use the following command:\n\n```bash\nnpm run test:integration:all\n```\n\n### Sandbox matrix\n\nThe `all` command will run tests for `no sandboxing`, `docker` and `podman`.\nEach individual type can be run using the following commands:\n\n```bash\nnpm run test:integration:sandbox:none\n```\n\n```bash\nnpm run test:integration:sandbox:docker\n```\n\n```bash\nnpm run test:integration:sandbox:podman\n```\n\n## Diagnostics\n\nThe integration test runner provides several options for diagnostics to help\ntrack down test failures.\n\n### Keeping test output\n\nYou can preserve the temporary files created during a test run for inspection.\nThis is useful for debugging issues with file system operations.\n\nTo keep the test output set the `KEEP_OUTPUT` environment variable to `true`.\n\n```bash\nKEEP_OUTPUT=true npm run test:integration:sandbox:none\n```\n\nWhen output is kept, the test runner will print the path to the unique directory\nfor the test run.\n\n### Verbose output\n\nFor more detailed debugging, set the `VERBOSE` environment variable to `true`.\n\n```bash\nVERBOSE=true npm run test:integration:sandbox:none\n```\n\nWhen using `VERBOSE=true` and `KEEP_OUTPUT=true` in the same command, the output\nis streamed to the console and also saved to a log file within the test's\ntemporary directory.\n\nThe verbose output is formatted to clearly identify the source of the logs:\n\n```\n--- TEST: \u003clog dir>:\u003ctest-name> ---\n... output from the gemini command ...\n--- END TEST: \u003clog dir>:\u003ctest-name> ---\n```\n\n## Linting and formatting\n\nTo ensure code quality and consistency, the integration test files are linted as\npart of the main build process. You can also manually run the linter and\nauto-fixer.\n\n### Running the linter\n\nTo check for linting errors, run the following command:\n\n```bash\nnpm run lint\n```\n\nYou can include the `:fix` flag in the command to automatically fix any fixable\nlinting errors:\n\n```bash\nnpm run lint:fix\n```\n\n## Directory structure\n\nThe integration tests create a unique directory for each test run inside the\n`.integration-tests` directory. Within this directory, a subdirectory is created\nfor each test file, and within that, a subdirectory is created for each\nindividual test case.\n\nThis structure makes it easy to locate the artifacts for a specific test run,\nfile, or case.\n\n```\n.integration-tests/\n└── \u003crun-id>/\n └── \u003ctest-file-name>.test.js/\n └── \u003ctest-case-name>/\n ├── output.log\n └── ...other test artifacts...\n```\n\n## Continuous integration\n\nTo ensure the integration tests are always run, a GitHub Actions workflow is\ndefined in `.github/workflows/chained_e2e.yml`. This workflow automatically runs\nthe integrations tests for pull requests against the `main` branch, or when a\npull request is added to a merge queue.\n\nThe workflow runs the tests in different sandboxing environments to ensure\nGemini CLI is tested across each:\n\n- `sandbox:none`: Runs the tests without any sandboxing.\n- `sandbox:docker`: Runs the tests in a Docker container.\n- `sandbox:podman`: Runs the tests in a Podman container.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":6244,"content_sha256":"c6c11b9bb60d71051fc3fca6acd5266de84c9e6c9ad637b41a356ea4c1833971"},{"filename":"canonical/geminicli-com/docs/issue-and-pr-automation.md","content":"---\nsource_url: http://geminicli.com/docs/issue-and-pr-automation\nsource_type: llms-txt\ncontent_hash: sha256:febe5f9f08a48c247249af0b5529dbead003bddbbd1d7b7bab0c612914176a60\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"4baf71abe38304a9d2bc622dcea969bc54ba7f83ed612d298d71ab22ab2f6cc9\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Automation and triage processes\n\nThis document provides a detailed overview of the automated processes we use to\nmanage and triage issues and pull requests. Our goal is to provide prompt\nfeedback and ensure that contributions are reviewed and integrated efficiently.\nUnderstanding this automation will help you as a contributor know what to expect\nand how to best interact with our repository bots.\n\n## Guiding principle: Issues and pull requests\n\nFirst and foremost, almost every Pull Request (PR) should be linked to a\ncorresponding Issue. The issue describes the \"what\" and the \"why\" (the bug or\nfeature), while the PR is the \"how\" (the implementation). This separation helps\nus track work, prioritize features, and maintain clear historical context. Our\nautomation is built around this principle.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> Issues tagged as \"🔒Maintainers only\" are reserved for project\n> maintainers. We will not accept pull requests related to these issues.\n\n---\n\n## Detailed automation workflows\n\nHere is a breakdown of the specific automation workflows that run in our\nrepository.\n\n### 1. When you open an issue: `Automated Issue Triage`\n\nThis is the first bot you will interact with when you create an issue. Its job\nis to perform an initial analysis and apply the correct labels.\n\n- **Workflow File**: `.github/workflows/gemini-automated-issue-triage.yml`\n- **When it runs**: Immediately after an issue is created or reopened.\n- **What it does**:\n - It uses a Gemini model to analyze the issue's title and body against a\n detailed set of guidelines.\n - **Applies one `area/*` label**: Categorizes the issue into a functional area\n of the project (e.g., `area/ux`, `area/models`, `area/platform`).\n - **Applies one `kind/*` label**: Identifies the type of issue (e.g.,\n `kind/bug`, `kind/enhancement`, `kind/question`).\n - **Applies one `priority/*` label**: Assigns a priority from P0 (critical) to\n P3 (low) based on the described impact.\n - **May apply `status/need-information`**: If the issue lacks critical details\n (like logs or reproduction steps), it will be flagged for more information.\n - **May apply `status/need-retesting`**: If the issue references a CLI version\n that is more than six versions old, it will be flagged for retesting on a\n current version.\n- **What you should do**:\n - Fill out the issue template as completely as possible. The more detail you\n provide, the more accurate the triage will be.\n - If the `status/need-information` label is added, please provide the\n requested details in a comment.\n\n### 2. When you open a pull request: `Continuous Integration (CI)`\n\nThis workflow ensures that all changes meet our quality standards before they\ncan be merged.\n\n- **Workflow File**: `.github/workflows/ci.yml`\n- **When it runs**: On every push to a pull request.\n- **What it does**:\n - **Lint**: Checks that your code adheres to our project's formatting and\n style rules.\n - **Test**: Runs our full suite of automated tests across macOS, Windows, and\n Linux, and on multiple Node.js versions. This is the most time-consuming\n part of the CI process.\n - **Post Coverage Comment**: After all tests have successfully passed, a bot\n will post a comment on your PR. This comment provides a summary of how well\n your changes are covered by tests.\n- **What you should do**:\n - Ensure all CI checks pass. A green checkmark ✅ will appear next to your\n commit when everything is successful.\n - If a check fails (a red \"X\" ❌), click the \"Details\" link next to the failed\n check to view the logs, identify the problem, and push a fix.\n\n### 3. Ongoing triage for pull requests: `PR Auditing and Label Sync`\n\nThis workflow runs periodically to ensure all open PRs are correctly linked to\nissues and have consistent labels.\n\n- **Workflow File**: `.github/workflows/gemini-scheduled-pr-triage.yml`\n- **When it runs**: Every 15 minutes on all open pull requests.\n- **What it does**:\n - **Checks for a linked issue**: The bot scans your PR description for a\n keyword that links it to an issue (e.g., `Fixes #123`, `Closes #456`).\n - **Adds `status/need-issue`**: If no linked issue is found, the bot will add\n the `status/need-issue` label to your PR. This is a clear signal that an\n issue needs to be created and linked.\n - **Synchronizes labels**: If an issue _is_ linked, the bot ensures the PR's\n labels perfectly match the issue's labels. It will add any missing labels\n and remove any that don't belong, and it will remove the `status/need-issue`\n label if it was present.\n- **What you should do**:\n - **Always link your PR to an issue.** This is the most important step. Add a\n line like `Resolves #\u003cissue-number>` to your PR description.\n - This will ensure your PR is correctly categorized and moves through the\n review process smoothly.\n\n### 4. Ongoing triage for issues: `Scheduled Issue Triage`\n\nThis is a fallback workflow to ensure that no issue gets missed by the triage\nprocess.\n\n- **Workflow File**: `.github/workflows/gemini-scheduled-issue-triage.yml`\n- **When it runs**: Every hour on all open issues.\n- **What it does**:\n - It actively seeks out issues that either have no labels at all or still have\n the `status/need-triage` label.\n - It then triggers the same powerful Gemini-based analysis as the initial\n triage bot to apply the correct labels.\n- **What you should do**:\n - You typically don't need to do anything. This workflow is a safety net to\n ensure every issue is eventually categorized, even if the initial triage\n fails.\n\n### 5. Automatic unassignment of inactive contributors: `Unassign Inactive Issue Assignees`\n\nTo keep the list of open `help wanted` issues accessible to all contributors,\nthis workflow automatically removes **external contributors** who have not\nopened a linked pull request within **7 days** of being assigned. Maintainers,\norg members, and repo collaborators with write access or above are always exempt\nand will never be auto-unassigned.\n\n- **Workflow File**: `.github/workflows/unassign-inactive-assignees.yml`\n- **When it runs**: Every day at 09:00 UTC, and can be triggered manually with\n an optional `dry_run` mode.\n- **What it does**:\n 1. Finds every open issue labeled `help wanted` that has at least one\n assignee.\n 2. Identifies privileged users (team members, repo collaborators with write+\n access, maintainers) and skips them entirely.\n 3. For each remaining (external) assignee it reads the issue's timeline to\n determine:\n - The exact date they were assigned (using `assigned` timeline events).\n - Whether they have opened a PR that is already linked/cross-referenced to\n the issue.\n 4. Each cross-referenced PR is fetched to verify it is **ready for review**:\n open and non-draft, or already merged. Draft PRs do not count.\n 5. If an assignee has been assigned for **more than 7 days** and no qualifying\n PR is found, they are automatically unassigned and a comment is posted\n explaining the reason and how to re-claim the issue.\n 6. Assignees who have a non-draft, open or merged PR linked to the issue are\n **never** unassigned by this workflow.\n- **What you should do**:\n - **Open a real PR, not a draft**: Within 7 days of being assigned, open a PR\n that is ready for review and include `Fixes #\u003cissue-number>` in the\n description. Draft PRs do not satisfy the requirement and will not prevent\n auto-unassignment.\n - **Re-assign if unassigned by mistake**: Comment `/assign` on the issue to\n assign yourself again.\n - **Unassign yourself** if you can no longer work on the issue by commenting\n `/unassign`, so other contributors can pick it up right away.\n\n### 6. Release automation\n\nThis workflow handles the process of packaging and publishing new versions of\nthe Gemini CLI.\n\n- **Workflow File**: `.github/workflows/release-manual.yml`\n- **When it runs**: On a daily schedule for \"nightly\" releases, and manually for\n official patch/minor releases.\n- **What it does**:\n - Automatically builds the project, bumps the version numbers, and publishes\n the packages to npm.\n - Creates a corresponding release on GitHub with generated release notes.\n- **What you should do**:\n - As a contributor, you don't need to do anything for this process. You can be\n confident that once your PR is merged into the `main` branch, your changes\n will be included in the very next nightly release.\n\nWe hope this detailed overview is helpful. If you have any questions about our\nautomation or processes, please don't hesitate to ask!\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":8976,"content_sha256":"f7d900d44c07f4ce85025fddc17923fa8435317f77d16904ca63cba711885957"},{"filename":"canonical/geminicli-com/docs/local-development.md","content":"---\nsource_url: http://geminicli.com/docs/local-development\nsource_type: llms-txt\ncontent_hash: sha256:5f1d7e769189463d8daa9299dc86ea8e46d16f74bf8b3ceac61170603800d632\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"a37eb22210e3314126fd26159ee2e1c9383e1108d76781b8c47475ab33ea3f12\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Local development guide\n\nThis guide provides instructions for setting up and using local development\nfeatures for Gemini CLI.\n\n## Tracing\n\nGemini CLI uses OpenTelemetry (OTel) to record traces that help you debug agent\nbehavior. Traces instrument key events like model calls, tool scheduler\noperations, and tool calls.\n\nTraces provide deep visibility into agent behavior and help you debug complex\nissues. They are captured automatically when you enable telemetry.\n\n### View traces\n\nYou can view traces using Genkit Developer UI, Jaeger, or Google Cloud.\n\n#### Use Genkit\n\nGenkit provides a web-based UI for viewing traces and other telemetry data.\n\n1. **Start the Genkit telemetry server:**\n\n Run the following command to start the Genkit server:\n\n ```bash\n npm run telemetry -- --target=genkit\n ```\n\n The script will output the URL for the Genkit Developer UI. For example:\n `Genkit Developer UI: http://localhost:4000`\n\n2. **Run Gemini CLI:**\n\n In a separate terminal, run your Gemini CLI command:\n\n ```bash\n gemini\n ```\n\n3. **View the traces:**\n\n Open the Genkit Developer UI URL in your browser and navigate to the\n **Traces** tab to view the traces.\n\n#### Use Jaeger\n\nYou can view traces in the Jaeger UI for local development.\n\n1. **Start the telemetry collector:**\n\n Run the following command in your terminal to download and start Jaeger and\n an OTel collector:\n\n ```bash\n npm run telemetry -- --target=local\n ```\n\n This command configures your workspace for local telemetry and provides a\n link to the Jaeger UI (usually `http://localhost:16686`).\n - **Collector logs:** `~/.gemini/tmp/\u003cprojectHash>/otel/collector.log`\n\n2. **Run Gemini CLI:**\n\n In a separate terminal, run your Gemini CLI command:\n\n ```bash\n gemini\n ```\n\n3. **View the traces:**\n\n After running your command, open the Jaeger UI link in your browser to view\n the traces.\n\n#### Use Google Cloud\n\nYou can use an OpenTelemetry collector to forward telemetry data to Google Cloud\nTrace for custom processing or routing.\n\n\u003c!-- prettier-ignore -->\n> [!WARNING]\n> Ensure you complete the\n> [Google Cloud telemetry prerequisites](/docs/cli/telemetry#prerequisites)\n> (Project ID, authentication, IAM roles, and APIs) before using this method.\n\n1. **Configure `.gemini/settings.json`:**\n\n ```json\n {\n \"telemetry\": {\n \"enabled\": true,\n \"target\": \"gcp\",\n \"useCollector\": true\n }\n }\n ```\n\n2. **Start the telemetry collector:**\n\n Run the following command to start a local OTel collector that forwards to\n Google Cloud:\n\n ```bash\n npm run telemetry -- --target=gcp\n ```\n\n The script outputs links to view traces, metrics, and logs in the Google\n Cloud Console.\n - **Collector logs:** `~/.gemini/tmp/\u003cprojectHash>/otel/collector-gcp.log`\n\n3. **Run Gemini CLI:**\n\n In a separate terminal, run your Gemini CLI command:\n\n ```bash\n gemini\n ```\n\n4. **View logs, metrics, and traces:**\n\n After sending prompts, view your data in the Google Cloud Console. See the\n [telemetry documentation](/docs/cli/telemetry#view-google-cloud-telemetry)\n for links to Logs, Metrics, and Trace explorers.\n\nFor more detailed information on telemetry, see the\n[telemetry documentation](/docs/cli/telemetry).\n\n### Instrument code with traces\n\nYou can add traces to your own code for more detailed instrumentation.\n\nAdding traces helps you debug and understand the flow of execution. Use the\n`runInDevTraceSpan` function to wrap any section of code in a trace span.\n\nHere is a basic example:\n\n```typescript\nimport { runInDevTraceSpan } from '@google/gemini-cli-core';\nimport { GeminiCliOperation } from '@google/gemini-cli-core/lib/telemetry/constants.js';\n\nawait runInDevTraceSpan(\n {\n operation: GeminiCliOperation.ToolCall,\n attributes: {\n [GEN_AI_AGENT_NAME]: 'gemini-cli',\n },\n },\n async ({ metadata }) => {\n // metadata allows you to record the input and output of the\n // operation as well as other attributes.\n metadata.input = { key: 'value' };\n // Set custom attributes.\n metadata.attributes['custom.attribute'] = 'custom.value';\n\n // Your code to be traced goes here.\n try {\n const output = await somethingRisky();\n metadata.output = output;\n return output;\n } catch (e) {\n metadata.error = e;\n throw e;\n }\n },\n);\n```\n\nIn this example:\n\n- `operation`: The operation type of the span, represented by the\n `GeminiCliOperation` enum.\n- `metadata.input`: (Optional) An object containing the input data for the\n traced operation.\n- `metadata.output`: (Optional) An object containing the output data from the\n traced operation.\n- `metadata.attributes`: (Optional) A record of custom attributes to add to the\n span.\n- `metadata.error`: (Optional) An error object to record if the operation fails.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":5243,"content_sha256":"919122a2972da63965b6034c2512a78b7abe419d4894755f6222ed8aaffff138"},{"filename":"canonical/geminicli-com/docs/npm.md","content":"---\nsource_url: https://geminicli.com/docs/npm\nsource_type: llms-txt\ncontent_hash: sha256:bc2069978b6c6acfb8518e2f458094c2925999ed20dc0eb690e2298cbd7d982b\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"7d41dc31efdf2815412fc549c4b40c1369999d12af11edf075128ee2d221fc27\"'\nlast_modified: '2025-12-01T20:04:32Z'\n---\n\n# Package overview\n\nThis monorepo contains two main packages: `@google/gemini-cli` and\n`@google/gemini-cli-core`.\n\n## `@google/gemini-cli`\n\nThis is the main package for the Gemini CLI. It is responsible for the user\ninterface, command parsing, and all other user-facing functionality.\n\nWhen this package is published, it is bundled into a single executable file.\nThis bundle includes all of the package's dependencies, including\n`@google/gemini-cli-core`. This means that whether a user installs the package\nwith `npm install -g @google/gemini-cli` or runs it directly with\n`npx @google/gemini-cli`, they are using this single, self-contained executable.\n\n## `@google/gemini-cli-core`\n\nThis package contains the core logic for interacting with the Gemini API. It is\nresponsible for making API requests, handling authentication, and managing the\nlocal cache.\n\nThis package is not bundled. When it is published, it is published as a standard\nNode.js package with its own dependencies. This allows it to be used as a\nstandalone package in other projects, if needed. All transpiled js code in the\n`dist` folder is included in the package.\n\n## NPM workspaces\n\nThis project uses\n[NPM Workspaces](https://docs.npmjs.com/cli/v10/using-npm/workspaces) to manage\nthe packages within this monorepo. This simplifies development by allowing us to\nmanage dependencies and run scripts across multiple packages from the root of\nthe project.\n\n### How it works\n\nThe root `package.json` file defines the workspaces for this project:\n\n```json\n{\n \"workspaces\": [\"packages/*\"]\n}\n```\n\nThis tells NPM that any folder inside the `packages` directory is a separate\npackage that should be managed as part of the workspace.\n\n### Benefits of workspaces\n\n- **Simplified dependency management**: Running `npm install` from the root of\n the project will install all dependencies for all packages in the workspace\n and link them together. This means you don't need to run `npm install` in each\n package's directory.\n- **Automatic linking**: Packages within the workspace can depend on each other.\n When you run `npm install`, NPM will automatically create symlinks between the\n packages. This means that when you make changes to one package, the changes\n are immediately available to other packages that depend on it.\n- **Simplified script execution**: You can run scripts in any package from the\n root of the project using the `--workspace` flag. For example, to run the\n `build` script in the `cli` package, you can run\n `npm run build --workspace @google/gemini-cli`.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2888,"content_sha256":"ba952b9031fbda34f9bdd147368aafd2c83e8ddff35d778910be598f7e335682"},{"filename":"canonical/geminicli-com/docs/quota-and-pricing.md","content":"---\nsource_url: https://geminicli.com/docs/quota-and-pricing\nsource_type: llms-txt\ncontent_hash: sha256:7a570b53db5b616d193a649b0faf5ec88dd3247f10c71052f102391119c8b5cf\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"b9c60632e489a14c92d29ac14594b9eb8f204cfb9f4c863ebfdfe946d99329e8\"'\nlast_modified: '2025-12-03T18:17:56Z'\n---\n\n# Gemini CLI: Quotas and pricing\n\nGemini CLI offers a generous free tier that covers many individual developers'\nuse cases. For enterprise or professional usage, or if you need higher limits,\nseveral options are available depending on your authentication account type.\n\nSee [privacy and terms](/docs/tos-privacy) for details on the Privacy Policy and\nTerms of Service.\n\n> **Note:** Published prices are list price; additional negotiated commercial\n> discounting may apply.\n\nThis article outlines the specific quotas and pricing applicable to Gemini CLI\nwhen using different authentication methods.\n\nGenerally, there are three categories to choose from:\n\n- Free Usage: Ideal for experimentation and light use.\n- Paid Tier (fixed price): For individual developers or enterprises who need\n more generous daily quotas and predictable costs.\n- Pay-As-You-Go: The most flexible option for professional use, long-running\n tasks, or when you need full control over your usage.\n\n## Free usage\n\nYour journey begins with a generous free tier, perfect for experimentation and\nlight use.\n\nYour free usage limits depend on your authorization type.\n\n### Log in with Google (Gemini Code Assist for individuals)\n\nFor users who authenticate by using their Google account to access Gemini Code\nAssist for individuals. This includes:\n\n- 1000 model requests / user / day\n- 60 model requests / user / minute\n- Model requests will be made across the Gemini model family as determined by\n Gemini CLI.\n\nLearn more at\n[Gemini Code Assist for Individuals Limits](https://developers.google.com/gemini-code-assist/resources/quotas#quotas-for-agent-mode-gemini-cli).\n\n### Log in with Gemini API Key (unpaid)\n\nIf you are using a Gemini API key, you can also benefit from a free tier. This\nincludes:\n\n- 250 model requests / user / day\n- 10 model requests / user / minute\n- Model requests to Flash model only.\n\nLearn more at\n[Gemini API Rate Limits](https://ai.google.dev/gemini-api/docs/rate-limits).\n\n### Log in with Vertex AI (Express Mode)\n\nVertex AI offers an Express Mode without the need to enable billing. This\nincludes:\n\n- 90 days before you need to enable billing.\n- Quotas and models are variable and specific to your account.\n\nLearn more at\n[Vertex AI Express Mode Limits](https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview#quotas).\n\n## Paid tier: Higher limits for a fixed cost\n\nIf you use up your initial number of requests, you can continue to benefit from\nGemini CLI by upgrading to one of the following subscriptions:\n\n- [Google AI Pro and AI Ultra](https://gemini.google/subscriptions/). This is\n recommended for individual developers. Quotas and pricing are based on a fixed\n price subscription.\n\n For predictable costs, you can log in with Google.\n\n Learn more at\n [Gemini Code Assist Quotas and Limits](https://developers.google.com/gemini-code-assist/resources/quotas)\n\n- [Purchase a Gemini Code Assist Subscription through Google Cloud ](https://cloud.google.com/gemini/docs/codeassist/overview)\n by signing up in the Google Cloud console. Learn more at\n [Set up Gemini Code Assist](https://cloud.google.com/gemini/docs/discover/set-up-gemini).\n\n Quotas and pricing are based on a fixed price subscription with assigned\n license seats. For predictable costs, you can sign in with Google.\n\n This includes:\n - Gemini Code Assist Standard edition:\n - 1500 model requests / user / day\n - 120 model requests / user / minute\n - Gemini Code Assist Enterprise edition:\n - 2000 model requests / user / day\n - 120 model requests / user / minute\n - Model requests will be made across the Gemini model family as determined by\n Gemini CLI.\n\n [Learn more about Gemini Code Assist Standard and Enterprise license limits](https://developers.google.com/gemini-code-assist/resources/quotas#quotas-for-agent-mode-gemini-cli).\n\n## Pay as you go\n\nIf you hit your daily request limits or exhaust your Gemini Pro quota even after\nupgrading, the most flexible solution is to switch to a pay-as-you-go model,\nwhere you pay for the specific amount of processing you use. This is the\nrecommended path for uninterrupted access.\n\nTo do this, log in using a Gemini API key or Vertex AI.\n\n- Vertex AI (Regular Mode):\n - Quota: Governed by a dynamic shared quota system or pre-purchased\n provisioned throughput.\n - Cost: Based on model and token usage.\n\nLearn more at\n[Vertex AI Dynamic Shared Quota](https://cloud.google.com/vertex-ai/generative-ai/docs/resources/dynamic-shared-quota)\nand [Vertex AI Pricing](https://cloud.google.com/vertex-ai/pricing).\n\n- Gemini API key:\n - Quota: Varies by pricing tier.\n - Cost: Varies by pricing tier and model/token usage.\n\nLearn more at\n[Gemini API Rate Limits](https://ai.google.dev/gemini-api/docs/rate-limits),\n[Gemini API Pricing](https://ai.google.dev/gemini-api/docs/pricing)\n\nIt's important to highlight that when using an API key, you pay per token/call.\nThis can be more expensive for many small calls with few tokens, but it's the\nonly way to ensure your workflow isn't interrupted by quota limits.\n\n## Gemini for workspace plans\n\nThese plans currently apply only to the use of Gemini web-based products\nprovided by Google-based experiences (for example, the Gemini web app or the\nFlow video editor). These plans do not apply to the API usage which powers the\nGemini CLI. Supporting these plans is under active consideration for future\nsupport.\n\n## Tips to avoid high costs\n\nWhen using a Pay as you Go API key, be mindful of your usage to avoid unexpected\ncosts.\n\n- Don't blindly accept every suggestion, especially for computationally\n intensive tasks like refactoring large codebases.\n- Be intentional with your prompts and commands. You are paying per call, so\n think about the most efficient way to get the job done.\n\n## Gemini API vs. Vertex\n\n- Gemini API (gemini developer api): This is the fastest way to use the Gemini\n models directly.\n- Vertex AI: This is the enterprise-grade platform for building, deploying, and\n managing Gemini models with specific security and control requirements.\n\n## Understanding your usage\n\nA summary of model usage is available through the `/stats` command and presented\non exit at the end of a session.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":6580,"content_sha256":"f6800565ca02239bd5b721550761746848b9ae81be08b2f9df996f2f525994db"},{"filename":"canonical/geminicli-com/docs/reference/commands.md","content":"---\nsource_url: http://geminicli.com/docs/reference/commands\nsource_type: llms-txt\ncontent_hash: sha256:541dc461cc0a058e9aa44e413135995d254accb58ccf8c9142fdc6ffa5853f28\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"89f2d7fb79414448c4341fd2b7801bb651e346819930befcc4935e5cd37c449d\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# CLI commands\n\nGemini CLI supports several built-in commands to help you manage your session,\ncustomize the interface, and control its behavior. These commands are prefixed\nwith a forward slash (`/`), an at symbol (`@`), or an exclamation mark (`!`).\n\n## Slash commands (`/`)\n\nSlash commands provide meta-level control over the CLI itself.\n\n### Built-in Commands\n\n### `/about`\n\n- **Description:** Show version info. Share this information when filing issues.\n\n### `/agents`\n\n- **Description:** Manage local and remote subagents.\n- **Note:** This command is experimental and requires\n `experimental.enableAgents: true` in your `settings.json`.\n- **Sub-commands:**\n - **`list`**:\n - **Description:** Lists all discovered agents, including built-in, local,\n and remote agents.\n - **Usage:** `/agents list`\n - **`reload`** (alias: `refresh`):\n - **Description:** Rescans agent directories (`~/.gemini/agents` and\n `.gemini/agents`) and reloads the registry.\n - **Usage:** `/agents reload`\n - **`enable`**:\n - **Description:** Enables a specific subagent.\n - **Usage:** `/agents enable \u003cagent-name>`\n - **`disable`**:\n - **Description:** Disables a specific subagent.\n - **Usage:** `/agents disable \u003cagent-name>`\n - **`config`**:\n - **Description:** Opens a configuration dialog for the specified agent to\n adjust its model, temperature, or execution limits.\n - **Usage:** `/agents config \u003cagent-name>`\n\n### `/auth`\n\n- **Description:** Open a dialog that lets you change the authentication method.\n\n### `/bug`\n\n- **Description:** File an issue about Gemini CLI. By default, the issue is\n filed within the GitHub repository for Gemini CLI. The string you enter after\n `/bug` will become the headline for the bug being filed. The default `/bug`\n behavior can be modified using the `advanced.bugCommand` setting in your\n `.gemini/settings.json` files.\n\n### `/chat`\n\n- **Description:** Alias for `/resume`. Both commands now expose the same\n session browser action and checkpoint subcommands.\n- **Menu layout when typing `/chat` (or `/resume`)**:\n - `-- auto --`\n - `list` (selecting this opens the auto-saved session browser)\n - `-- checkpoints --`\n - `list`, `save`, `resume`, `delete`, `share` (manual tagged checkpoints)\n - Unique prefixes (for example `/cha` or `/resu`) resolve to the same grouped\n menu.\n- **Sub-commands:**\n - **`debug`**\n - **Description:** Export the most recent API request as a JSON payload.\n - **`delete \u003ctag>`**\n - **Description:** Deletes a saved conversation checkpoint.\n - **Equivalent:** `/resume delete \u003ctag>`\n - **`list`**\n - **Description:** Lists available tags for manually saved checkpoints.\n - **Note:** This command only lists chats saved within the current project.\n Because chat history is project-scoped, chats saved in other project\n directories will not be displayed.\n - **Equivalent:** `/resume list`\n - **`resume \u003ctag>`**\n - **Description:** Resumes a conversation from a previous save.\n - **Note:** You can only resume chats that were saved within the current\n project. To resume a chat from a different project, you must run the\n Gemini CLI from that project's directory.\n - **Equivalent:** `/resume resume \u003ctag>`\n - **`save \u003ctag>`**\n - **Description:** Saves the current conversation history. You must add a\n `\u003ctag>` for identifying the conversation state.\n - **Details on checkpoint location:** The default locations for saved chat\n checkpoints are:\n - Linux/macOS: `~/.gemini/tmp/\u003cproject_hash>/`\n - Windows: `C:\\Users\\\u003cYourUsername>\\.gemini\\tmp\\\u003cproject_hash>\\`\n - **Behavior:** Chats are saved into a project-specific directory,\n determined by where you run the CLI. Consequently, saved chats are only\n accessible when working within that same project.\n - **Note:** These checkpoints are for manually saving and resuming\n conversation states. For automatic checkpoints created before file\n modifications, see the\n [Checkpointing documentation](/docs/cli/checkpointing).\n - **Equivalent:** `/resume save \u003ctag>`\n - **`share [filename]`**\n - **Description:** Writes the current conversation to a provided Markdown or\n JSON file. If no filename is provided, then the CLI will generate one.\n - **Usage:** `/chat share file.md` or `/chat share file.json`.\n - **Equivalent:** `/resume share [filename]`\n\n### `/clear`\n\n- **Description:** Clear the terminal screen, including the visible session\n history and scrollback within the CLI. The underlying session data (for\n history recall) might be preserved depending on the exact implementation, but\n the visual display is cleared.\n- **Keyboard shortcut:** Press **Ctrl+L** at any time to perform a clear action.\n\n### `/commands`\n\n- **Description:** Manage custom slash commands loaded from `.toml` files.\n- **Sub-commands:**\n - **`reload`**:\n - **Description:** Reload custom command definitions from all sources\n (user-level `~/.gemini/commands/`, project-level\n `\u003cproject>/.gemini/commands/`, MCP prompts, and extensions). Use this to\n pick up new or modified `.toml` files without restarting the CLI.\n - **Usage:** `/commands reload`\n\n### `/compress`\n\n- **Description:** Replace the entire chat context with a summary. This saves on\n tokens used for future tasks while retaining a high level summary of what has\n happened.\n\n### `/copy`\n\n- **Description:** Copies the last output produced by Gemini CLI to your\n clipboard, for easy sharing or reuse.\n- **Behavior:**\n - Local sessions use system clipboard tools (pbcopy/xclip/clip).\n - Remote sessions (SSH/WSL) use OSC 52 and require terminal support.\n- **Note:** This command requires platform-specific clipboard tools to be\n installed.\n - On Linux, it requires `xclip` or `xsel`. You can typically install them\n using your system's package manager.\n - On macOS, it requires `pbcopy`, and on Windows, it requires `clip`. These\n tools are typically pre-installed on their respective systems.\n\n### `/directory` (or `/dir`)\n\n- **Description:** Manage workspace directories for multi-directory support.\n- **Sub-commands:**\n - **`add`**:\n - **Description:** Add a directory to the workspace. The path can be\n absolute or relative to the current working directory. Moreover, the\n reference from home directory is supported as well.\n - **Usage:** `/directory add \u003cpath1>,\u003cpath2>`\n - **Note:** Disabled in restrictive sandbox profiles. If you're using that,\n use `--include-directories` when starting the session instead.\n - **`show`**:\n - **Description:** Display all directories added by `/directory add` and\n `--include-directories`.\n - **Usage:** `/directory show`\n\n### `/docs`\n\n- **Description:** Open the Gemini CLI documentation in your browser.\n\n### `/editor`\n\n- **Description:** Open a dialog for selecting supported editors.\n\n### `/extensions`\n\n- **Description:** Manage extensions. See\n [Gemini CLI Extensions](/docs/extensions).\n- **Sub-commands:**\n - **`config`**:\n - **Description:** Configure extension settings.\n - **`disable`**:\n - **Description:** Disable an extension.\n - **`enable`**:\n - **Description:** Enable an extension.\n - **`explore`**:\n - **Description:** Open extensions page in your browser.\n - **`install`**:\n - **Description:** Install an extension from a git repo or local path.\n - **`link`**:\n - **Description:** Link an extension from a local path.\n - **`list`**:\n - **Description:** List active extensions.\n - **`restart`**:\n - **Description:** Restart all extensions.\n - **`uninstall`**:\n - **Description:** Uninstall an extension.\n - **`update`**:\n - **Description:** Update extensions. Usage: update \u003cextension-names>|--all\n\n### `/help` (or `/?`)\n\n- **Description:** Display help information about Gemini CLI, including\n available commands and their usage.\n\n### `/hooks`\n\n- **Description:** Manage hooks, which allow you to intercept and customize\n Gemini CLI behavior at specific lifecycle events.\n- **Sub-commands:**\n - **`disable-all`**:\n - **Description:** Disable all enabled hooks.\n - **`disable \u003chook-name>`**:\n - **Description:** Disable a hook by name.\n - **`enable-all`**:\n - **Description:** Enable all disabled hooks.\n - **`enable \u003chook-name>`**:\n - **Description:** Enable a hook by name.\n - **`list`** (or `show`, `panel`):\n - **Description:** Display all registered hooks with their status.\n\n### `/ide`\n\n- **Description:** Manage IDE integration.\n- **Sub-commands:**\n - **`disable`**:\n - **Description:** Disable IDE integration.\n - **`enable`**:\n - **Description:** Enable IDE integration.\n - **`install`**:\n - **Description:** Install required IDE companion.\n - **`status`**:\n - **Description:** Check status of IDE integration.\n\n### `/init`\n\n- **Description:** To help users easily create a `GEMINI.md` file, this command\n analyzes the current directory and generates a tailored context file, making\n it simpler for them to provide project-specific instructions to the Gemini\n agent.\n\n### `/mcp`\n\n- **Description:** Manage configured Model Context Protocol (MCP) servers.\n- **Sub-commands:**\n - **`auth`**:\n - **Description:** Authenticate with an OAuth-enabled MCP server.\n - **Usage:** `/mcp auth \u003cserver-name>`\n - **Details:** If `\u003cserver-name>` is provided, it initiates the OAuth flow\n for that server. If no server name is provided, it lists all configured\n servers that support OAuth authentication.\n - **`desc`**\n - **Description:** List configured MCP servers and tools with descriptions.\n - **`disable`**\n - **Description:** Disable an MCP server.\n - **`enable`**\n - **Description:** Enable a disabled MCP server.\n - **`list`** or **`ls`**:\n - **Description:** List configured MCP servers and tools. This is the\n default action if no subcommand is specified.\n - **`refresh`**:\n - **Description:** Restarts all MCP servers and re-discovers their available\n tools.\n - **`schema`**:\n - **Description:** List configured MCP servers and tools with descriptions\n and schemas.\n\n### `/memory`\n\n- **Description:** Manage the AI's instructional context (hierarchical memory\n loaded from `GEMINI.md` files).\n- **Sub-commands:**\n - **`add`**:\n - **Description:** Adds the following text to the AI's memory. Usage:\n `/memory add \u003ctext to remember>`\n - **`list`**:\n - **Description:** Lists the paths of the GEMINI.md files in use for\n hierarchical memory.\n - **`refresh`**:\n - **Description:** Reload the hierarchical instructional memory from all\n `GEMINI.md` files found in the configured locations (global,\n project/ancestors, and sub-directories). This command updates the model\n with the latest `GEMINI.md` content.\n - **`show`**:\n - **Description:** Display the full, concatenated content of the current\n hierarchical memory that has been loaded from all `GEMINI.md` files. This\n lets you inspect the instructional context being provided to the Gemini\n model.\n - **Note:** For more details on how `GEMINI.md` files contribute to\n hierarchical memory, see the\n [CLI Configuration documentation](/docs/reference/configuration).\n\n### `/model`\n\n- **Description:** Manage model configuration.\n- **Sub-commands:**\n - **`manage`**:\n - **Description:** Opens a dialog to configure the model.\n - **`set`**:\n - **Description:** Set the model to use.\n - **Usage:** `/model set \u003cmodel-name> [--persist]`\n\n### `/permissions`\n\n- **Description:** Manage folder trust settings and other permissions.\n- **Sub-commands:**\n - **`trust`**:\n - **Description:** Manage folder trust settings.\n - **Usage:** `/permissions trust [\u003cdirectory-path>]`\n\n### `/plan`\n\n- **Description:** Switch to Plan Mode (read-only) and view the current plan if\n one has been generated.\n - **Note:** This feature is enabled by default. It can be disabled via the\n `experimental.plan` setting in your configuration.\n- **Sub-commands:**\n - **`copy`**:\n - **Description:** Copy the currently approved plan to your clipboard.\n\n### `/policies`\n\n- **Description:** Manage policies.\n- **Sub-commands:**\n - **`list`**:\n - **Description:** List all active policies grouped by mode.\n\n### `/privacy`\n\n- **Description:** Display the Privacy Notice and allow users to select whether\n they consent to the collection of their data for service improvement purposes.\n\n### `/quit` (or `/exit`)\n\n- **Description:** Exit Gemini CLI.\n\n### `/restore`\n\n- **Description:** Restores the project files to the state they were in just\n before a tool was executed. This is particularly useful for undoing file edits\n made by a tool. If run without a tool call ID, it will list available\n checkpoints to restore from.\n- **Usage:** `/restore [tool_call_id]`\n- **Note:** Only available if checkpointing is configured via\n [settings](/docs/reference/configuration). See\n [Checkpointing documentation](/docs/cli/checkpointing) for more details.\n\n### `/rewind`\n\n- **Description:** Navigates backward through the conversation history, letting\n you review past interactions and potentially revert both chat state and file\n changes.\n- **Usage:** Press **Esc** twice as a shortcut.\n- **Features:**\n - **Select Interaction:** Preview user prompts and file changes.\n - **Action Selection:** Choose to rewind history only, revert code changes\n only, or both.\n\n### `/resume`\n\n- **Description:** Browse and resume previous conversation sessions, and manage\n manual chat checkpoints.\n- **Features:**\n - **Auto sessions:** Run `/resume` to open the interactive session browser for\n automatically saved conversations.\n - **Chat checkpoints:** Use checkpoint subcommands directly (`/resume save`,\n `/resume resume`, etc.).\n - **Management:** Delete unwanted sessions directly from the browser\n - **Resume:** Select any session to resume and continue the conversation\n - **Search:** Use `/` to search through conversation content across all\n sessions\n - **Session Browser:** Interactive interface showing all saved sessions with\n timestamps, message counts, and first user message for context\n - **Sorting:** Sort sessions by date or message count\n- **Note:** All conversations are automatically saved as you chat - no manual\n saving required. See [Session Management](/docs/cli/session-management) for\n complete details.\n- **Alias:** `/chat` provides the same behavior and subcommands.\n- **Sub-commands:**\n - **`list`**\n - **Description:** Lists available tags for manual chat checkpoints.\n - **`save \u003ctag>`**\n - **Description:** Saves the current conversation as a tagged checkpoint.\n - **`resume \u003ctag>`** (alias: `load`)\n - **Description:** Loads a previously saved tagged checkpoint.\n - **`delete \u003ctag>`**\n - **Description:** Deletes a tagged checkpoint.\n - **`share [filename]`**\n - **Description:** Exports the current conversation to Markdown or JSON.\n - **`debug`**\n - **Description:** Export the most recent API request as JSON payload\n (nightly builds).\n - **Compatibility alias:** `/resume checkpoints ...` is still accepted for the\n same checkpoint commands.\n\n### `/settings`\n\n- **Description:** Open the settings editor to view and modify Gemini CLI\n settings.\n- **Details:** This command provides a user-friendly interface for changing\n settings that control the behavior and appearance of Gemini CLI. It is\n equivalent to manually editing the `.gemini/settings.json` file, but with\n validation and guidance to prevent errors. See the\n [settings documentation](/docs/cli/settings) for a full list of available\n settings.\n- **Usage:** Simply run `/settings` and the editor will open. You can then\n browse or search for specific settings, view their current values, and modify\n them as desired. Changes to some settings are applied immediately, while\n others require a restart.\n\n### `/shells` (or `/bashes`)\n\n- **Description:** Toggle the background shells view. This allows you to view\n and manage long-running processes that you've sent to the background.\n\n### `/setup-github`\n\n- **Description:** Set up GitHub Actions to triage issues and review PRs with\n Gemini.\n\n### `/skills`\n\n- **Description:** Manage Agent Skills, which provide on-demand expertise and\n specialized workflows.\n- **Sub-commands:**\n - **`disable \u003cname>`**:\n - **Description:** Disable a specific skill by name.\n - **Usage:** `/skills disable \u003cname>`\n - **`enable \u003cname>`**:\n - **Description:** Enable a specific skill by name.\n - **Usage:** `/skills enable \u003cname>`\n - **`list`**:\n - **Description:** List all discovered skills and their current status\n (enabled/disabled).\n - **`reload`**:\n - **Description:** Refresh the list of discovered skills from all tiers\n (workspace, user, and extensions).\n\n### `/stats`\n\n- **Description:** Display detailed statistics for the current Gemini CLI\n session.\n- **Sub-commands:**\n - **`session`**:\n - **Description:** Show session-specific usage statistics, including\n duration, tool calls, and performance metrics. This is the default view.\n - **`model`**:\n - **Description:** Show model-specific usage statistics, including token\n counts and quota information.\n - **`tools`**:\n - **Description:** Show tool-specific usage statistics.\n\n### `/terminal-setup`\n\n- **Description:** Configure terminal keybindings for multiline input (VS Code,\n Cursor, Windsurf).\n\n### `/theme`\n\n- **Description:** Open a dialog that lets you change the visual theme of Gemini\n CLI.\n\n### `/tools`\n\n- **Description:** Display a list of tools that are currently available within\n Gemini CLI.\n- **Usage:** `/tools [desc]`\n- **Sub-commands:**\n - **`desc`** or **`descriptions`**:\n - **Description:** Show detailed descriptions of each tool, including each\n tool's name with its full description as provided to the model.\n - **`nodesc`** or **`nodescriptions`**:\n - **Description:** Hide tool descriptions, showing only the tool names.\n\n### `/upgrade`\n\n- **Description:** Open the Gemini Code Assist upgrade page in your browser.\n This lets you upgrade your tier for higher usage limits.\n- **Note:** This command is only available when logged in with Google.\n\n### `/vim`\n\n- **Description:** Toggle vim mode on or off. When vim mode is enabled, the\n input area supports vim-style navigation and editing commands in both NORMAL\n and INSERT modes.\n- **Features:**\n - **Count support:** Prefix commands with numbers (e.g., `3h`, `5w`, `10G`)\n - **Editing commands:** Delete with `x`, change with `c`, insert with `i`,\n `a`, `o`, `O`; complex operations like `dd`, `cc`, `dw`, `cw`\n - **INSERT mode:** Standard text input with escape to return to NORMAL mode\n - **NORMAL mode:** Navigate with `h`, `j`, `k`, `l`; jump by words with `w`,\n `b`, `e`; go to line start/end with `0`, ` gemini-cli-docs — Skillopedia , `^`; go to specific lines with\n `G` (or `gg` for first line)\n - **Persistent setting:** Vim mode preference is saved to\n `~/.gemini/settings.json` and restored between sessions\n - **Repeat last command:** Use `.` to repeat the last editing operation\n - **Status indicator:** When enabled, shows `[NORMAL]` or `[INSERT]` in the\n footer\n\n### Custom commands\n\nCustom commands allow you to create personalized shortcuts for your most-used\nprompts. For detailed instructions on how to create, manage, and use them,\nplease see the dedicated\n[Custom Commands documentation](/docs/cli/custom-commands).\n\n## Input prompt shortcuts\n\nThese shortcuts apply directly to the input prompt for text manipulation.\n\n- **Undo:**\n - **Keyboard shortcut:** Press **Alt+z** or **Cmd+z** to undo the last action\n in the input prompt.\n\n- **Redo:**\n - **Keyboard shortcut:** Press **Shift+Alt+Z** or **Shift+Cmd+Z** to redo the\n last undone action in the input prompt.\n\n## At commands (`@`)\n\nAt commands are used to include the content of files or directories as part of\nyour prompt to Gemini. These commands include git-aware filtering.\n\n- **`@\u003cpath_to_file_or_directory>`**\n - **Description:** Inject the content of the specified file or files into your\n current prompt. This is useful for asking questions about specific code,\n text, or collections of files.\n - **Examples:**\n - `@path/to/your/file.txt Explain this text.`\n - `@src/my_project/ Summarize the code in this directory.`\n - `What is this file about? @README.md`\n - **Details:**\n - If a path to a single file is provided, the content of that file is read.\n - If a path to a directory is provided, the command attempts to read the\n content of files within that directory and any subdirectories.\n - Spaces in paths should be escaped with a backslash (e.g.,\n `@My\\ Documents/file.txt`).\n - The command uses the `read_many_files` tool internally. The content is\n fetched and then inserted into your query before being sent to the Gemini\n model.\n - **Git-aware filtering:** By default, git-ignored files (like\n `node_modules/`, `dist/`, `.env`, `.git/`) are excluded. This behavior can\n be changed via the `context.fileFiltering` settings.\n - **File types:** The command is intended for text-based files. While it\n might attempt to read any file, binary files or very large files might be\n skipped or truncated by the underlying `read_many_files` tool to ensure\n performance and relevance. The tool indicates if files were skipped.\n - **Output:** The CLI will show a tool call message indicating that\n `read_many_files` was used, along with a message detailing the status and\n the path(s) that were processed.\n\n- **`@` (Lone at symbol)**\n - **Description:** If you type a lone `@` symbol without a path, the query is\n passed as-is to the Gemini model. This might be useful if you are\n specifically talking _about_ the `@` symbol in your prompt.\n\n### Error handling for `@` commands\n\n- If the path specified after `@` is not found or is invalid, an error message\n will be displayed, and the query might not be sent to the Gemini model, or it\n will be sent without the file content.\n- If the `read_many_files` tool encounters an error (e.g., permission issues),\n this will also be reported.\n\n## Shell mode and passthrough commands (`!`)\n\nThe `!` prefix lets you interact with your system's shell directly from within\nGemini CLI.\n\n- **`!\u003cshell_command>`**\n - **Description:** Execute the given `\u003cshell_command>` using `bash` on\n Linux/macOS or `powershell.exe -NoProfile -Command` on Windows (unless you\n override `ComSpec`). Any output or errors from the command are displayed in\n the terminal.\n - **Examples:**\n - `!ls -la` (executes `ls -la` and returns to Gemini CLI)\n - `!git status` (executes `git status` and returns to Gemini CLI)\n\n- **`!` (Toggle shell mode)**\n - **Description:** Typing `!` on its own toggles shell mode.\n - **Entering shell mode:**\n - When active, shell mode uses a different coloring and a \"Shell Mode\n Indicator\".\n - While in shell mode, text you type is interpreted directly as a shell\n command.\n - **Exiting shell mode:**\n - When exited, the UI reverts to its standard appearance and normal Gemini\n CLI behavior resumes.\n\n- **Caution for all `!` usage:** Commands you execute in shell mode have the\n same permissions and impact as if you ran them directly in your terminal.\n\n- **Environment variable:** When a command is executed via `!` or in shell mode,\n the `GEMINI_CLI=1` environment variable is set in the subprocess's\n environment. This allows scripts or tools to detect if they are being run from\n within the Gemini CLI.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":24090,"content_sha256":"7faf8ddd704c6f1ccc0426beb97f6d20b0144a31b9d6fd5ce41a1014dae34c10"},{"filename":"canonical/geminicli-com/docs/reference/configuration.md","content":"---\nsource_url: http://geminicli.com/docs/reference/configuration\nsource_type: llms-txt\ncontent_hash: sha256:9952ec5d6a2a08be7b35281ac316b24394daffcc97c3b48dcbba7f87ed15234d\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"5fc8914a0285ca76709ba2e5ee7b513a32e1d7be06a210baba2d193acc5afe72\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Gemini CLI configuration\n\nGemini CLI offers several ways to configure its behavior, including environment\nvariables, command-line arguments, and settings files. This document outlines\nthe different configuration methods and available settings.\n\n## Configuration layers\n\nConfiguration is applied in the following order of precedence (lower numbers are\noverridden by higher numbers):\n\n1. **Default values:** Hardcoded defaults within the application.\n2. **System defaults file:** System-wide default settings that can be\n overridden by other settings files.\n3. **User settings file:** Global settings for the current user.\n4. **Project settings file:** Project-specific settings.\n5. **System settings file:** System-wide settings that override all other\n settings files.\n6. **Environment variables:** System-wide or session-specific variables,\n potentially loaded from `.env` files.\n7. **Command-line arguments:** Values passed when launching the CLI.\n\n## Settings files\n\nGemini CLI uses JSON settings files for persistent configuration. There are four\nlocations for these files:\n\n\u003c!-- prettier-ignore -->\n> [!TIP]\n> JSON-aware editors can use autocomplete and validation by pointing to\n> the generated schema at `schemas/settings.schema.json` in this repository.\n> When working outside the repo, reference the hosted schema at\n> `https://raw.githubusercontent.com/google-gemini/gemini-cli/main/schemas/settings.schema.json`.\n\n- **System defaults file:**\n - **Location:** `/etc/gemini-cli/system-defaults.json` (Linux),\n `C:\\ProgramData\\gemini-cli\\system-defaults.json` (Windows) or\n `/Library/Application Support/GeminiCli/system-defaults.json` (macOS). The\n path can be overridden using the `GEMINI_CLI_SYSTEM_DEFAULTS_PATH`\n environment variable.\n - **Scope:** Provides a base layer of system-wide default settings. These\n settings have the lowest precedence and are intended to be overridden by\n user, project, or system override settings.\n- **User settings file:**\n - **Location:** `~/.gemini/settings.json` (where `~` is your home directory).\n - **Scope:** Applies to all Gemini CLI sessions for the current user. User\n settings override system defaults.\n- **Project settings file:**\n - **Location:** `.gemini/settings.json` within your project's root directory.\n - **Scope:** Applies only when running Gemini CLI from that specific project.\n Project settings override user settings and system defaults.\n- **System settings file:**\n - **Location:** `/etc/gemini-cli/settings.json` (Linux),\n `C:\\ProgramData\\gemini-cli\\settings.json` (Windows) or\n `/Library/Application Support/GeminiCli/settings.json` (macOS). The path can\n be overridden using the `GEMINI_CLI_SYSTEM_SETTINGS_PATH` environment\n variable.\n - **Scope:** Applies to all Gemini CLI sessions on the system, for all users.\n System settings act as overrides, taking precedence over all other settings\n files. May be useful for system administrators at enterprises to have\n controls over users' Gemini CLI setups.\n\n**Note on environment variables in settings:** String values within your\n`settings.json` and `gemini-extension.json` files can reference environment\nvariables using either `$VAR_NAME` or `${VAR_NAME}` syntax. These variables will\nbe automatically resolved when the settings are loaded. For example, if you have\nan environment variable `MY_API_TOKEN`, you could use it in `settings.json` like\nthis: `\"apiKey\": \"$MY_API_TOKEN\"`. Additionally, each extension can have its own\n`.env` file in its directory, which will be loaded automatically.\n\n**Note for Enterprise Users:** For guidance on deploying and managing Gemini CLI\nin a corporate environment, please see the\n[Enterprise Configuration](/docs/cli/enterprise) documentation.\n\n### The `.gemini` directory in your project\n\nIn addition to a project settings file, a project's `.gemini` directory can\ncontain other project-specific files related to Gemini CLI's operation, such as:\n\n- [Custom sandbox profiles](#sandboxing) (e.g.,\n `.gemini/sandbox-macos-custom.sb`, `.gemini/sandbox.Dockerfile`).\n\n### Available settings in `settings.json`\n\nSettings are organized into categories. All settings should be placed within\ntheir corresponding top-level category object in your `settings.json` file.\n\n\u003c!-- SETTINGS-AUTOGEN:START -->\n\n#### `policyPaths`\n\n- **`policyPaths`** (array):\n - **Description:** Additional policy files or directories to load.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n#### `adminPolicyPaths`\n\n- **`adminPolicyPaths`** (array):\n - **Description:** Additional admin policy files or directories to load.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n#### `general`\n\n- **`general.preferredEditor`** (string):\n - **Description:** The preferred editor to open files in.\n - **Default:** `undefined`\n\n- **`general.vimMode`** (boolean):\n - **Description:** Enable Vim keybindings\n - **Default:** `false`\n\n- **`general.defaultApprovalMode`** (enum):\n - **Description:** The default approval mode for tool execution. 'default'\n prompts for approval, 'auto_edit' auto-approves edit tools, and 'plan' is\n read-only mode. YOLO mode (auto-approve all actions) can only be enabled via\n command line (--yolo or --approval-mode=yolo).\n - **Default:** `\"default\"`\n - **Values:** `\"default\"`, `\"auto_edit\"`, `\"plan\"`\n\n- **`general.devtools`** (boolean):\n - **Description:** Enable DevTools inspector on launch.\n - **Default:** `false`\n\n- **`general.enableAutoUpdate`** (boolean):\n - **Description:** Enable automatic updates.\n - **Default:** `true`\n\n- **`general.enableAutoUpdateNotification`** (boolean):\n - **Description:** Enable update notification prompts.\n - **Default:** `true`\n\n- **`general.enableNotifications`** (boolean):\n - **Description:** Enable run-event notifications for action-required prompts\n and session completion. Currently macOS only.\n - **Default:** `false`\n\n- **`general.checkpointing.enabled`** (boolean):\n - **Description:** Enable session checkpointing for recovery\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`general.plan.directory`** (string):\n - **Description:** The directory where planning artifacts are stored. If not\n specified, defaults to the system temporary directory.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`general.plan.modelRouting`** (boolean):\n - **Description:** Automatically switch between Pro and Flash models based on\n Plan Mode status. Uses Pro for the planning phase and Flash for the\n implementation phase.\n - **Default:** `true`\n\n- **`general.retryFetchErrors`** (boolean):\n - **Description:** Retry on \"exception TypeError: fetch failed sending\n request\" errors.\n - **Default:** `true`\n\n- **`general.maxAttempts`** (number):\n - **Description:** Maximum number of attempts for requests to the main chat\n model. Cannot exceed 10.\n - **Default:** `10`\n\n- **`general.debugKeystrokeLogging`** (boolean):\n - **Description:** Enable debug logging of keystrokes to the console.\n - **Default:** `false`\n\n- **`general.sessionRetention.enabled`** (boolean):\n - **Description:** Enable automatic session cleanup\n - **Default:** `true`\n\n- **`general.sessionRetention.maxAge`** (string):\n - **Description:** Automatically delete chats older than this time period\n (e.g., \"30d\", \"7d\", \"24h\", \"1w\")\n - **Default:** `\"30d\"`\n\n- **`general.sessionRetention.maxCount`** (number):\n - **Description:** Alternative: Maximum number of sessions to keep (most\n recent)\n - **Default:** `undefined`\n\n- **`general.sessionRetention.minRetention`** (string):\n - **Description:** Minimum retention period (safety limit, defaults to \"1d\")\n - **Default:** `\"1d\"`\n\n#### `output`\n\n- **`output.format`** (enum):\n - **Description:** The format of the CLI output. Can be `text` or `json`.\n - **Default:** `\"text\"`\n - **Values:** `\"text\"`, `\"json\"`\n\n#### `ui`\n\n- **`ui.theme`** (string):\n - **Description:** The color theme for the UI. See the CLI themes guide for\n available options.\n - **Default:** `undefined`\n\n- **`ui.autoThemeSwitching`** (boolean):\n - **Description:** Automatically switch between default light and dark themes\n based on terminal background color.\n - **Default:** `true`\n\n- **`ui.terminalBackgroundPollingInterval`** (number):\n - **Description:** Interval in seconds to poll the terminal background color.\n - **Default:** `60`\n\n- **`ui.customThemes`** (object):\n - **Description:** Custom theme definitions.\n - **Default:** `{}`\n\n- **`ui.hideWindowTitle`** (boolean):\n - **Description:** Hide the window title bar\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`ui.inlineThinkingMode`** (enum):\n - **Description:** Display model thinking inline: off or full.\n - **Default:** `\"off\"`\n - **Values:** `\"off\"`, `\"full\"`\n\n- **`ui.showStatusInTitle`** (boolean):\n - **Description:** Show Gemini CLI model thoughts in the terminal window title\n during the working phase\n - **Default:** `false`\n\n- **`ui.dynamicWindowTitle`** (boolean):\n - **Description:** Update the terminal window title with current status icons\n (Ready: ◇, Action Required: ✋, Working: ✦)\n - **Default:** `true`\n\n- **`ui.showHomeDirectoryWarning`** (boolean):\n - **Description:** Show a warning when running Gemini CLI in the home\n directory.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`ui.showCompatibilityWarnings`** (boolean):\n - **Description:** Show warnings about terminal or OS compatibility issues.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`ui.hideTips`** (boolean):\n - **Description:** Hide helpful tips in the UI\n - **Default:** `false`\n\n- **`ui.escapePastedAtSymbols`** (boolean):\n - **Description:** When enabled, @ symbols in pasted text are escaped to\n prevent unintended @path expansion.\n - **Default:** `false`\n\n- **`ui.showShortcutsHint`** (boolean):\n - **Description:** Show the \"? for shortcuts\" hint above the input.\n - **Default:** `true`\n\n- **`ui.hideBanner`** (boolean):\n - **Description:** Hide the application banner\n - **Default:** `false`\n\n- **`ui.hideContextSummary`** (boolean):\n - **Description:** Hide the context summary (GEMINI.md, MCP servers) above the\n input.\n - **Default:** `false`\n\n- **`ui.footer.items`** (array):\n - **Description:** List of item IDs to display in the footer. Rendered in\n order\n - **Default:** `undefined`\n\n- **`ui.footer.showLabels`** (boolean):\n - **Description:** Display a second line above the footer items with\n descriptive headers (e.g., /model).\n - **Default:** `true`\n\n- **`ui.footer.hideCWD`** (boolean):\n - **Description:** Hide the current working directory in the footer.\n - **Default:** `false`\n\n- **`ui.footer.hideSandboxStatus`** (boolean):\n - **Description:** Hide the sandbox status indicator in the footer.\n - **Default:** `false`\n\n- **`ui.footer.hideModelInfo`** (boolean):\n - **Description:** Hide the model name and context usage in the footer.\n - **Default:** `false`\n\n- **`ui.footer.hideContextPercentage`** (boolean):\n - **Description:** Hides the context window usage percentage.\n - **Default:** `true`\n\n- **`ui.hideFooter`** (boolean):\n - **Description:** Hide the footer from the UI\n - **Default:** `false`\n\n- **`ui.showMemoryUsage`** (boolean):\n - **Description:** Display memory usage information in the UI\n - **Default:** `false`\n\n- **`ui.showLineNumbers`** (boolean):\n - **Description:** Show line numbers in the chat.\n - **Default:** `true`\n\n- **`ui.showCitations`** (boolean):\n - **Description:** Show citations for generated text in the chat.\n - **Default:** `false`\n\n- **`ui.showModelInfoInChat`** (boolean):\n - **Description:** Show the model name in the chat for each model turn.\n - **Default:** `false`\n\n- **`ui.showUserIdentity`** (boolean):\n - **Description:** Show the signed-in user's identity (e.g. email) in the UI.\n - **Default:** `true`\n\n- **`ui.useAlternateBuffer`** (boolean):\n - **Description:** Use an alternate screen buffer for the UI, preserving shell\n history.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`ui.useBackgroundColor`** (boolean):\n - **Description:** Whether to use background colors in the UI.\n - **Default:** `true`\n\n- **`ui.incrementalRendering`** (boolean):\n - **Description:** Enable incremental rendering for the UI. This option will\n reduce flickering but may cause rendering artifacts. Only supported when\n useAlternateBuffer is enabled.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`ui.showSpinner`** (boolean):\n - **Description:** Show the spinner during operations.\n - **Default:** `true`\n\n- **`ui.loadingPhrases`** (enum):\n - **Description:** What to show while the model is working: tips, witty\n comments, both, or nothing.\n - **Default:** `\"tips\"`\n - **Values:** `\"tips\"`, `\"witty\"`, `\"all\"`, `\"off\"`\n\n- **`ui.errorVerbosity`** (enum):\n - **Description:** Controls whether recoverable errors are hidden (low) or\n fully shown (full).\n - **Default:** `\"low\"`\n - **Values:** `\"low\"`, `\"full\"`\n\n- **`ui.customWittyPhrases`** (array):\n - **Description:** Custom witty phrases to display during loading. When\n provided, the CLI cycles through these instead of the defaults.\n - **Default:** `[]`\n\n- **`ui.accessibility.enableLoadingPhrases`** (boolean):\n - **Description:** @deprecated Use ui.loadingPhrases instead. Enable loading\n phrases during operations.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`ui.accessibility.screenReader`** (boolean):\n - **Description:** Render output in plain-text to be more screen reader\n accessible\n - **Default:** `false`\n - **Requires restart:** Yes\n\n#### `ide`\n\n- **`ide.enabled`** (boolean):\n - **Description:** Enable IDE integration mode.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`ide.hasSeenNudge`** (boolean):\n - **Description:** Whether the user has seen the IDE integration nudge.\n - **Default:** `false`\n\n#### `privacy`\n\n- **`privacy.usageStatisticsEnabled`** (boolean):\n - **Description:** Enable collection of usage statistics\n - **Default:** `true`\n - **Requires restart:** Yes\n\n#### `billing`\n\n- **`billing.overageStrategy`** (enum):\n - **Description:** How to handle quota exhaustion when AI credits are\n available. 'ask' prompts each time, 'always' automatically uses credits,\n 'never' disables credit usage.\n - **Default:** `\"ask\"`\n - **Values:** `\"ask\"`, `\"always\"`, `\"never\"`\n\n#### `model`\n\n- **`model.name`** (string):\n - **Description:** The Gemini model to use for conversations.\n - **Default:** `undefined`\n\n- **`model.maxSessionTurns`** (number):\n - **Description:** Maximum number of user/model/tool turns to keep in a\n session. -1 means unlimited.\n - **Default:** `-1`\n\n- **`model.summarizeToolOutput`** (object):\n - **Description:** Enables or disables summarization of tool output. Configure\n per-tool token budgets (for example {\"run_shell_command\": {\"tokenBudget\":\n 2000}}). Currently only the run_shell_command tool supports summarization.\n - **Default:** `undefined`\n\n- **`model.compressionThreshold`** (number):\n - **Description:** The fraction of context usage at which to trigger context\n compression (e.g. 0.2, 0.3).\n - **Default:** `0.5`\n - **Requires restart:** Yes\n\n- **`model.disableLoopDetection`** (boolean):\n - **Description:** Disable automatic detection and prevention of infinite\n loops.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`model.skipNextSpeakerCheck`** (boolean):\n - **Description:** Skip the next speaker check.\n - **Default:** `true`\n\n#### `modelConfigs`\n\n- **`modelConfigs.aliases`** (object):\n - **Description:** Named presets for model configs. Can be used in place of a\n model name and can inherit from other aliases using an `extends` property.\n - **Default:**\n\n ```json\n {\n \"base\": {\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"temperature\": 0,\n \"topP\": 1\n }\n }\n },\n \"chat-base\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"thinkingConfig\": {\n \"includeThoughts\": true\n },\n \"temperature\": 1,\n \"topP\": 0.95,\n \"topK\": 64\n }\n }\n },\n \"chat-base-2.5\": {\n \"extends\": \"chat-base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"thinkingConfig\": {\n \"thinkingBudget\": 8192\n }\n }\n }\n },\n \"chat-base-3\": {\n \"extends\": \"chat-base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"thinkingConfig\": {\n \"thinkingLevel\": \"HIGH\"\n }\n }\n }\n },\n \"gemini-3-pro-preview\": {\n \"extends\": \"chat-base-3\",\n \"modelConfig\": {\n \"model\": \"gemini-3-pro-preview\"\n }\n },\n \"gemini-3-flash-preview\": {\n \"extends\": \"chat-base-3\",\n \"modelConfig\": {\n \"model\": \"gemini-3-flash-preview\"\n }\n },\n \"gemini-2.5-pro\": {\n \"extends\": \"chat-base-2.5\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-pro\"\n }\n },\n \"gemini-2.5-flash\": {\n \"extends\": \"chat-base-2.5\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash\"\n }\n },\n \"gemini-2.5-flash-lite\": {\n \"extends\": \"chat-base-2.5\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\"\n }\n },\n \"gemini-2.5-flash-base\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash\"\n }\n },\n \"gemini-3-flash-base\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-3-flash-preview\"\n }\n },\n \"classifier\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"maxOutputTokens\": 1024,\n \"thinkingConfig\": {\n \"thinkingBudget\": 512\n }\n }\n }\n },\n \"prompt-completion\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"temperature\": 0.3,\n \"maxOutputTokens\": 16000,\n \"thinkingConfig\": {\n \"thinkingBudget\": 0\n }\n }\n }\n },\n \"fast-ack-helper\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"temperature\": 0.2,\n \"maxOutputTokens\": 120,\n \"thinkingConfig\": {\n \"thinkingBudget\": 0\n }\n }\n }\n },\n \"edit-corrector\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"thinkingConfig\": {\n \"thinkingBudget\": 0\n }\n }\n }\n },\n \"summarizer-default\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"maxOutputTokens\": 2000\n }\n }\n },\n \"summarizer-shell\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\",\n \"generateContentConfig\": {\n \"maxOutputTokens\": 2000\n }\n }\n },\n \"web-search\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"tools\": [\n {\n \"googleSearch\": {}\n }\n ]\n }\n }\n },\n \"web-fetch\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {\n \"generateContentConfig\": {\n \"tools\": [\n {\n \"urlContext\": {}\n }\n ]\n }\n }\n },\n \"web-fetch-fallback\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {}\n },\n \"loop-detection\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {}\n },\n \"loop-detection-double-check\": {\n \"extends\": \"base\",\n \"modelConfig\": {\n \"model\": \"gemini-3-pro-preview\"\n }\n },\n \"llm-edit-fixer\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {}\n },\n \"next-speaker-checker\": {\n \"extends\": \"gemini-3-flash-base\",\n \"modelConfig\": {}\n },\n \"chat-compression-3-pro\": {\n \"modelConfig\": {\n \"model\": \"gemini-3-pro-preview\"\n }\n },\n \"chat-compression-3-flash\": {\n \"modelConfig\": {\n \"model\": \"gemini-3-flash-preview\"\n }\n },\n \"chat-compression-2.5-pro\": {\n \"modelConfig\": {\n \"model\": \"gemini-2.5-pro\"\n }\n },\n \"chat-compression-2.5-flash\": {\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash\"\n }\n },\n \"chat-compression-2.5-flash-lite\": {\n \"modelConfig\": {\n \"model\": \"gemini-2.5-flash-lite\"\n }\n },\n \"chat-compression-default\": {\n \"modelConfig\": {\n \"model\": \"gemini-3-pro-preview\"\n }\n }\n }\n ```\n\n- **`modelConfigs.customAliases`** (object):\n - **Description:** Custom named presets for model configs. These are merged\n with (and override) the built-in aliases.\n - **Default:** `{}`\n\n- **`modelConfigs.customOverrides`** (array):\n - **Description:** Custom model config overrides. These are merged with (and\n added to) the built-in overrides.\n - **Default:** `[]`\n\n- **`modelConfigs.overrides`** (array):\n - **Description:** Apply specific configuration overrides based on matches,\n with a primary key of model (or alias). The most specific match will be\n used.\n - **Default:** `[]`\n\n- **`modelConfigs.modelDefinitions`** (object):\n - **Description:** Registry of model metadata, including tier, family, and\n features.\n - **Default:**\n\n ```json\n {\n \"gemini-3.1-flash-lite-preview\": {\n \"tier\": \"flash-lite\",\n \"family\": \"gemini-3\",\n \"isPreview\": true,\n \"isVisible\": true,\n \"features\": {\n \"thinking\": false,\n \"multimodalToolUse\": true\n }\n },\n \"gemini-3.1-pro-preview\": {\n \"tier\": \"pro\",\n \"family\": \"gemini-3\",\n \"isPreview\": true,\n \"isVisible\": true,\n \"features\": {\n \"thinking\": true,\n \"multimodalToolUse\": true\n }\n },\n \"gemini-3.1-pro-preview-customtools\": {\n \"tier\": \"pro\",\n \"family\": \"gemini-3\",\n \"isPreview\": true,\n \"isVisible\": false,\n \"features\": {\n \"thinking\": true,\n \"multimodalToolUse\": true\n }\n },\n \"gemini-3-pro-preview\": {\n \"tier\": \"pro\",\n \"family\": \"gemini-3\",\n \"isPreview\": true,\n \"isVisible\": true,\n \"features\": {\n \"thinking\": true,\n \"multimodalToolUse\": true\n }\n },\n \"gemini-3-flash-preview\": {\n \"tier\": \"flash\",\n \"family\": \"gemini-3\",\n \"isPreview\": true,\n \"isVisible\": true,\n \"features\": {\n \"thinking\": false,\n \"multimodalToolUse\": true\n }\n },\n \"gemini-2.5-pro\": {\n \"tier\": \"pro\",\n \"family\": \"gemini-2.5\",\n \"isPreview\": false,\n \"isVisible\": true,\n \"features\": {\n \"thinking\": false,\n \"multimodalToolUse\": false\n }\n },\n \"gemini-2.5-flash\": {\n \"tier\": \"flash\",\n \"family\": \"gemini-2.5\",\n \"isPreview\": false,\n \"isVisible\": true,\n \"features\": {\n \"thinking\": false,\n \"multimodalToolUse\": false\n }\n },\n \"gemini-2.5-flash-lite\": {\n \"tier\": \"flash-lite\",\n \"family\": \"gemini-2.5\",\n \"isPreview\": false,\n \"isVisible\": true,\n \"features\": {\n \"thinking\": false,\n \"multimodalToolUse\": false\n }\n },\n \"auto\": {\n \"tier\": \"auto\",\n \"isPreview\": true,\n \"isVisible\": false,\n \"features\": {\n \"thinking\": true,\n \"multimodalToolUse\": false\n }\n },\n \"pro\": {\n \"tier\": \"pro\",\n \"isPreview\": false,\n \"isVisible\": false,\n \"features\": {\n \"thinking\": true,\n \"multimodalToolUse\": false\n }\n },\n \"flash\": {\n \"tier\": \"flash\",\n \"isPreview\": false,\n \"isVisible\": false,\n \"features\": {\n \"thinking\": false,\n \"multimodalToolUse\": false\n }\n },\n \"flash-lite\": {\n \"tier\": \"flash-lite\",\n \"isPreview\": false,\n \"isVisible\": false,\n \"features\": {\n \"thinking\": false,\n \"multimodalToolUse\": false\n }\n },\n \"auto-gemini-3\": {\n \"displayName\": \"Auto (Gemini 3)\",\n \"tier\": \"auto\",\n \"isPreview\": true,\n \"isVisible\": true,\n \"dialogDescription\": \"Let Gemini CLI decide the best model for the task: gemini-3-pro, gemini-3-flash\",\n \"features\": {\n \"thinking\": true,\n \"multimodalToolUse\": false\n }\n },\n \"auto-gemini-2.5\": {\n \"displayName\": \"Auto (Gemini 2.5)\",\n \"tier\": \"auto\",\n \"isPreview\": false,\n \"isVisible\": true,\n \"dialogDescription\": \"Let Gemini CLI decide the best model for the task: gemini-2.5-pro, gemini-2.5-flash\",\n \"features\": {\n \"thinking\": false,\n \"multimodalToolUse\": false\n }\n }\n }\n ```\n\n - **Requires restart:** Yes\n\n- **`modelConfigs.modelIdResolutions`** (object):\n - **Description:** Rules for resolving requested model names to concrete model\n IDs based on context.\n - **Default:**\n\n ```json\n {\n \"gemini-3.1-pro-preview\": {\n \"default\": \"gemini-3.1-pro-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"hasAccessToPreview\": false\n },\n \"target\": \"gemini-2.5-pro\"\n }\n ]\n },\n \"gemini-3.1-pro-preview-customtools\": {\n \"default\": \"gemini-3.1-pro-preview-customtools\",\n \"contexts\": [\n {\n \"condition\": {\n \"hasAccessToPreview\": false\n },\n \"target\": \"gemini-2.5-pro\"\n }\n ]\n },\n \"gemini-3-flash-preview\": {\n \"default\": \"gemini-3-flash-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"hasAccessToPreview\": false\n },\n \"target\": \"gemini-2.5-flash\"\n }\n ]\n },\n \"gemini-3-pro-preview\": {\n \"default\": \"gemini-3-pro-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"hasAccessToPreview\": false\n },\n \"target\": \"gemini-2.5-pro\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true,\n \"useCustomTools\": true\n },\n \"target\": \"gemini-3.1-pro-preview-customtools\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true\n },\n \"target\": \"gemini-3.1-pro-preview\"\n }\n ]\n },\n \"auto-gemini-3\": {\n \"default\": \"gemini-3-pro-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"hasAccessToPreview\": false\n },\n \"target\": \"gemini-2.5-pro\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true,\n \"useCustomTools\": true\n },\n \"target\": \"gemini-3.1-pro-preview-customtools\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true\n },\n \"target\": \"gemini-3.1-pro-preview\"\n }\n ]\n },\n \"auto\": {\n \"default\": \"gemini-3-pro-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"hasAccessToPreview\": false\n },\n \"target\": \"gemini-2.5-pro\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true,\n \"useCustomTools\": true\n },\n \"target\": \"gemini-3.1-pro-preview-customtools\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true\n },\n \"target\": \"gemini-3.1-pro-preview\"\n }\n ]\n },\n \"pro\": {\n \"default\": \"gemini-3-pro-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"hasAccessToPreview\": false\n },\n \"target\": \"gemini-2.5-pro\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true,\n \"useCustomTools\": true\n },\n \"target\": \"gemini-3.1-pro-preview-customtools\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true\n },\n \"target\": \"gemini-3.1-pro-preview\"\n }\n ]\n },\n \"auto-gemini-2.5\": {\n \"default\": \"gemini-2.5-pro\"\n },\n \"flash\": {\n \"default\": \"gemini-3-flash-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"hasAccessToPreview\": false\n },\n \"target\": \"gemini-2.5-flash\"\n }\n ]\n },\n \"flash-lite\": {\n \"default\": \"gemini-2.5-flash-lite\"\n }\n }\n ```\n\n - **Requires restart:** Yes\n\n- **`modelConfigs.classifierIdResolutions`** (object):\n - **Description:** Rules for resolving classifier tiers (flash, pro) to\n concrete model IDs.\n - **Default:**\n\n ```json\n {\n \"flash\": {\n \"default\": \"gemini-3-flash-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"requestedModels\": [\"auto-gemini-2.5\", \"gemini-2.5-pro\"]\n },\n \"target\": \"gemini-2.5-flash\"\n },\n {\n \"condition\": {\n \"requestedModels\": [\"auto-gemini-3\", \"gemini-3-pro-preview\"]\n },\n \"target\": \"gemini-3-flash-preview\"\n }\n ]\n },\n \"pro\": {\n \"default\": \"gemini-3-pro-preview\",\n \"contexts\": [\n {\n \"condition\": {\n \"requestedModels\": [\"auto-gemini-2.5\", \"gemini-2.5-pro\"]\n },\n \"target\": \"gemini-2.5-pro\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true,\n \"useCustomTools\": true\n },\n \"target\": \"gemini-3.1-pro-preview-customtools\"\n },\n {\n \"condition\": {\n \"useGemini3_1\": true\n },\n \"target\": \"gemini-3.1-pro-preview\"\n }\n ]\n }\n }\n ```\n\n - **Requires restart:** Yes\n\n- **`modelConfigs.modelChains`** (object):\n - **Description:** Availability policy chains defining fallback behavior for\n models.\n - **Default:**\n\n ```json\n {\n \"preview\": [\n {\n \"model\": \"gemini-3-pro-preview\",\n \"actions\": {\n \"terminal\": \"prompt\",\n \"transient\": \"prompt\",\n \"not_found\": \"prompt\",\n \"unknown\": \"prompt\"\n },\n \"stateTransitions\": {\n \"terminal\": \"terminal\",\n \"transient\": \"terminal\",\n \"not_found\": \"terminal\",\n \"unknown\": \"terminal\"\n }\n },\n {\n \"model\": \"gemini-3-flash-preview\",\n \"isLastResort\": true,\n \"actions\": {\n \"terminal\": \"prompt\",\n \"transient\": \"prompt\",\n \"not_found\": \"prompt\",\n \"unknown\": \"prompt\"\n },\n \"stateTransitions\": {\n \"terminal\": \"terminal\",\n \"transient\": \"terminal\",\n \"not_found\": \"terminal\",\n \"unknown\": \"terminal\"\n }\n }\n ],\n \"default\": [\n {\n \"model\": \"gemini-2.5-pro\",\n \"actions\": {\n \"terminal\": \"prompt\",\n \"transient\": \"prompt\",\n \"not_found\": \"prompt\",\n \"unknown\": \"prompt\"\n },\n \"stateTransitions\": {\n \"terminal\": \"terminal\",\n \"transient\": \"terminal\",\n \"not_found\": \"terminal\",\n \"unknown\": \"terminal\"\n }\n },\n {\n \"model\": \"gemini-2.5-flash\",\n \"isLastResort\": true,\n \"actions\": {\n \"terminal\": \"prompt\",\n \"transient\": \"prompt\",\n \"not_found\": \"prompt\",\n \"unknown\": \"prompt\"\n },\n \"stateTransitions\": {\n \"terminal\": \"terminal\",\n \"transient\": \"terminal\",\n \"not_found\": \"terminal\",\n \"unknown\": \"terminal\"\n }\n }\n ],\n \"lite\": [\n {\n \"model\": \"gemini-2.5-flash-lite\",\n \"actions\": {\n \"terminal\": \"silent\",\n \"transient\": \"silent\",\n \"not_found\": \"silent\",\n \"unknown\": \"silent\"\n },\n \"stateTransitions\": {\n \"terminal\": \"terminal\",\n \"transient\": \"terminal\",\n \"not_found\": \"terminal\",\n \"unknown\": \"terminal\"\n }\n },\n {\n \"model\": \"gemini-2.5-flash\",\n \"actions\": {\n \"terminal\": \"silent\",\n \"transient\": \"silent\",\n \"not_found\": \"silent\",\n \"unknown\": \"silent\"\n },\n \"stateTransitions\": {\n \"terminal\": \"terminal\",\n \"transient\": \"terminal\",\n \"not_found\": \"terminal\",\n \"unknown\": \"terminal\"\n }\n },\n {\n \"model\": \"gemini-2.5-pro\",\n \"isLastResort\": true,\n \"actions\": {\n \"terminal\": \"silent\",\n \"transient\": \"silent\",\n \"not_found\": \"silent\",\n \"unknown\": \"silent\"\n },\n \"stateTransitions\": {\n \"terminal\": \"terminal\",\n \"transient\": \"terminal\",\n \"not_found\": \"terminal\",\n \"unknown\": \"terminal\"\n }\n }\n ]\n }\n ```\n\n - **Requires restart:** Yes\n\n#### `agents`\n\n- **`agents.overrides`** (object):\n - **Description:** Override settings for specific agents, e.g. to disable the\n agent, set a custom model config, or run config.\n - **Default:** `{}`\n - **Requires restart:** Yes\n\n- **`agents.browser.sessionMode`** (enum):\n - **Description:** Session mode: 'persistent', 'isolated', or 'existing'.\n - **Default:** `\"persistent\"`\n - **Values:** `\"persistent\"`, `\"isolated\"`, `\"existing\"`\n - **Requires restart:** Yes\n\n- **`agents.browser.headless`** (boolean):\n - **Description:** Run browser in headless mode.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`agents.browser.profilePath`** (string):\n - **Description:** Path to browser profile directory for session persistence.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`agents.browser.visualModel`** (string):\n - **Description:** Model override for the visual agent.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`agents.browser.allowedDomains`** (array):\n - **Description:** A list of allowed domains for the browser agent (e.g.,\n [\"github.com\", \"*.google.com\"]).\n - **Default:**\n\n ```json\n [\"github.com\", \"*.google.com\", \"localhost\"]\n ```\n\n - **Requires restart:** Yes\n\n- **`agents.browser.disableUserInput`** (boolean):\n - **Description:** Disable user input on browser window during automation.\n - **Default:** `true`\n\n- **`agents.browser.confirmSensitiveActions`** (boolean):\n - **Description:** Require manual confirmation for sensitive browser actions\n (e.g., fill_form, evaluate_script).\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`agents.browser.blockFileUploads`** (boolean):\n - **Description:** Hard-block file upload requests from the browser agent.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n#### `context`\n\n- **`context.fileName`** (string | string[]):\n - **Description:** The name of the context file or files to load into memory.\n Accepts either a single string or an array of strings.\n - **Default:** `undefined`\n\n- **`context.importFormat`** (string):\n - **Description:** The format to use when importing memory.\n - **Default:** `undefined`\n\n- **`context.includeDirectoryTree`** (boolean):\n - **Description:** Whether to include the directory tree of the current\n working directory in the initial request to the model.\n - **Default:** `true`\n\n- **`context.discoveryMaxDirs`** (number):\n - **Description:** Maximum number of directories to search for memory.\n - **Default:** `200`\n\n- **`context.includeDirectories`** (array):\n - **Description:** Additional directories to include in the workspace context.\n Missing directories will be skipped with a warning.\n - **Default:** `[]`\n\n- **`context.loadMemoryFromIncludeDirectories`** (boolean):\n - **Description:** Controls how /memory reload loads GEMINI.md files. When\n true, include directories are scanned; when false, only the current\n directory is used.\n - **Default:** `false`\n\n- **`context.fileFiltering.respectGitIgnore`** (boolean):\n - **Description:** Respect .gitignore files when searching.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`context.fileFiltering.respectGeminiIgnore`** (boolean):\n - **Description:** Respect .geminiignore files when searching.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`context.fileFiltering.enableRecursiveFileSearch`** (boolean):\n - **Description:** Enable recursive file search functionality when completing\n @ references in the prompt.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`context.fileFiltering.enableFuzzySearch`** (boolean):\n - **Description:** Enable fuzzy search when searching for files.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`context.fileFiltering.customIgnoreFilePaths`** (array):\n - **Description:** Additional ignore file paths to respect. These files take\n precedence over .geminiignore and .gitignore. Files earlier in the array\n take precedence over files later in the array, e.g. the first file takes\n precedence over the second one.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n#### `tools`\n\n- **`tools.sandbox`** (string):\n - **Description:** Legacy full-process sandbox execution environment. Set to a\n boolean to enable or disable the sandbox, provide a string path to a sandbox\n profile, or specify an explicit sandbox command (e.g., \"docker\", \"podman\",\n \"lxc\", \"windows-native\").\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.sandboxAllowedPaths`** (array):\n - **Description:** List of additional paths that the sandbox is allowed to\n access.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n- **`tools.sandboxNetworkAccess`** (boolean):\n - **Description:** Whether the sandbox is allowed to access the network.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`tools.shell.enableInteractiveShell`** (boolean):\n - **Description:** Use node-pty for an interactive shell experience. Fallback\n to child_process still applies.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`tools.shell.pager`** (string):\n - **Description:** The pager command to use for shell output. Defaults to\n `cat`.\n - **Default:** `\"cat\"`\n\n- **`tools.shell.showColor`** (boolean):\n - **Description:** Show color in shell output.\n - **Default:** `false`\n\n- **`tools.shell.inactivityTimeout`** (number):\n - **Description:** The maximum time in seconds allowed without output from the\n shell command. Defaults to 5 minutes.\n - **Default:** `300`\n\n- **`tools.shell.enableShellOutputEfficiency`** (boolean):\n - **Description:** Enable shell output efficiency optimizations for better\n performance.\n - **Default:** `true`\n\n- **`tools.core`** (array):\n - **Description:** Restrict the set of built-in tools with an allowlist. Match\n semantics mirror tools.allowed; see the built-in tools documentation for\n available names.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.allowed`** (array):\n - **Description:** Tool names that bypass the confirmation dialog. Useful for\n trusted commands (for example [\"run_shell_command(git)\",\n \"run_shell_command(npm test)\"]). See shell tool command restrictions for\n matching details.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.exclude`** (array):\n - **Description:** Tool names to exclude from discovery.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.discoveryCommand`** (string):\n - **Description:** Command to run for tool discovery.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.callCommand`** (string):\n - **Description:** Defines a custom shell command for invoking discovered\n tools. The command must take the tool name as the first argument, read JSON\n arguments from stdin, and emit JSON results on stdout.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`tools.useRipgrep`** (boolean):\n - **Description:** Use ripgrep for file content search instead of the fallback\n implementation. Provides faster search performance.\n - **Default:** `true`\n\n- **`tools.truncateToolOutputThreshold`** (number):\n - **Description:** Maximum characters to show when truncating large tool\n outputs. Set to 0 or negative to disable truncation.\n - **Default:** `40000`\n - **Requires restart:** Yes\n\n- **`tools.disableLLMCorrection`** (boolean):\n - **Description:** Disable LLM-based error correction for edit tools. When\n enabled, tools will fail immediately if exact string matches are not found,\n instead of attempting to self-correct.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n#### `mcp`\n\n- **`mcp.serverCommand`** (string):\n - **Description:** Command to start an MCP server.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`mcp.allowed`** (array):\n - **Description:** A list of MCP servers to allow.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`mcp.excluded`** (array):\n - **Description:** A list of MCP servers to exclude.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n#### `useWriteTodos`\n\n- **`useWriteTodos`** (boolean):\n - **Description:** Enable the write_todos tool.\n - **Default:** `true`\n\n#### `security`\n\n- **`security.toolSandboxing`** (boolean):\n - **Description:** Experimental tool-level sandboxing (implementation in\n progress).\n - **Default:** `false`\n\n- **`security.disableYoloMode`** (boolean):\n - **Description:** Disable YOLO mode, even if enabled by a flag.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`security.disableAlwaysAllow`** (boolean):\n - **Description:** Disable \"Always allow\" options in tool confirmation\n dialogs.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`security.enablePermanentToolApproval`** (boolean):\n - **Description:** Enable the \"Allow for all future sessions\" option in tool\n confirmation dialogs.\n - **Default:** `false`\n\n- **`security.autoAddToPolicyByDefault`** (boolean):\n - **Description:** When enabled, the \"Allow for all future sessions\" option\n becomes the default choice for low-risk tools in trusted workspaces.\n - **Default:** `false`\n\n- **`security.blockGitExtensions`** (boolean):\n - **Description:** Blocks installing and loading extensions from Git.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`security.allowedExtensions`** (array):\n - **Description:** List of Regex patterns for allowed extensions. If nonempty,\n only extensions that match the patterns in this list are allowed. Overrides\n the blockGitExtensions setting.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n- **`security.folderTrust.enabled`** (boolean):\n - **Description:** Setting to track whether Folder trust is enabled.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`security.environmentVariableRedaction.allowed`** (array):\n - **Description:** Environment variables to always allow (bypass redaction).\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n- **`security.environmentVariableRedaction.blocked`** (array):\n - **Description:** Environment variables to always redact.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n- **`security.environmentVariableRedaction.enabled`** (boolean):\n - **Description:** Enable redaction of environment variables that may contain\n secrets.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`security.auth.selectedType`** (string):\n - **Description:** The currently selected authentication type.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`security.auth.enforcedType`** (string):\n - **Description:** The required auth type. If this does not match the selected\n auth type, the user will be prompted to re-authenticate.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`security.auth.useExternal`** (boolean):\n - **Description:** Whether to use an external authentication flow.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`security.enableConseca`** (boolean):\n - **Description:** Enable the context-aware security checker. This feature\n uses an LLM to dynamically generate and enforce security policies for tool\n use based on your prompt, providing an additional layer of protection\n against unintended actions.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n#### `advanced`\n\n- **`advanced.autoConfigureMemory`** (boolean):\n - **Description:** Automatically configure Node.js memory limits\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`advanced.dnsResolutionOrder`** (string):\n - **Description:** The DNS resolution order.\n - **Default:** `undefined`\n - **Requires restart:** Yes\n\n- **`advanced.excludedEnvVars`** (array):\n - **Description:** Environment variables to exclude from project context.\n - **Default:**\n\n ```json\n [\"DEBUG\", \"DEBUG_MODE\"]\n ```\n\n- **`advanced.bugCommand`** (object):\n - **Description:** Configuration for the bug report command.\n - **Default:** `undefined`\n\n#### `experimental`\n\n- **`experimental.toolOutputMasking.enabled`** (boolean):\n - **Description:** Enables tool output masking to save tokens.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.toolOutputMasking.toolProtectionThreshold`** (number):\n - **Description:** Minimum number of tokens to protect from masking (most\n recent tool outputs).\n - **Default:** `50000`\n - **Requires restart:** Yes\n\n- **`experimental.toolOutputMasking.minPrunableTokensThreshold`** (number):\n - **Description:** Minimum prunable tokens required to trigger a masking pass.\n - **Default:** `30000`\n - **Requires restart:** Yes\n\n- **`experimental.toolOutputMasking.protectLatestTurn`** (boolean):\n - **Description:** Ensures the absolute latest turn is never masked,\n regardless of token count.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.enableAgents`** (boolean):\n - **Description:** Enable local and remote subagents.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.worktrees`** (boolean):\n - **Description:** Enable automated Git worktree management for parallel work.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.extensionManagement`** (boolean):\n - **Description:** Enable extension management features.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.extensionConfig`** (boolean):\n - **Description:** Enable requesting and fetching of extension settings.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.extensionRegistry`** (boolean):\n - **Description:** Enable extension registry explore UI.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.extensionRegistryURI`** (string):\n - **Description:** The URI (web URL or local file path) of the extension\n registry.\n - **Default:** `\"https://geminicli.com/extensions.json\"`\n - **Requires restart:** Yes\n\n- **`experimental.extensionReloading`** (boolean):\n - **Description:** Enables extension loading/unloading within the CLI session.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.jitContext`** (boolean):\n - **Description:** Enable Just-In-Time (JIT) context loading.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.useOSC52Paste`** (boolean):\n - **Description:** Use OSC 52 for pasting. This may be more robust than the\n default system when using remote terminal sessions (if your terminal is\n configured to allow it).\n - **Default:** `false`\n\n- **`experimental.useOSC52Copy`** (boolean):\n - **Description:** Use OSC 52 for copying. This may be more robust than the\n default system when using remote terminal sessions (if your terminal is\n configured to allow it).\n - **Default:** `false`\n\n- **`experimental.plan`** (boolean):\n - **Description:** Enable Plan Mode.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`experimental.taskTracker`** (boolean):\n - **Description:** Enable task tracker tools.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.modelSteering`** (boolean):\n - **Description:** Enable model steering (user hints) to guide the model\n during tool execution.\n - **Default:** `false`\n\n- **`experimental.directWebFetch`** (boolean):\n - **Description:** Enable web fetch behavior that bypasses LLM summarization.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.dynamicModelConfiguration`** (boolean):\n - **Description:** Enable dynamic model configuration (definitions,\n resolutions, and chains) via settings.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.gemmaModelRouter.enabled`** (boolean):\n - **Description:** Enable the Gemma Model Router (experimental). Requires a\n local endpoint serving Gemma via the Gemini API using LiteRT-LM shim.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.gemmaModelRouter.classifier.host`** (string):\n - **Description:** The host of the classifier.\n - **Default:** `\"http://localhost:9379\"`\n - **Requires restart:** Yes\n\n- **`experimental.gemmaModelRouter.classifier.model`** (string):\n - **Description:** The model to use for the classifier. Only tested on\n `gemma3-1b-gpu-custom`.\n - **Default:** `\"gemma3-1b-gpu-custom\"`\n - **Requires restart:** Yes\n\n- **`experimental.memoryManager`** (boolean):\n - **Description:** Replace the built-in save_memory tool with a memory manager\n subagent that supports adding, removing, de-duplicating, and organizing\n memories.\n - **Default:** `false`\n - **Requires restart:** Yes\n\n- **`experimental.topicUpdateNarration`** (boolean):\n - **Description:** Enable the experimental Topic & Update communication model\n for reduced chattiness and structured progress reporting.\n - **Default:** `false`\n\n#### `skills`\n\n- **`skills.enabled`** (boolean):\n - **Description:** Enable Agent Skills.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`skills.disabled`** (array):\n - **Description:** List of disabled skills.\n - **Default:** `[]`\n - **Requires restart:** Yes\n\n#### `hooksConfig`\n\n- **`hooksConfig.enabled`** (boolean):\n - **Description:** Canonical toggle for the hooks system. When disabled, no\n hooks will be executed.\n - **Default:** `true`\n - **Requires restart:** Yes\n\n- **`hooksConfig.disabled`** (array):\n - **Description:** List of hook names (commands) that should be disabled.\n Hooks in this list will not execute even if configured.\n - **Default:** `[]`\n\n- **`hooksConfig.notifications`** (boolean):\n - **Description:** Show visual indicators when hooks are executing.\n - **Default:** `true`\n\n#### `hooks`\n\n- **`hooks.BeforeTool`** (array):\n - **Description:** Hooks that execute before tool execution. Can intercept,\n validate, or modify tool calls.\n - **Default:** `[]`\n\n- **`hooks.AfterTool`** (array):\n - **Description:** Hooks that execute after tool execution. Can process\n results, log outputs, or trigger follow-up actions.\n - **Default:** `[]`\n\n- **`hooks.BeforeAgent`** (array):\n - **Description:** Hooks that execute before agent loop starts. Can set up\n context or initialize resources.\n - **Default:** `[]`\n\n- **`hooks.AfterAgent`** (array):\n - **Description:** Hooks that execute after agent loop completes. Can perform\n cleanup or summarize results.\n - **Default:** `[]`\n\n- **`hooks.Notification`** (array):\n - **Description:** Hooks that execute on notification events (errors,\n warnings, info). Can log or alert on specific conditions.\n - **Default:** `[]`\n\n- **`hooks.SessionStart`** (array):\n - **Description:** Hooks that execute when a session starts. Can initialize\n session-specific resources or state.\n - **Default:** `[]`\n\n- **`hooks.SessionEnd`** (array):\n - **Description:** Hooks that execute when a session ends. Can perform cleanup\n or persist session data.\n - **Default:** `[]`\n\n- **`hooks.PreCompress`** (array):\n - **Description:** Hooks that execute before chat history compression. Can\n back up or analyze conversation before compression.\n - **Default:** `[]`\n\n- **`hooks.BeforeModel`** (array):\n - **Description:** Hooks that execute before LLM requests. Can modify prompts,\n inject context, or control model parameters.\n - **Default:** `[]`\n\n- **`hooks.AfterModel`** (array):\n - **Description:** Hooks that execute after LLM responses. Can process\n outputs, extract information, or log interactions.\n - **Default:** `[]`\n\n- **`hooks.BeforeToolSelection`** (array):\n - **Description:** Hooks that execute before tool selection. Can filter or\n prioritize available tools dynamically.\n - **Default:** `[]`\n\n#### `admin`\n\n- **`admin.secureModeEnabled`** (boolean):\n - **Description:** If true, disallows YOLO mode and \"Always allow\" options\n from being used.\n - **Default:** `false`\n\n- **`admin.extensions.enabled`** (boolean):\n - **Description:** If false, disallows extensions from being installed or\n used.\n - **Default:** `true`\n\n- **`admin.mcp.enabled`** (boolean):\n - **Description:** If false, disallows MCP servers from being used.\n - **Default:** `true`\n\n- **`admin.mcp.config`** (object):\n - **Description:** Admin-configured MCP servers (allowlist).\n - **Default:** `{}`\n\n- **`admin.mcp.requiredConfig`** (object):\n - **Description:** Admin-required MCP servers that are always injected.\n - **Default:** `{}`\n\n- **`admin.skills.enabled`** (boolean):\n - **Description:** If false, disallows agent skills from being used.\n - **Default:** `true`\n \u003c!-- SETTINGS-AUTOGEN:END -->\n\n#### `mcpServers`\n\nConfigures connections to one or more Model-Context Protocol (MCP) servers for\ndiscovering and using custom tools. Gemini CLI attempts to connect to each\nconfigured MCP server to discover available tools. Every discovered tool is\nprepended with the `mcp_` prefix and its server alias to form a fully qualified\nname (FQN) (e.g., `mcp_serverAlias_actualToolName`) to avoid conflicts. Note\nthat the system might strip certain schema properties from MCP tool definitions\nfor compatibility. At least one of `command`, `url`, or `httpUrl` must be\nprovided. If multiple are specified, the order of precedence is `httpUrl`, then\n`url`, then `command`.\n\n\u003c!-- prettier-ignore -->\n> [!WARNING]\n> Avoid using underscores (`_`) in your server aliases (e.g., use\n> `my-server` instead of `my_server`). The underlying policy engine parses Fully\n> Qualified Names (`mcp_server_tool`) using the first underscore after the\n> `mcp_` prefix. An underscore in your server alias will cause the parser to\n> misidentify the server name, which can cause security policies to fail\n> silently.\n\n- **`mcpServers.\u003cSERVER_NAME>`** (object): The server parameters for the named\n server.\n - `command` (string, optional): The command to execute to start the MCP server\n via standard I/O.\n - `args` (array of strings, optional): Arguments to pass to the command.\n - `env` (object, optional): Environment variables to set for the server\n process.\n - `cwd` (string, optional): The working directory in which to start the\n server.\n - `url` (string, optional): The URL of an MCP server that uses Server-Sent\n Events (SSE) for communication.\n - `httpUrl` (string, optional): The URL of an MCP server that uses streamable\n HTTP for communication.\n - `headers` (object, optional): A map of HTTP headers to send with requests to\n `url` or `httpUrl`.\n - `timeout` (number, optional): Timeout in milliseconds for requests to this\n MCP server.\n - `trust` (boolean, optional): Trust this server and bypass all tool call\n confirmations.\n - `description` (string, optional): A brief description of the server, which\n may be used for display purposes.\n - `includeTools` (array of strings, optional): List of tool names to include\n from this MCP server. When specified, only the tools listed here will be\n available from this server (allowlist behavior). If not specified, all tools\n from the server are enabled by default.\n - `excludeTools` (array of strings, optional): List of tool names to exclude\n from this MCP server. Tools listed here will not be available to the model,\n even if they are exposed by the server. **Note:** `excludeTools` takes\n precedence over `includeTools` - if a tool is in both lists, it will be\n excluded.\n\n#### `telemetry`\n\nConfigures logging and metrics collection for Gemini CLI. For more information,\nsee [Telemetry](/docs/cli/telemetry).\n\n- **Properties:**\n - **`enabled`** (boolean): Whether or not telemetry is enabled.\n - **`target`** (string): The destination for collected telemetry. Supported\n values are `local` and `gcp`.\n - **`otlpEndpoint`** (string): The endpoint for the OTLP Exporter.\n - **`otlpProtocol`** (string): The protocol for the OTLP Exporter (`grpc` or\n `http`).\n - **`logPrompts`** (boolean): Whether or not to include the content of user\n prompts in the logs.\n - **`outfile`** (string): The file to write telemetry to when `target` is\n `local`.\n - **`useCollector`** (boolean): Whether to use an external OTLP collector.\n\n### Example `settings.json`\n\nHere is an example of a `settings.json` file with the nested structure, new as\nof v0.3.0:\n\n```json\n{\n \"general\": {\n \"vimMode\": true,\n \"preferredEditor\": \"code\",\n \"sessionRetention\": {\n \"enabled\": true,\n \"maxAge\": \"30d\",\n \"maxCount\": 100\n }\n },\n \"ui\": {\n \"theme\": \"GitHub\",\n \"hideBanner\": true,\n \"hideTips\": false,\n \"customWittyPhrases\": [\n \"You forget a thousand things every day. Make sure this is one of ’em\",\n \"Connecting to AGI\"\n ]\n },\n \"tools\": {\n \"sandbox\": \"docker\",\n \"discoveryCommand\": \"bin/get_tools\",\n \"callCommand\": \"bin/call_tool\",\n \"exclude\": [\"write_file\"]\n },\n \"mcpServers\": {\n \"mainServer\": {\n \"command\": \"bin/mcp_server.py\"\n },\n \"anotherServer\": {\n \"command\": \"node\",\n \"args\": [\"mcp_server.js\", \"--verbose\"]\n }\n },\n \"telemetry\": {\n \"enabled\": true,\n \"target\": \"local\",\n \"otlpEndpoint\": \"http://localhost:4317\",\n \"logPrompts\": true\n },\n \"privacy\": {\n \"usageStatisticsEnabled\": true\n },\n \"model\": {\n \"name\": \"gemini-1.5-pro-latest\",\n \"maxSessionTurns\": 10,\n \"summarizeToolOutput\": {\n \"run_shell_command\": {\n \"tokenBudget\": 100\n }\n }\n },\n \"context\": {\n \"fileName\": [\"CONTEXT.md\", \"GEMINI.md\"],\n \"includeDirectories\": [\"path/to/dir1\", \"~/path/to/dir2\", \"../path/to/dir3\"],\n \"loadFromIncludeDirectories\": true,\n \"fileFiltering\": {\n \"respectGitIgnore\": false\n }\n },\n \"advanced\": {\n \"excludedEnvVars\": [\"DEBUG\", \"DEBUG_MODE\", \"NODE_ENV\"]\n }\n}\n```\n\n## Shell history\n\nThe CLI keeps a history of shell commands you run. To avoid conflicts between\ndifferent projects, this history is stored in a project-specific directory\nwithin your user's home folder.\n\n- **Location:** `~/.gemini/tmp/\u003cproject_hash>/shell_history`\n - `\u003cproject_hash>` is a unique identifier generated from your project's root\n path.\n - The history is stored in a file named `shell_history`.\n\n## Environment variables and `.env` files\n\nEnvironment variables are a common way to configure applications, especially for\nsensitive information like API keys or for settings that might change between\nenvironments. For authentication setup, see the\n[Authentication documentation](/docs/get-started/authentication) which covers\nall available authentication methods.\n\nThe CLI automatically loads environment variables from an `.env` file. The\nloading order is:\n\n1. `.env` file in the current working directory.\n2. If not found, it searches upwards in parent directories until it finds an\n `.env` file or reaches the project root (identified by a `.git` folder) or\n the home directory.\n3. If still not found, it looks for `~/.env` (in the user's home directory).\n\n**Environment variable exclusion:** Some environment variables (like `DEBUG` and\n`DEBUG_MODE`) are automatically excluded from being loaded from project `.env`\nfiles to prevent interference with gemini-cli behavior. Variables from\n`.gemini/.env` files are never excluded. You can customize this behavior using\nthe `advanced.excludedEnvVars` setting in your `settings.json` file.\n\n- **`GEMINI_API_KEY`**:\n - Your API key for the Gemini API.\n - One of several available\n [authentication methods](/docs/get-started/authentication).\n - Set this in your shell profile (e.g., `~/.bashrc`, `~/.zshrc`) or an `.env`\n file.\n- **`GEMINI_MODEL`**:\n - Specifies the default Gemini model to use.\n - Overrides the hardcoded default\n - Example: `export GEMINI_MODEL=\"gemini-3-flash-preview\"` (Windows PowerShell:\n `$env:GEMINI_MODEL=\"gemini-3-flash-preview\"`)\n- **`GEMINI_CLI_IDE_PID`**:\n - Manually specifies the PID of the IDE process to use for integration. This\n is useful when running Gemini CLI in a standalone terminal while still\n wanting to associate it with a specific IDE instance.\n - Overrides the automatic IDE detection logic.\n- **`GEMINI_CLI_HOME`**:\n - Specifies the root directory for Gemini CLI's user-level configuration and\n storage.\n - By default, this is the user's system home directory. The CLI will create a\n `.gemini` folder inside this directory.\n - Useful for shared compute environments or keeping CLI state isolated.\n - Example: `export GEMINI_CLI_HOME=\"/path/to/user/config\"` (Windows\n PowerShell: `$env:GEMINI_CLI_HOME=\"C:\\path\\to\\user\\config\"`)\n- **`GEMINI_CLI_SURFACE`**:\n - Specifies a custom label to include in the `User-Agent` header for API\n traffic reporting.\n - This is useful for tracking specific internal tools or distribution\n channels.\n - Example: `export GEMINI_CLI_SURFACE=\"my-custom-tool\"` (Windows PowerShell:\n `$env:GEMINI_CLI_SURFACE=\"my-custom-tool\"`)\n- **`GOOGLE_API_KEY`**:\n - Your Google Cloud API key.\n - Required for using Vertex AI in express mode.\n - Ensure you have the necessary permissions.\n - Example: `export GOOGLE_API_KEY=\"YOUR_GOOGLE_API_KEY\"` (Windows PowerShell:\n `$env:GOOGLE_API_KEY=\"YOUR_GOOGLE_API_KEY\"`).\n- **`GOOGLE_CLOUD_PROJECT`**:\n - Your Google Cloud Project ID.\n - Required for using Code Assist or Vertex AI.\n - If using Vertex AI, ensure you have the necessary permissions in this\n project.\n - **Cloud Shell note:** When running in a Cloud Shell environment, this\n variable defaults to a special project allocated for Cloud Shell users. If\n you have `GOOGLE_CLOUD_PROJECT` set in your global environment in Cloud\n Shell, it will be overridden by this default. To use a different project in\n Cloud Shell, you must define `GOOGLE_CLOUD_PROJECT` in a `.env` file.\n - Example: `export GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"` (Windows\n PowerShell: `$env:GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"`).\n- **`GOOGLE_APPLICATION_CREDENTIALS`** (string):\n - **Description:** The path to your Google Application Credentials JSON file.\n - **Example:**\n `export GOOGLE_APPLICATION_CREDENTIALS=\"/path/to/your/credentials.json\"`\n (Windows PowerShell:\n `$env:GOOGLE_APPLICATION_CREDENTIALS=\"C:\\path\\to\\your\\credentials.json\"`)\n- **`GOOGLE_GENAI_API_VERSION`**:\n - Specifies the API version to use for Gemini API requests.\n - When set, overrides the default API version used by the SDK.\n - Example: `export GOOGLE_GENAI_API_VERSION=\"v1\"` (Windows PowerShell:\n `$env:GOOGLE_GENAI_API_VERSION=\"v1\"`)\n- **`OTLP_GOOGLE_CLOUD_PROJECT`**:\n - Your Google Cloud Project ID for Telemetry in Google Cloud\n - Example: `export OTLP_GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"` (Windows\n PowerShell: `$env:OTLP_GOOGLE_CLOUD_PROJECT=\"YOUR_PROJECT_ID\"`).\n- **`GEMINI_TELEMETRY_ENABLED`**:\n - Set to `true` or `1` to enable telemetry. Any other value is treated as\n disabling it.\n - Overrides the `telemetry.enabled` setting.\n- **`GEMINI_TELEMETRY_TARGET`**:\n - Sets the telemetry target (`local` or `gcp`).\n - Overrides the `telemetry.target` setting.\n- **`GEMINI_TELEMETRY_OTLP_ENDPOINT`**:\n - Sets the OTLP endpoint for telemetry.\n - Overrides the `telemetry.otlpEndpoint` setting.\n- **`GEMINI_TELEMETRY_OTLP_PROTOCOL`**:\n - Sets the OTLP protocol (`grpc` or `http`).\n - Overrides the `telemetry.otlpProtocol` setting.\n- **`GEMINI_TELEMETRY_LOG_PROMPTS`**:\n - Set to `true` or `1` to enable or disable logging of user prompts. Any other\n value is treated as disabling it.\n - Overrides the `telemetry.logPrompts` setting.\n- **`GEMINI_TELEMETRY_OUTFILE`**:\n - Sets the file path to write telemetry to when the target is `local`.\n - Overrides the `telemetry.outfile` setting.\n- **`GEMINI_TELEMETRY_USE_COLLECTOR`**:\n - Set to `true` or `1` to enable or disable using an external OTLP collector.\n Any other value is treated as disabling it.\n - Overrides the `telemetry.useCollector` setting.\n- **`GOOGLE_CLOUD_LOCATION`**:\n - Your Google Cloud Project Location (e.g., us-central1).\n - Required for using Vertex AI in non-express mode.\n - Example: `export GOOGLE_CLOUD_LOCATION=\"YOUR_PROJECT_LOCATION\"` (Windows\n PowerShell: `$env:GOOGLE_CLOUD_LOCATION=\"YOUR_PROJECT_LOCATION\"`).\n- **`GEMINI_SANDBOX`**:\n - Alternative to the `sandbox` setting in `settings.json`.\n - Accepts `true`, `false`, `docker`, `podman`, or a custom command string.\n- **`GEMINI_SYSTEM_MD`**:\n - Replaces the built‑in system prompt with content from a Markdown file.\n - `true`/`1`: Use project default path `./.gemini/system.md`.\n - Any other string: Treat as a path (relative/absolute supported, `~`\n expands).\n - `false`/`0` or unset: Use the built‑in prompt. See\n [System Prompt Override](/docs/cli/system-prompt).\n- **`GEMINI_WRITE_SYSTEM_MD`**:\n - Writes the current built‑in system prompt to a file for review.\n - `true`/`1`: Write to `./.gemini/system.md`. Otherwise treat the value as a\n path.\n - Run the CLI once with this set to generate the file.\n- **`SEATBELT_PROFILE`** (macOS specific):\n - Switches the Seatbelt (`sandbox-exec`) profile on macOS.\n - `permissive-open`: (Default) Restricts writes to the project folder (and a\n few other folders, see\n `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) but allows other\n operations.\n - `restrictive-open`: Declines operations by default, allows network.\n - `strict-open`: Restricts both reads and writes to the working directory,\n allows network.\n - `strict-proxied`: Same as `strict-open` but routes network through proxy.\n - `\u003cprofile_name>`: Uses a custom profile. To define a custom profile, create\n a file named `sandbox-macos-\u003cprofile_name>.sb` in your project's `.gemini/`\n directory (e.g., `my-project/.gemini/sandbox-macos-custom.sb`).\n- **`DEBUG` or `DEBUG_MODE`** (often used by underlying libraries or the CLI\n itself):\n - Set to `true` or `1` to enable verbose debug logging, which can be helpful\n for troubleshooting.\n - **Note:** These variables are automatically excluded from project `.env`\n files by default to prevent interference with gemini-cli behavior. Use\n `.gemini/.env` files if you need to set these for gemini-cli specifically.\n- **`NO_COLOR`**:\n - Set to any value to disable all color output in the CLI.\n- **`CLI_TITLE`**:\n - Set to a string to customize the title of the CLI.\n- **`CODE_ASSIST_ENDPOINT`**:\n - Specifies the endpoint for the code assist server.\n - This is useful for development and testing.\n\n### Environment variable redaction\n\nTo prevent accidental leakage of sensitive information, Gemini CLI automatically\nredacts potential secrets from environment variables when executing tools (such\nas shell commands). This \"best effort\" redaction applies to variables inherited\nfrom the system or loaded from `.env` files.\n\n**Default Redaction Rules:**\n\n- **By Name:** Variables are redacted if their names contain sensitive terms\n like `TOKEN`, `SECRET`, `PASSWORD`, `KEY`, `AUTH`, `CREDENTIAL`, `PRIVATE`, or\n `CERT`.\n- **By Value:** Variables are redacted if their values match known secret\n patterns, such as:\n - Private keys (RSA, OpenSSH, PGP, etc.)\n - Certificates\n - URLs containing credentials\n - API keys and tokens (GitHub, Google, AWS, Stripe, Slack, etc.)\n- **Specific Blocklist:** Certain variables like `CLIENT_ID`, `DB_URI`,\n `DATABASE_URL`, and `CONNECTION_STRING` are always redacted by default.\n\n**Allowlist (Never Redacted):**\n\n- Common system variables (e.g., `PATH`, `HOME`, `USER`, `SHELL`, `TERM`,\n `LANG`).\n- Variables starting with `GEMINI_CLI_`.\n- GitHub Action specific variables.\n\n**Configuration:**\n\nYou can customize this behavior in your `settings.json` file:\n\n- **`security.allowedEnvironmentVariables`**: A list of variable names to\n _never_ redact, even if they match sensitive patterns.\n- **`security.blockedEnvironmentVariables`**: A list of variable names to\n _always_ redact, even if they don't match sensitive patterns.\n\n```json\n{\n \"security\": {\n \"allowedEnvironmentVariables\": [\"MY_PUBLIC_KEY\", \"NOT_A_SECRET_TOKEN\"],\n \"blockedEnvironmentVariables\": [\"INTERNAL_IP_ADDRESS\"]\n }\n}\n```\n\n## Command-line arguments\n\nArguments passed directly when running the CLI can override other configurations\nfor that specific session.\n\n- **`--model \u003cmodel_name>`** (**`-m \u003cmodel_name>`**):\n - Specifies the Gemini model to use for this session.\n - Example: `npm start -- --model gemini-3-pro-preview`\n- **`--prompt \u003cyour_prompt>`** (**`-p \u003cyour_prompt>`**):\n - **Deprecated:** Use positional arguments instead.\n - Used to pass a prompt directly to the command. This invokes Gemini CLI in a\n non-interactive mode.\n- **`--prompt-interactive \u003cyour_prompt>`** (**`-i \u003cyour_prompt>`**):\n - Starts an interactive session with the provided prompt as the initial input.\n - The prompt is processed within the interactive session, not before it.\n - Cannot be used when piping input from stdin.\n - Example: `gemini -i \"explain this code\"`\n- **`--output-format \u003cformat>`**:\n - **Description:** Specifies the format of the CLI output for non-interactive\n mode.\n - **Values:**\n - `text`: (Default) The standard human-readable output.\n - `json`: A machine-readable JSON output.\n - `stream-json`: A streaming JSON output that emits real-time events.\n - **Note:** For structured output and scripting, use the\n `--output-format json` or `--output-format stream-json` flag.\n- **`--sandbox`** (**`-s`**):\n - Enables sandbox mode for this session.\n- **`--debug`** (**`-d`**):\n - Enables debug mode for this session, providing more verbose output. Open the\n debug console with F12 to see the additional logging.\n\n- **`--help`** (or **`-h`**):\n - Displays help information about command-line arguments.\n- **`--yolo`**:\n - Enables YOLO mode, which automatically approves all tool calls.\n- **`--approval-mode \u003cmode>`**:\n - Sets the approval mode for tool calls. Available modes:\n - `default`: Prompt for approval on each tool call (default behavior)\n - `auto_edit`: Automatically approve edit tools (replace, write_file) while\n prompting for others\n - `yolo`: Automatically approve all tool calls (equivalent to `--yolo`)\n - `plan`: Read-only mode for tool calls (requires experimental planning to\n be enabled).\n > **Note:** This mode is currently under development and not yet fully\n > functional.\n - Cannot be used together with `--yolo`. Use `--approval-mode=yolo` instead of\n `--yolo` for the new unified approach.\n - Example: `gemini --approval-mode auto_edit`\n- **`--allowed-tools \u003ctool1,tool2,...>`**:\n - A comma-separated list of tool names that will bypass the confirmation\n dialog.\n - Example: `gemini --allowed-tools \"ShellTool(git status)\"`\n- **`--extensions \u003cextension_name ...>`** (**`-e \u003cextension_name ...>`**):\n - Specifies a list of extensions to use for the session. If not provided, all\n available extensions are used.\n - Use the special term `gemini -e none` to disable all extensions.\n - Example: `gemini -e my-extension -e my-other-extension`\n- **`--list-extensions`** (**`-l`**):\n - Lists all available extensions and exits.\n- **`--resume [session_id]`** (**`-r [session_id]`**):\n - Resume a previous chat session. Use \"latest\" for the most recent session,\n provide a session index number, or provide a full session UUID.\n - If no session_id is provided, defaults to \"latest\".\n - Example: `gemini --resume 5` or `gemini --resume latest` or\n `gemini --resume a1b2c3d4-e5f6-7890-abcd-ef1234567890` or `gemini --resume`\n - See [Session Management](/docs/cli/session-management) for more details.\n- **`--list-sessions`**:\n - List all available chat sessions for the current project and exit.\n - Shows session indices, dates, message counts, and preview of first user\n message.\n - Example: `gemini --list-sessions`\n- **`--delete-session \u003cidentifier>`**:\n - Delete a specific chat session by its index number or full session UUID.\n - Use `--list-sessions` first to see available sessions, their indices, and\n UUIDs.\n - Example: `gemini --delete-session 3` or\n `gemini --delete-session a1b2c3d4-e5f6-7890-abcd-ef1234567890`\n- **`--include-directories \u003cdir1,dir2,...>`**:\n - Includes additional directories in the workspace for multi-directory\n support.\n - Can be specified multiple times or as comma-separated values.\n - 5 directories can be added at maximum.\n - Example: `--include-directories /path/to/project1,/path/to/project2` or\n `--include-directories /path/to/project1 --include-directories /path/to/project2`\n- **`--screen-reader`**:\n - Enables screen reader mode, which adjusts the TUI for better compatibility\n with screen readers.\n- **`--version`**:\n - Displays the version of the CLI.\n- **`--experimental-acp`**:\n - Starts the agent in ACP mode.\n- **`--allowed-mcp-server-names`**:\n - Allowed MCP server names.\n- **`--fake-responses`**:\n - Path to a file with fake model responses for testing.\n- **`--record-responses`**:\n - Path to a file to record model responses for testing.\n\n## Context files (hierarchical instructional context)\n\nWhile not strictly configuration for the CLI's _behavior_, context files\n(defaulting to `GEMINI.md` but configurable via the `context.fileName` setting)\nare crucial for configuring the _instructional context_ (also referred to as\n\"memory\") provided to the Gemini model. This powerful feature allows you to give\nproject-specific instructions, coding style guides, or any relevant background\ninformation to the AI, making its responses more tailored and accurate to your\nneeds. The CLI includes UI elements, such as an indicator in the footer showing\nthe number of loaded context files, to keep you informed about the active\ncontext.\n\n- **Purpose:** These Markdown files contain instructions, guidelines, or context\n that you want the Gemini model to be aware of during your interactions. The\n system is designed to manage this instructional context hierarchically.\n\n### Example context file content (e.g., `GEMINI.md`)\n\nHere's a conceptual example of what a context file at the root of a TypeScript\nproject might contain:\n\n```markdown\n# Project: My Awesome TypeScript Library\n\n## General Instructions:\n\n- When generating new TypeScript code, please follow the existing coding style.\n- Ensure all new functions and classes have JSDoc comments.\n- Prefer functional programming paradigms where appropriate.\n- All code should be compatible with TypeScript 5.0 and Node.js 20+.\n\n## Coding Style:\n\n- Use 2 spaces for indentation.\n- Interface names should be prefixed with `I` (e.g., `IUserService`).\n- Private class members should be prefixed with an underscore (`_`).\n- Always use strict equality (`===` and `!==`).\n\n## Specific Component: `src/api/client.ts`\n\n- This file handles all outbound API requests.\n- When adding new API call functions, ensure they include robust error handling\n and logging.\n- Use the existing `fetchWithRetry` utility for all GET requests.\n\n## Regarding Dependencies:\n\n- Avoid introducing new external dependencies unless absolutely necessary.\n- If a new dependency is required, please state the reason.\n```\n\nThis example demonstrates how you can provide general project context, specific\ncoding conventions, and even notes about particular files or components. The\nmore relevant and precise your context files are, the better the AI can assist\nyou. Project-specific context files are highly encouraged to establish\nconventions and context.\n\n- **Hierarchical loading and precedence:** The CLI implements a sophisticated\n hierarchical memory system by loading context files (e.g., `GEMINI.md`) from\n several locations. Content from files lower in this list (more specific)\n typically overrides or supplements content from files higher up (more\n general). The exact concatenation order and final context can be inspected\n using the `/memory show` command. The typical loading order is:\n 1. **Global context file:**\n - Location: `~/.gemini/\u003cconfigured-context-filename>` (e.g.,\n `~/.gemini/GEMINI.md` in your user home directory).\n - Scope: Provides default instructions for all your projects.\n 2. **Project root and ancestors context files:**\n - Location: The CLI searches for the configured context file in the\n current working directory and then in each parent directory up to either\n the project root (identified by a `.git` folder) or your home directory.\n - Scope: Provides context relevant to the entire project or a significant\n portion of it.\n 3. **Sub-directory context files (contextual/local):**\n - Location: The CLI also scans for the configured context file in\n subdirectories _below_ the current working directory (respecting common\n ignore patterns like `node_modules`, `.git`, etc.). The breadth of this\n search is limited to 200 directories by default, but can be configured\n with the `context.discoveryMaxDirs` setting in your `settings.json`\n file.\n - Scope: Allows for highly specific instructions relevant to a particular\n component, module, or subsection of your project.\n- **Concatenation and UI indication:** The contents of all found context files\n are concatenated (with separators indicating their origin and path) and\n provided as part of the system prompt to the Gemini model. The CLI footer\n displays the count of loaded context files, giving you a quick visual cue\n about the active instructional context.\n- **Importing content:** You can modularize your context files by importing\n other Markdown files using the `@path/to/file.md` syntax. For more details,\n see the [Memory Import Processor documentation](/docs/reference/memport).\n- **Commands for memory management:**\n - Use `/memory refresh` to force a re-scan and reload of all context files\n from all configured locations. This updates the AI's instructional context.\n - Use `/memory show` to display the combined instructional context currently\n loaded, allowing you to verify the hierarchy and content being used by the\n AI.\n - See the [Commands documentation](/docs/reference/commands#memory) for full details on\n the `/memory` command and its sub-commands (`show` and `reload`).\n\nBy understanding and utilizing these configuration layers and the hierarchical\nnature of context files, you can effectively manage the AI's memory and tailor\nthe Gemini CLI's responses to your specific needs and projects.\n\n## Sandboxing\n\nThe Gemini CLI can execute potentially unsafe operations (like shell commands\nand file modifications) within a sandboxed environment to protect your system.\n\nSandboxing is disabled by default, but you can enable it in a few ways:\n\n- Using `--sandbox` or `-s` flag.\n- Setting `GEMINI_SANDBOX` environment variable.\n- Sandbox is enabled when using `--yolo` or `--approval-mode=yolo` by default.\n\nBy default, it uses a pre-built `gemini-cli-sandbox` Docker image.\n\nFor project-specific sandboxing needs, you can create a custom Dockerfile at\n`.gemini/sandbox.Dockerfile` in your project's root directory. This Dockerfile\ncan be based on the base sandbox image:\n\n```dockerfile\nFROM gemini-cli-sandbox\n\n# Add your custom dependencies or configurations here\n# For example:\n# RUN apt-get update && apt-get install -y some-package\n# COPY ./my-config /app/my-config\n```\n\nWhen `.gemini/sandbox.Dockerfile` exists, you can use `BUILD_SANDBOX`\nenvironment variable when running Gemini CLI to automatically build the custom\nsandbox image:\n\n```bash\nBUILD_SANDBOX=1 gemini -s\n```\n\n## Usage statistics\n\nTo help us improve the Gemini CLI, we collect anonymized usage statistics. This\ndata helps us understand how the CLI is used, identify common issues, and\nprioritize new features.\n\n**What we collect:**\n\n- **Tool calls:** We log the names of the tools that are called, whether they\n succeed or fail, and how long they take to execute. We do not collect the\n arguments passed to the tools or any data returned by them.\n- **API requests:** We log the Gemini model used for each request, the duration\n of the request, and whether it was successful. We do not collect the content\n of the prompts or responses.\n- **Session information:** We collect information about the configuration of the\n CLI, such as the enabled tools and the approval mode.\n\n**What we DON'T collect:**\n\n- **Personally identifiable information (PII):** We do not collect any personal\n information, such as your name, email address, or API keys.\n- **Prompt and response content:** We do not log the content of your prompts or\n the responses from the Gemini model.\n- **File content:** We do not log the content of any files that are read or\n written by the CLI.\n\n**How to opt out:**\n\nYou can opt out of usage statistics collection at any time by setting the\n`usageStatisticsEnabled` property to `false` under the `privacy` category in\nyour `settings.json` file:\n\n```json\n{\n \"privacy\": {\n \"usageStatisticsEnabled\": false\n }\n}\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":83551,"content_sha256":"9b131824d0d77cda38ebdf7a555e6ee75a241b5f2af116154d4510fc6576a1d1"},{"filename":"canonical/geminicli-com/docs/reference/keyboard-shortcuts.md","content":"---\nsource_url: http://geminicli.com/docs/reference/keyboard-shortcuts\nsource_type: llms-txt\ncontent_hash: sha256:c287024f59d69ed9426eb127f97b12848d58592cfc9e18883e352fc034bd4087\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"f7ce3c3b7e4ac8579185df61e594f570a0f29eaa471721d339cd3d1ed927c663\"'\nlast_modified: '2026-03-16T19:53:24Z'\n---\n\n# Gemini CLI keyboard shortcuts\n\nGemini CLI ships with a set of default keyboard shortcuts for editing input,\nnavigating history, and controlling the UI. Use this reference to learn the\navailable combinations.\n\n\u003c!-- KEYBINDINGS-AUTOGEN:START -->\n\n#### Basic Controls\n\n| Command | Action | Keys |\n| --------------- | --------------------------------------------------------------- | ------------------- |\n| `basic.confirm` | Confirm the current selection or choice. | `Enter` |\n| `basic.cancel` | Dismiss dialogs or cancel the current focus. | `Esc`\u003cbr />`Ctrl+[` |\n| `basic.quit` | Cancel the current request or quit the CLI when input is empty. | `Ctrl+C` |\n| `basic.exit` | Exit the CLI when the input buffer is empty. | `Ctrl+D` |\n\n#### Cursor Movement\n\n| Command | Action | Keys |\n| ------------------ | ------------------------------------------- | ------------------------------------------ |\n| `cursor.home` | Move the cursor to the start of the line. | `Ctrl+A`\u003cbr />`Home` |\n| `cursor.end` | Move the cursor to the end of the line. | `Ctrl+E`\u003cbr />`End` |\n| `cursor.up` | Move the cursor up one line. | `Up` |\n| `cursor.down` | Move the cursor down one line. | `Down` |\n| `cursor.left` | Move the cursor one character to the left. | `Left` |\n| `cursor.right` | Move the cursor one character to the right. | `Right`\u003cbr />`Ctrl+F` |\n| `cursor.wordLeft` | Move the cursor one word to the left. | `Ctrl+Left`\u003cbr />`Alt+Left`\u003cbr />`Alt+B` |\n| `cursor.wordRight` | Move the cursor one word to the right. | `Ctrl+Right`\u003cbr />`Alt+Right`\u003cbr />`Alt+F` |\n\n#### Editing\n\n| Command | Action | Keys |\n| ---------------------- | ------------------------------------------------ | -------------------------------------------------------- |\n| `edit.deleteRightAll` | Delete from the cursor to the end of the line. | `Ctrl+K` |\n| `edit.deleteLeftAll` | Delete from the cursor to the start of the line. | `Ctrl+U` |\n| `edit.clear` | Clear all text in the input field. | `Ctrl+C` |\n| `edit.deleteWordLeft` | Delete the previous word. | `Ctrl+Backspace`\u003cbr />`Alt+Backspace`\u003cbr />`Ctrl+W` |\n| `edit.deleteWordRight` | Delete the next word. | `Ctrl+Delete`\u003cbr />`Alt+Delete`\u003cbr />`Alt+D` |\n| `edit.deleteLeft` | Delete the character to the left. | `Backspace`\u003cbr />`Ctrl+H` |\n| `edit.deleteRight` | Delete the character to the right. | `Delete`\u003cbr />`Ctrl+D` |\n| `edit.undo` | Undo the most recent text edit. | `Cmd/Win+Z`\u003cbr />`Alt+Z` |\n| `edit.redo` | Redo the most recent undone text edit. | `Ctrl+Shift+Z`\u003cbr />`Shift+Cmd/Win+Z`\u003cbr />`Alt+Shift+Z` |\n\n#### Scrolling\n\n| Command | Action | Keys |\n| ----------------- | ------------------------ | ----------------------------- |\n| `scroll.up` | Scroll content up. | `Shift+Up` |\n| `scroll.down` | Scroll content down. | `Shift+Down` |\n| `scroll.home` | Scroll to the top. | `Ctrl+Home`\u003cbr />`Shift+Home` |\n| `scroll.end` | Scroll to the bottom. | `Ctrl+End`\u003cbr />`Shift+End` |\n| `scroll.pageUp` | Scroll up by one page. | `Page Up` |\n| `scroll.pageDown` | Scroll down by one page. | `Page Down` |\n\n#### History & Search\n\n| Command | Action | Keys |\n| ----------------------- | -------------------------------------------- | -------- |\n| `history.previous` | Show the previous entry in history. | `Ctrl+P` |\n| `history.next` | Show the next entry in history. | `Ctrl+N` |\n| `history.search.start` | Start reverse search through history. | `Ctrl+R` |\n| `history.search.submit` | Submit the selected reverse-search match. | `Enter` |\n| `history.search.accept` | Accept a suggestion while reverse searching. | `Tab` |\n\n#### Navigation\n\n| Command | Action | Keys |\n| --------------------- | -------------------------------------------------- | --------------- |\n| `nav.up` | Move selection up in lists. | `Up` |\n| `nav.down` | Move selection down in lists. | `Down` |\n| `nav.dialog.up` | Move up within dialog options. | `Up`\u003cbr />`K` |\n| `nav.dialog.down` | Move down within dialog options. | `Down`\u003cbr />`J` |\n| `nav.dialog.next` | Move to the next item or question in a dialog. | `Tab` |\n| `nav.dialog.previous` | Move to the previous item or question in a dialog. | `Shift+Tab` |\n\n#### Suggestions & Completions\n\n| Command | Action | Keys |\n| ----------------------- | --------------------------------------- | -------------------- |\n| `suggest.accept` | Accept the inline suggestion. | `Tab`\u003cbr />`Enter` |\n| `suggest.focusPrevious` | Move to the previous completion option. | `Up`\u003cbr />`Ctrl+P` |\n| `suggest.focusNext` | Move to the next completion option. | `Down`\u003cbr />`Ctrl+N` |\n| `suggest.expand` | Expand an inline suggestion. | `Right` |\n| `suggest.collapse` | Collapse an inline suggestion. | `Left` |\n\n#### Text Input\n\n| Command | Action | Keys |\n| -------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------- |\n| `input.submit` | Submit the current prompt. | `Enter` |\n| `input.newline` | Insert a newline without submitting. | `Ctrl+Enter`\u003cbr />`Cmd/Win+Enter`\u003cbr />`Alt+Enter`\u003cbr />`Shift+Enter`\u003cbr />`Ctrl+J` |\n| `input.openExternalEditor` | Open the current prompt or the plan in an external editor. | `Ctrl+X` |\n| `input.paste` | Paste from the clipboard. | `Ctrl+V`\u003cbr />`Cmd/Win+V`\u003cbr />`Alt+V` |\n\n#### App Controls\n\n| Command | Action | Keys |\n| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |\n| `app.showErrorDetails` | Toggle detailed error information. | `F12` |\n| `app.showFullTodos` | Toggle the full TODO list. | `Ctrl+T` |\n| `app.showIdeContextDetail` | Show IDE context details. | `Ctrl+G` |\n| `app.toggleMarkdown` | Toggle Markdown rendering. | `Alt+M` |\n| `app.toggleCopyMode` | Toggle copy mode when in alternate buffer mode. | `Ctrl+S` |\n| `app.toggleYolo` | Toggle YOLO (auto-approval) mode for tool calls. | `Ctrl+Y` |\n| `app.cycleApprovalMode` | Cycle through approval modes: default (prompt), auto_edit (auto-approve edits), and plan (read-only). Plan mode is skipped when the agent is busy. | `Shift+Tab` |\n| `app.showMoreLines` | Expand and collapse blocks of content when not in alternate buffer mode. | `Ctrl+O` |\n| `app.expandPaste` | Expand or collapse a paste placeholder when cursor is over placeholder. | `Ctrl+O` |\n| `app.focusShellInput` | Move focus from Gemini to the active shell. | `Tab` |\n| `app.unfocusShellInput` | Move focus from the shell back to Gemini. | `Shift+Tab` |\n| `app.clearScreen` | Clear the terminal screen and redraw the UI. | `Ctrl+L` |\n| `app.restart` | Restart the application. | `R`\u003cbr />`Shift+R` |\n| `app.suspend` | Suspend the CLI and move it to the background. | `Ctrl+Z` |\n| `app.showShellUnfocusWarning` | Show warning when trying to move focus away from shell input. | `Tab` |\n\n#### Background Shell Controls\n\n| Command | Action | Keys |\n| --------------------------- | ------------------------------------------------------------------ | ----------- |\n| `background.escape` | Dismiss background shell list. | `Esc` |\n| `background.select` | Confirm selection in background shell list. | `Enter` |\n| `background.toggle` | Toggle current background shell visibility. | `Ctrl+B` |\n| `background.toggleList` | Toggle background shell list. | `Ctrl+L` |\n| `background.kill` | Kill the active background shell. | `Ctrl+K` |\n| `background.unfocus` | Move focus from background shell to Gemini. | `Shift+Tab` |\n| `background.unfocusList` | Move focus from background shell list to Gemini. | `Tab` |\n| `background.unfocusWarning` | Show warning when trying to move focus away from background shell. | `Tab` |\n\n\u003c!-- KEYBINDINGS-AUTOGEN:END -->\n\n## Customizing Keybindings\n\nYou can add alternative keybindings or remove default keybindings by creating a\n`keybindings.json` file in your home gemini directory (typically\n`~/.gemini/keybindings.json`).\n\n### Configuration Format\n\nThe configuration uses a JSON array of objects, similar to VS Code's keybinding\nschema. Each object must specify a `command` from the reference tables above and\na `key` combination.\n\n```json\n[\n {\n \"command\": \"edit.clear\",\n \"key\": \"cmd+l\"\n },\n {\n // prefix \"-\" to unbind a key\n \"command\": \"-app.toggleYolo\",\n \"key\": \"ctrl+y\"\n },\n {\n \"command\": \"input.submit\",\n \"key\": \"ctrl+y\"\n },\n {\n // multiple modifiers\n \"command\": \"cursor.right\",\n \"key\": \"shift+alt+a\"\n },\n {\n // Some mac keyboards send \"Å\" instead of \"shift+option+a\"\n \"command\": \"cursor.right\",\n \"key\": \"Å\"\n },\n {\n // some base keys have special multi-char names\n \"command\": \"cursor.right\",\n \"key\": \"shift+pageup\"\n }\n]\n```\n\n- **Unbinding** To remove an existing or default keybinding, prefix a minus sign\n (`-`) to the `command` name.\n- **No Auto-unbinding** The same key can be bound to multiple commands in\n different contexts at the same time. Therefore, creating a binding does not\n automatically unbind the key from other commands.\n- **Explicit Modifiers**: Key matching is explicit. For example, a binding for\n `ctrl+f` will only trigger on exactly `ctrl+f`, not `ctrl+shift+f` or\n `alt+ctrl+f`.\n- **Literal Characters**: Terminals often translate complex key combinations\n (especially on macOS with the `Option` key) into special characters, losing\n modifier and keystroke information along the way. For example,`shift+5` might\n be sent as `%`. In these cases, you must bind to the literal character `%` as\n bindings to `shift+5` will never fire. To see precisely what is being sent,\n enable `Debug Keystroke Logging` and hit f12 to open the debug log console.\n- **Key Modifiers**: The supported key modifiers are:\n - `ctrl`\n - `shift`,\n - `alt` (synonyms: `opt`, `option`)\n - `cmd` (synonym: `meta`)\n- **Base Key**: The base key can be any single unicode code point or any of the\n following special keys:\n - **Navigation**: `up`, `down`, `left`, `right`, `home`, `end`, `pageup`,\n `pagedown`\n - **Actions**: `enter`, `escape`, `tab`, `space`, `backspace`, `delete`,\n `clear`, `insert`, `printscreen`\n - **Toggles**: `capslock`, `numlock`, `scrolllock`, `pausebreak`\n - **Function Keys**: `f1` through `f35`\n - **Numpad**: `numpad0` through `numpad9`, `numpad_add`, `numpad_subtract`,\n `numpad_multiply`, `numpad_divide`, `numpad_decimal`, `numpad_separator`\n\n## Additional context-specific shortcuts\n\n- `Option+B/F/M` (macOS only): Are interpreted as `Cmd+B/F/M` even if your\n terminal isn't configured to send Meta with Option.\n- `!` on an empty prompt: Enter or exit shell mode.\n- `?` on an empty prompt: Toggle the shortcuts panel above the input. Press\n `Esc`, `Backspace`, any printable key, or a registered app hotkey to close it.\n The panel also auto-hides while the agent is running/streaming or when\n action-required dialogs are shown. Press `?` again to close the panel and\n insert a `?` into the prompt.\n- `Tab` + `Tab` (while typing in the prompt): Toggle between minimal and full UI\n details when no completion/search interaction is active. The selected mode is\n remembered for future sessions. Full UI remains the default on first run, and\n single `Tab` keeps its existing completion/focus behavior.\n- `Shift + Tab` (while typing in the prompt): Cycle approval modes: default,\n auto-edit, and plan (skipped when agent is busy).\n- `\\` (at end of a line) + `Enter`: Insert a newline without leaving single-line\n mode.\n- `Esc` pressed twice quickly: Clear the input prompt if it is not empty,\n otherwise browse and rewind previous interactions.\n- `Up Arrow` / `Down Arrow`: When the cursor is at the top or bottom of a\n single-line input, navigate backward or forward through prompt history.\n- `Number keys (1-9, multi-digit)` inside selection dialogs: Jump directly to\n the numbered radio option and confirm when the full number is entered.\n- `Ctrl + O`: Expand or collapse paste placeholders (`[Pasted Text: X lines]`)\n inline when the cursor is over the placeholder.\n- `Ctrl + X` (while a plan is presented): Open the plan in an external editor to\n [collaboratively edit or comment](/docs/cli/plan-mode#collaborative-plan-editing)\n on the implementation strategy.\n- `Double-click` on a paste placeholder (alternate buffer mode only): Expand to\n view full content inline. Double-click again to collapse.\n\n## Limitations\n\n- On [Windows Terminal](https://en.wikipedia.org/wiki/Windows_Terminal):\n - `shift+enter` is only supported in version 1.25 and higher.\n - `shift+tab`\n [is not supported](https://github.com/google-gemini/gemini-cli/issues/20314)\n on Node 20 and earlier versions of Node 22.\n- On macOS's [Terminal](\u003chttps://en.wikipedia.org/wiki/Terminal_(macOS)>):\n - `shift+enter` is not supported.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":17556,"content_sha256":"e0345b6b643d42a12b439f40c7a7e62c372e8c2b1efbc53a6f61d38474f25f4d"},{"filename":"canonical/geminicli-com/docs/reference/memport.md","content":"---\nsource_url: http://geminicli.com/docs/reference/memport\nsource_type: llms-txt\ncontent_hash: sha256:d090fa9a2bd8a1f539672670bd93d8e40237c5b47eca1557fd1191c4d4d33234\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"3ef98389698d315a63c7cf45f276595840a6065dcb9ce6b2fefaa03c3499c0ff\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Memory Import Processor\n\nThe Memory Import Processor is a feature that allows you to modularize your\nGEMINI.md files by importing content from other files using the `@file.md`\nsyntax.\n\n## Overview\n\nThis feature enables you to break down large GEMINI.md files into smaller, more\nmanageable components that can be reused across different contexts. The import\nprocessor supports both relative and absolute paths, with built-in safety\nfeatures to prevent circular imports and ensure file access security.\n\n## Syntax\n\nUse the `@` symbol followed by the path to the file you want to import:\n\n```markdown\n# Main GEMINI.md file\n\nThis is the main content.\n\n@./components/instructions.md\n\nMore content here.\n\n@./shared/configuration.md\n```\n\n## Supported path formats\n\n### Relative paths\n\n- `@./file.md` - Import from the same directory\n- `@../file.md` - Import from parent directory\n- `@./components/file.md` - Import from subdirectory\n\n### Absolute paths\n\n- `@/absolute/path/to/file.md` - Import using absolute path\n\n## Examples\n\n### Basic import\n\n```markdown\n# My GEMINI.md\n\nWelcome to my project!\n\n@./get-started.md\n\n## Features\n\n@./features/overview.md\n```\n\n### Nested imports\n\nThe imported files can themselves contain imports, creating a nested structure:\n\n```markdown\n# main.md\n\n@./header.md @./content.md @./footer.md\n```\n\n```markdown\n# header.md\n\n# Project Header\n\n@./shared/title.md\n```\n\n## Safety features\n\n### Circular import detection\n\nThe processor automatically detects and prevents circular imports:\n\n```markdown\n# file-a.md\n\n@./file-b.md\n```\n\n```markdown\n# file-b.md\n\n@./file-a.md \u003c!-- This will be detected and prevented -->\n```\n\n### File access security\n\nThe `validateImportPath` function ensures that imports are only allowed from\nspecified directories, preventing access to sensitive files outside the allowed\nscope.\n\n### Maximum import depth\n\nTo prevent infinite recursion, there's a configurable maximum import depth\n(default: 5 levels).\n\n## Error handling\n\n### Missing files\n\nIf a referenced file doesn't exist, the import will fail gracefully with an\nerror comment in the output.\n\n### File access errors\n\nPermission issues or other file system errors are handled gracefully with\nappropriate error messages.\n\n## Code region detection\n\nThe import processor uses the `marked` library to detect code blocks and inline\ncode spans, ensuring that `@` imports inside these regions are properly ignored.\nThis provides robust handling of nested code blocks and complex Markdown\nstructures.\n\n## Import tree structure\n\nThe processor returns an import tree that shows the hierarchy of imported files,\nsimilar to Claude's `/memory` feature. This helps users debug problems with\ntheir GEMINI.md files by showing which files were read and their import\nrelationships.\n\nExample tree structure:\n\n```\nMemory Files\n L project: GEMINI.md\n L a.md\n L b.md\n L c.md\n L d.md\n L e.md\n L f.md\n L included.md\n```\n\nThe tree preserves the order that files were imported and shows the complete\nimport chain for debugging purposes.\n\n## Comparison to Claude Code's `/memory` (`claude.md`) approach\n\nClaude Code's `/memory` feature (as seen in `claude.md`) produces a flat, linear\ndocument by concatenating all included files, always marking file boundaries\nwith clear comments and path names. It does not explicitly present the import\nhierarchy, but the LLM receives all file contents and paths, which is sufficient\nfor reconstructing the hierarchy if needed.\n\n> [!NOTE] The import tree is mainly for clarity during development and has\n> limited relevance to LLM consumption.\n\n## API reference\n\n### `processImports(content, basePath, debugMode?, importState?)`\n\nProcesses import statements in GEMINI.md content.\n\n**Parameters:**\n\n- `content` (string): The content to process for imports\n- `basePath` (string): The directory path where the current file is located\n- `debugMode` (boolean, optional): Whether to enable debug logging (default:\n false)\n- `importState` (ImportState, optional): State tracking for circular import\n prevention\n\n**Returns:** Promise<ProcessImportsResult> - Object containing processed\ncontent and import tree\n\n### `ProcessImportsResult`\n\n```typescript\ninterface ProcessImportsResult {\n content: string; // The processed content with imports resolved\n importTree: MemoryFile; // Tree structure showing the import hierarchy\n}\n```\n\n### `MemoryFile`\n\n```typescript\ninterface MemoryFile {\n path: string; // The file path\n imports?: MemoryFile[]; // Direct imports, in the order they were imported\n}\n```\n\n### `validateImportPath(importPath, basePath, allowedDirectories)`\n\nValidates import paths to ensure they are safe and within allowed directories.\n\n**Parameters:**\n\n- `importPath` (string): The import path to validate\n- `basePath` (string): The base directory for resolving relative paths\n- `allowedDirectories` (string[]): Array of allowed directory paths\n\n**Returns:** boolean - Whether the import path is valid\n\n### `findProjectRoot(startDir)`\n\nFinds the project root by searching for a `.git` directory upwards from the\ngiven start directory. Implemented as an **async** function using non-blocking\nfile system APIs to avoid blocking the Node.js event loop.\n\n**Parameters:**\n\n- `startDir` (string): The directory to start searching from\n\n**Returns:** Promise<string> - The project root directory (or the start\ndirectory if no `.git` is found)\n\n## Best Practices\n\n1. **Use descriptive file names** for imported components\n2. **Keep imports shallow** - avoid deeply nested import chains\n3. **Document your structure** - maintain a clear hierarchy of imported files\n4. **Test your imports** - ensure all referenced files exist and are accessible\n5. **Use relative paths** when possible for better portability\n\n## Troubleshooting\n\n### Common issues\n\n1. **Import not working**: Check that the file exists and the path is correct\n2. **Circular import warnings**: Review your import structure for circular\n references\n3. **Permission errors**: Ensure the files are readable and within allowed\n directories\n4. **Path resolution issues**: Use absolute paths if relative paths aren't\n resolving correctly\n\n### Debug mode\n\nEnable debug mode to see detailed logging of the import process:\n\n```typescript\nconst result = await processImports(content, basePath, true);\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":6740,"content_sha256":"250616afab74e4bc6cd374828f0d1f7357d9fb440cf9b2dfe241750f5a41e60c"},{"filename":"canonical/geminicli-com/docs/release-confidence.md","content":"---\nsource_url: http://geminicli.com/docs/release-confidence\nsource_type: llms-txt\ncontent_hash: sha256:26fca33f35e05cac4f228a19255e9e39d25205fd8f8082d9006cb340066d256f\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"d42f6d6e24d70649b4373095a2a168998142fa0392e3aa7e5b5597035c9ec548\"'\nlast_modified: '2026-03-22T19:06:33Z'\n---\n\n# Release confidence strategy\n\nThis document outlines the strategy for gaining confidence in every release of\nthe Gemini CLI. It serves as a checklist and quality gate for release manager to\nensure we are shipping a high-quality product.\n\n## The goal\n\nTo answer the question, \"Is this release _truly_ ready for our users?\" with a\nhigh degree of confidence, based on a holistic evaluation of automated signals,\nmanual verification, and data.\n\n## Level 1: Automated gates (must pass)\n\nThese are the baseline requirements. If any of these fail, the release is a\nno-go.\n\n### 1. CI/CD health\n\nAll workflows in `.github/workflows/ci.yml` must pass on the `main` branch (for\nnightly) or the release branch (for preview/stable).\n\n- **Platforms:** Tests must pass on **Linux and macOS**.\n\n\u003c!-- prettier-ignore -->\n> [!NOTE]\n> Windows tests currently run with `continue-on-error: true`. While a\n> failure here doesn't block the release technically, it should be\n> investigated.\n\n- **Checks:**\n - **Linting:** No linting errors (ESLint, Prettier, etc.).\n - **Typechecking:** No TypeScript errors.\n - **Unit Tests:** All unit tests in `packages/core` and `packages/cli` must\n pass.\n - **Build:** The project must build and bundle successfully.\n\n### 2. End-to-end (E2E) tests\n\nAll workflows in `.github/workflows/chained_e2e.yml` must pass.\n\n- **Platforms:** **Linux, macOS and Windows**.\n- **Sandboxing:** Tests must pass with both `sandbox:none` and `sandbox:docker`\n on Linux.\n\n### 3. Post-deployment smoke tests\n\nAfter a release is published to npm, the `smoke-test.yml` workflow runs. This\nmust pass to confirm the package is installable and the binary is executable.\n\n- **Command:** `npx -y @google/gemini-cli@\u003ctag> --version` must return the\n correct version without error.\n- **Platform:** Currently runs on `ubuntu-latest`.\n\n## Level 2: Manual verification and dogfooding\n\nAutomated tests cannot catch everything, especially UX issues.\n\n### 1. Dogfooding via `preview` tag\n\nThe weekly release cadence promotes code from `main` -> `nightly` -> `preview`\n-> `stable`.\n\n- **Requirement:** The `preview` release must be used by maintainers for at\n least **one week** before being promoted to `stable`.\n- **Action:** Maintainers should install the preview version locally:\n ```bash\n npm install -g @google/gemini-cli@preview\n ```\n- **Goal:** To catch regressions and UX issues in day-to-day usage before they\n reach the broad user base.\n\n### 2. Critical user journey (CUJ) checklist\n\nBefore promoting a `preview` release to `stable`, a release manager must\nmanually run through this checklist.\n\n- **Setup:**\n - [ ] Uninstall any existing global version:\n `npm uninstall -g @google/gemini-cli`\n - [ ] Clear npx cache (optional but recommended): `npm cache clean --force`\n - [ ] Install the preview version: `npm install -g @google/gemini-cli@preview`\n - [ ] Verify version: `gemini --version`\n\n- **Authentication:**\n - [ ] In interactive mode run `/auth` and verify all sign in flows work:\n - [ ] Sign in with Google\n - [ ] API Key\n - [ ] Vertex AI\n\n- **Basic prompting:**\n - [ ] Run `gemini \"Tell me a joke\"` and verify a sensible response.\n - [ ] Run in interactive mode: `gemini`. Ask a follow-up question to test\n context.\n\n- **Piped input:**\n - [ ] Run `echo \"Summarize this\" | gemini` and verify it processes stdin.\n\n- **Context management:**\n - [ ] In interactive mode, use `@file` to add a local file to context. Ask a\n question about it.\n\n- **Settings:**\n - [ ] In interactive mode run `/settings` and make modifications\n - [ ] Validate that setting is changed\n\n- **Function calling:**\n - [ ] In interactive mode, ask gemini to \"create a file named hello.md with\n the content 'hello world'\" and verify the file is created correctly.\n\nIf any of these CUJs fail, the release is a no-go until a patch is applied to\nthe `preview` channel.\n\n### 3. Pre-Launch bug bash (tier 1 and 2 launches)\n\nFor high-impact releases, an organized bug bash is required to ensure a higher\nlevel of quality and to catch issues across a wider range of environments and\nuse cases.\n\n**Definition of tiers:**\n\n- **Tier 1:** Industry-Moving News 🚀\n- **Tier 2:** Important News for Our Users 📣\n- **Tier 3:** Relevant, but Not Life-Changing 💡\n- **Tier 4:** Bug Fixes ⚒️\n\n**Requirement:**\n\nA bug bash must be scheduled at least **72 hours in advance** of any Tier 1 or\nTier 2 launch.\n\n**Rule of thumb:**\n\nA bug bash should be considered for any release that involves:\n\n- A blog post\n- Coordinated social media announcements\n- Media relations or press outreach\n- A \"Turbo\" launch event\n\n## Level 3: Telemetry and data review\n\n### Dashboard health\n\n- [ ] Go to `go/gemini-cli-dash`.\n- [ ] Navigate to the \"Tool Call\" tab.\n- [ ] Validate that there are no spikes in errors for the release you would like\n to promote.\n\n### Model evaluation\n\n- [ ] Navigate to `go/gemini-cli-offline-evals-dash`.\n- [ ] Make sure that the release you want to promote's recurring run is within\n average eval runs.\n\n## The \"go/no-go\" decision\n\nBefore triggering the `Release: Promote` workflow to move `preview` to `stable`:\n\n1. [ ] **Level 1:** CI and E2E workflows are green for the commit corresponding\n to the current `preview` tag.\n2. [ ] **Level 2:** The `preview` version has been out for one week, and the\n CUJ checklist has been completed successfully by a release manager. No\n blocking issues have been reported.\n3. [ ] **Level 3:** Dashboard Health and Model Evaluation checks have been\n completed and show no regressions.\n\nIf all checks pass, proceed with the promotion.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":5996,"content_sha256":"93c77a7c80218840e4f747ad4813bdc8fb9e32f1cd3365a03b399a5752c0f4eb"},{"filename":"canonical/geminicli-com/docs/resources/uninstall.md","content":"---\nsource_url: http://geminicli.com/docs/resources/uninstall\nsource_type: llms-txt\ncontent_hash: sha256:641de549c37d54384ef2a401f9500db6703b71958fe47ec3e2ae7c53e53212c7\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"2b78352dc58f952515f2f9a49e647acabef461a0d5d00dd2ac583ea37ae2fb9e\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Uninstalling the CLI\n\nYour uninstall method depends on how you ran the CLI. Follow the instructions\nfor either npx or a global npm installation.\n\n## Method 1: Using npx\n\nnpx runs packages from a temporary cache without a permanent installation. To\n\"uninstall\" the CLI, you must clear this cache, which will remove gemini-cli and\nany other packages previously executed with npx.\n\nThe npx cache is a directory named `_npx` inside your main npm cache folder. You\ncan find your npm cache path by running `npm config get cache`.\n\n**For macOS / Linux**\n\n```bash\n# The path is typically ~/.npm/_npx\nrm -rf \"$(npm config get cache)/_npx\"\n```\n\n**For Windows (PowerShell)**\n\n```powershell\n# The path is typically $env:LocalAppData\\npm-cache\\_npx\nRemove-Item -Path (Join-Path $env:LocalAppData \"npm-cache\\_npx\") -Recurse -Force\n```\n\n## Method 2: Using npm (global install)\n\nIf you installed the CLI globally (e.g., `npm install -g @google/gemini-cli`),\nuse the `npm uninstall` command with the `-g` flag to remove it.\n\n```bash\nnpm uninstall -g @google/gemini-cli\n```\n\nThis command completely removes the package from your system.\n\n## Method 3: Homebrew\n\nIf you installed the CLI globally using Homebrew (e.g.,\n`brew install gemini-cli`), use the `brew uninstall` command to remove it.\n\n```bash\nbrew uninstall gemini-cli\n```\n\n## Method 4: MacPorts\n\nIf you installed the CLI globally using MacPorts (e.g.,\n`sudo port install gemini-cli`), use the `port uninstall` command to remove it.\n\n```bash\nsudo port uninstall gemini-cli\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":1874,"content_sha256":"8117c752c7096b1766d75095dd4b8ce6409617e47de1ca4973577cdacf9288b8"},{"filename":"canonical/geminicli-com/docs/tools/activate-skill.md","content":"---\nsource_url: http://geminicli.com/docs/tools/activate-skill\nsource_type: llms-txt\ncontent_hash: sha256:e3882a1c0387de563bd88024f23e419360d9a0bbf4d9de6a457652aa4bc1ddfc\nsitemap_url: https://geminicli.com/llms.txt\nfetch_method: markdown\netag: '\"4f5e79aace1dd6a0acaafb4d5342063d1804304c26c9a05b121e3a0adbe5cf86\"'\nlast_modified: '2026-03-02T02:03:05Z'\n---\n\n# Activate skill tool (`activate_skill`)\n\nThe `activate_skill` tool lets Gemini CLI load specialized procedural expertise\nand resources when they are relevant to your request.\n\n## Description\n\nSkills are packages of instructions and tools designed for specific engineering\ntasks, such as reviewing code or creating pull requests. Gemini CLI uses this\ntool to \"activate\" a skill, which provides it with detailed guidelines and\nspecialized tools tailored to that task.\n\n### Arguments\n\n`activate_skill` takes one argument:\n\n- `name` (enum, required): The name of the skill to activate (for example,\n `code-reviewer`, `pr-creator`, or `docs-writer`).\n\n## Usage\n\nThe `activate_skill` tool is used exclusively by the Gemini agent. You cannot\ninvoke this tool manually.\n\nWhen the agent identifies that a task matches a discovered skill, it requests to\nactivate that skill. Once activated, the agent's behavior is guided by the\nskill's specific instructions until the task is complete.\n\n## Behavior\n\nThe agent uses this tool to provide professional-grade assistance:\n\n- **Specialized logic:** Skills contain expert-level procedures for complex\n workflows.\n- **Dynamic capability:** Activating a skill can grant the agent access to new,\n task-specific tools.\n- **Contextual awareness:** Skills help the agent focus on the most relevant\n standards and conventions for a particular task.\n\n## Next steps\n\n- Learn how to [Use Agent Skills](/docs/cli/skills).\n- See the [Creating Agent Skills](/docs/cli/creating-skills) guide.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":1874,"content_sha256":"08ad1cf04804a443236b0f7bbcad7408bbb74c10f763ea55597c364c69465cd9"},{"filename":"config/__init__.py","content":"# Gemini CLI Docs - Configuration package\n","content_type":"text/x-python; charset=utf-8","language":"python","size":42,"content_sha256":"727ce7a918da67ff65a89666bb93833b13f8d191002d00673ee285be5ed8fd70"},{"filename":"scripts/__init__.py","content":"# Gemini CLI Docs - Scripts package\n","content_type":"text/x-python; charset=utf-8","language":"python","size":36,"content_sha256":"a5b6fc6012096bc432898d2852f59481b8910a634a3fa46ffbc50f5ec3fcabbd"},{"filename":"scripts/maintenance/__init__.py","content":"\"\"\"Maintenance scripts for cleanup and drift detection.\"\"\"\n\n","content_type":"text/x-python; charset=utf-8","language":"python","size":60,"content_sha256":"038dd1e703a309e99b045cf5ec8e22bc13b45a72d489638524220fa876b294ea"},{"filename":"tests/maintenance/__init__.py","content":"","content_type":"text/x-python; charset=utf-8","language":"python","size":0,"content_sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},{"filename":"tests/validation/__init__.py","content":"","content_type":"text/x-python; charset=utf-8","language":"python","size":0,"content_sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Gemini CLI Documentation Skill","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"CRITICAL: Path Doubling Prevention - MANDATORY","type":"text"}]},{"type":"paragraph","content":[{"text":"ABSOLUTE PROHIBITION: NEVER use ","type":"text","marks":[{"type":"strong"}]},{"text":"cd","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" with ","type":"text","marks":[{"type":"strong"}]},{"text":"&&","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" in PowerShell when running scripts from this skill.","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"The Problem:","type":"text","marks":[{"type":"strong"}]},{"text":" If your current working directory is already inside the skill directory, using relative paths causes PowerShell to resolve paths relative to the current directory instead of the repository root, resulting in path doubling.","type":"text"}]},{"type":"paragraph","content":[{"text":"REQUIRED Solutions (choose one):","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ALWAYS use absolute paths","type":"text","marks":[{"type":"strong"}]},{"text":" (recommended)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use separate commands","type":"text","marks":[{"type":"strong"}]},{"text":" (never ","type":"text"},{"text":"cd","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"&&","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run from repository root","type":"text","marks":[{"type":"strong"}]},{"text":" with relative paths","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"NEVER DO THIS:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Chain ","type":"text"},{"text":"cd","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"&&","type":"text","marks":[{"type":"code_inline"}]},{"text":": ","type":"text"},{"text":"cd \u003crelative-path> && python \u003cscript>","type":"text","marks":[{"type":"code_inline"}]},{"text":" causes path doubling","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Assume current directory","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use relative paths when current dir is inside skill directory","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"CRITICAL: Large File Handling - MANDATORY SCRIPT USAGE","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"ABSOLUTE PROHIBITION: NEVER use read_file tool on the index.yaml file","type":"text"}]},{"type":"paragraph","content":[{"text":"The file exceeds context limits and will cause issues. You MUST use scripts.","type":"text"}]},{"type":"paragraph","content":[{"text":"REQUIRED: ALWAYS use manage_index.py scripts for ANY index.yaml access:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python scripts/management/manage_index.py count\npython scripts/management/manage_index.py list\npython scripts/management/manage_index.py get \u003cdoc_id>\npython scripts/management/manage_index.py verify","type":"text"}]},{"type":"paragraph","content":[{"text":"All scripts automatically handle large files via ","type":"text"},{"text":"index_manager.py","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Available Slash Commands","type":"text"}]},{"type":"paragraph","content":[{"text":"Use the consolidated ","type":"text"},{"text":"docs-ops","type":"text","marks":[{"type":"code_inline"}]},{"text":" skill for common workflows:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"/google-ecosystem:docs-ops scrape","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Scrape Gemini CLI documentation from geminicli.com, then refresh index and validate","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"/google-ecosystem:docs-ops refresh","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Refresh the local index and metadata without scraping from remote sources","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"/google-ecosystem:docs-ops validate","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Validate the index and references for consistency and drift without scraping","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"/google-ecosystem:docs-ops rebuild-index","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Force rebuild the search index","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"/google-ecosystem:docs-ops clear-cache","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Clear the documentation search cache","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Overview","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill provides automation tooling for Gemini CLI documentation management. It manages:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Canonical storage","type":"text","marks":[{"type":"strong"}]},{"text":" (encapsulated in skill) - Single source of truth for official docs","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Subsection extraction","type":"text","marks":[{"type":"strong"}]},{"text":" - Token-optimized extracts (60-90% savings)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Drift detection","type":"text","marks":[{"type":"strong"}]},{"text":" - Hash-based validation against upstream sources","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Sync workflows","type":"text","marks":[{"type":"strong"}]},{"text":" - Maintenance automation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Documentation discovery","type":"text","marks":[{"type":"strong"}]},{"text":" - Keyword-based search and doc_id resolution","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Index management","type":"text","marks":[{"type":"strong"}]},{"text":" - Metadata, keywords, tags, aliases for resilient references","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Core value:","type":"text","marks":[{"type":"strong"}]},{"text":" Prevents link rot, enables offline access, optimizes token costs, automates maintenance, and provides resilient doc_id-based references.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to Use This Skill","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill should be used when:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Scraping documentation","type":"text","marks":[{"type":"strong"}]},{"text":" - Fetching docs from geminicli.com llms.txt","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Finding documentation","type":"text","marks":[{"type":"strong"}]},{"text":" - Searching for docs by keywords, category, or natural language","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Resolving doc references","type":"text","marks":[{"type":"strong"}]},{"text":" - Converting doc_id to file paths","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Managing index metadata","type":"text","marks":[{"type":"strong"}]},{"text":" - Adding keywords, tags, aliases, updating metadata","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Rebuilding index","type":"text","marks":[{"type":"strong"}]},{"text":" - Regenerating index from filesystem (handles renames/moves)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Workflow Execution Pattern","type":"text"}]},{"type":"paragraph","content":[{"text":"CRITICAL: This section defines HOW to execute operations in this skill.","type":"text","marks":[{"type":"strong"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Delegation Strategy","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Default approach: Delegate to Task agent","type":"text"}]},{"type":"paragraph","content":[{"text":"For ALL scraping, validation, and index operations, delegate execution to a general-purpose Task agent.","type":"text"}]},{"type":"paragraph","content":[{"text":"How to invoke:","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Use the Task tool with:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"subagent_type","type":"text","marks":[{"type":"code_inline"}]},{"text":": \"general-purpose\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"description","type":"text","marks":[{"type":"code_inline"}]},{"text":": Short 3-5 word description","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"prompt","type":"text","marks":[{"type":"code_inline"}]},{"text":": Full task description with execution instructions","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Execution Pattern","type":"text"}]},{"type":"paragraph","content":[{"text":"Scripts run in FOREGROUND by default. Do NOT background them.","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"When Task agents execute scripts:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run directly","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"python plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/scrape_docs.py --llms-txt https://geminicli.com/llms.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Streaming logs","type":"text","marks":[{"type":"strong"}]},{"text":": Scripts emit progress naturally via stdout","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Wait for completion","type":"text","marks":[{"type":"strong"}]},{"text":": Scripts exit when done with exit code","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NEVER use ","type":"text","marks":[{"type":"strong"}]},{"text":"run_in_background=true","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":": Scripts are designed for foreground execution","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NEVER poll output","type":"text","marks":[{"type":"strong"}]},{"text":": Streaming logs appear automatically, no BashOutput polling needed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NEVER use background jobs","type":"text","marks":[{"type":"strong"}]},{"text":": No ","type":"text"},{"text":"&","type":"text","marks":[{"type":"code_inline"}]},{"text":", no ","type":"text"},{"text":"nohup","type":"text","marks":[{"type":"code_inline"}]},{"text":", no background process management","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Anti-Pattern Detection","type":"text"}]},{"type":"paragraph","content":[{"text":"Red flags indicating incorrect execution:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Using ","type":"text"},{"text":"run_in_background=true","type":"text","marks":[{"type":"code_inline"}]},{"text":" in Bash tool","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Repeated BashOutput calls in a loop","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Checking process status with ","type":"text"},{"text":"ps","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"pgrep","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Manual polling of script output","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Background job management (","type":"text"},{"text":"&","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"nohup","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"jobs","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Using BashOutput AFTER Task agent completes","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"paragraph","content":[{"text":"If you recognize these patterns, STOP and correct immediately.","type":"text","marks":[{"type":"strong"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Error and Warning Reporting","type":"text"}]},{"type":"paragraph","content":[{"text":"CRITICAL: Report ALL errors, warnings, and issues - never suppress or ignore them.","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"When executing scripts via Task agents:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Report script errors","type":"text","marks":[{"type":"strong"}]},{"text":": Exit codes, exceptions, error messages","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Report warnings","type":"text","marks":[{"type":"strong"}]},{"text":": Deprecation warnings, import issues, configuration problems","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Report unexpected output","type":"text","marks":[{"type":"strong"}]},{"text":": 404s, timeouts, validation failures","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Include context","type":"text","marks":[{"type":"strong"}]},{"text":": What was being executed when the error occurred","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Red flags that indicate issues:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Non-zero exit code","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Lines containing \"ERROR\", \"FAILED\", \"Exception\", \"Traceback\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"WARNING\" or \"WARN\" messages","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"404 Not Found\", \"500 Internal Server Error\"","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Start","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Refresh Index End-to-End (No Scraping)","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this when you want to rebuild and validate the local index/metadata ","type":"text"},{"text":"without scraping","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"paragraph","content":[{"text":"Use Python 3.13 for validation","type":"text","marks":[{"type":"strong"}]},{"text":" - spaCy/Pydantic have compatibility issues with Python 3.14+","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Use Python 3.13 for full compatibility with spaCy\npy -3.13 plugins/google-ecosystem/skills/gemini-cli-docs/scripts/management/manage_index.py refresh","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scrape All Documentation","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this when the user explicitly wants to ","type":"text"},{"text":"hit the network and scrape docs","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Scrape from llms.txt\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/scrape_docs.py \\\n --llms-txt https://geminicli.com/llms.txt\n\n# Refresh index after scraping (use Python 3.13)\npy -3.13 plugins/google-ecosystem/skills/gemini-cli-docs/scripts/management/manage_index.py refresh","type":"text"}]},{"type":"paragraph","content":[{"text":"With options:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Skip existing files (incremental update)\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/scrape_docs.py \\\n --llms-txt https://geminicli.com/llms.txt \\\n --skip-existing\n\n# Filter to specific section\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/scrape_docs.py \\\n --llms-txt https://geminicli.com/llms.txt \\\n --filter \"/docs/\"","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Find Documentation","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Resolve doc_id to file path\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/find_docs.py resolve \u003cdoc_id>\n\n# Search by keywords (default: 25 results)\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/find_docs.py search checkpointing session\n\n# Search with custom limit\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/find_docs.py --limit 10 search tools\n\n# Natural language search\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/find_docs.py query \"how to use checkpointing\"\n\n# List by category\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/find_docs.py category docs\n\n# List by tag\npython plugins/google-ecosystem/skills/gemini-cli-docs/scripts/core/find_docs.py tag cli","type":"text"}]},{"type":"paragraph","content":[{"text":"Search Options:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Option","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Default","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--limit N","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"25","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Maximum number of results to return","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--no-limit","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Return all matching results (no limit)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--min-score N","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Only return results with relevance score >= N","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--fast","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Index-only search (skip content grep)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--json","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Output results as JSON","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--verbose","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Show relevance scores","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Configuration System","type":"text"}]},{"type":"paragraph","content":[{"text":"The gemini-cli-docs skill uses a unified configuration system with a single source of truth.","type":"text"}]},{"type":"paragraph","content":[{"text":"Configuration Files:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"config/defaults.yaml","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Central configuration file with all default values","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"config/config_registry.py","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Canonical configuration system with environment variable support","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"config/filtering.yaml","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Content filtering rules","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"config/tag_detection.yaml","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Tag detection patterns","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/sources.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" - Documentation sources configuration","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Environment Variable Overrides:","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"All configuration values can be overridden using environment variables: ","type":"text"},{"text":"GEMINI_DOCS_\u003cSECTION>_\u003cKEY>","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Full details:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/configuration.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/configuration.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Dependencies","type":"text"}]},{"type":"paragraph","content":[{"text":"Required:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"pyyaml","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"requests","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"beautifulsoup4","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"markdownify","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"filelock","type":"text","marks":[{"type":"code_inline"}]},{"text":" ","type":"text"},{"text":"Optional (recommended):","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"spacy","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"en_core_web_sm","type":"text","marks":[{"type":"code_inline"}]},{"text":" model (for keyword extraction)","type":"text"}]},{"type":"paragraph","content":[{"text":"Check dependencies:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python plugins/google-ecosystem/skills/gemini-cli-docs/scripts/setup/check_dependencies.py","type":"text"}]},{"type":"paragraph","content":[{"text":"Python Version:","type":"text","marks":[{"type":"strong"}]},{"text":" Python 3.13 recommended (required for spaCy operations)","type":"text"}]},{"type":"paragraph","content":[{"text":"Full details:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/dependencies.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/dependencies.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Capabilities","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. Scraping Documentation","type":"text"}]},{"type":"paragraph","content":[{"text":"Fetch documentation from geminicli.com using llms.txt format. Features: llms.txt parsing, HTML to Markdown conversion, automatic metadata tracking, URL-based folder organization.","type":"text"}]},{"type":"paragraph","content":[{"text":"Guide:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/capabilities/scraping-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/capabilities/scraping-guide.md","title":null}}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. Extracting Subsections","type":"text"}]},{"type":"paragraph","content":[{"text":"Extract specific markdown sections for token-optimized responses. Features: ATX-style heading structure parsing, section boundaries detection, provenance frontmatter, token economics (60-90% savings typical).","type":"text"}]},{"type":"paragraph","content":[{"text":"Guide:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/capabilities/extraction-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/capabilities/extraction-guide.md","title":null}}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. Change Detection","type":"text"}]},{"type":"paragraph","content":[{"text":"Detect documentation drift via 404 checking and hash comparison. Features: 404 URL detection, missing file detection, content hash comparison, orphaned file detection, cleanup automation.","type":"text"}]},{"type":"paragraph","content":[{"text":"Guide:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/capabilities/change-detection-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/capabilities/change-detection-guide.md","title":null}}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. Finding and Resolving Documentation","type":"text"}]},{"type":"paragraph","content":[{"text":"Discover and resolve documentation references using doc_id, keywords, or natural language queries. Features: doc_id resolution, keyword-based search, natural language query processing, category and tag filtering.","type":"text"}]},{"type":"paragraph","content":[{"text":"Guide:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/capabilities/discovery-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/capabilities/discovery-guide.md","title":null}}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"5. Index Management and Maintenance","type":"text"}]},{"type":"paragraph","content":[{"text":"Maintain index metadata, keywords, tags, and rebuild index from filesystem.","type":"text"}]},{"type":"paragraph","content":[{"text":"Guide:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/capabilities/index-management-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/capabilities/index-management-guide.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Workflows","type":"text"}]},{"type":"paragraph","content":[{"text":"Common maintenance and operational workflows:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Scraping Gemini CLI Documentation","type":"text","marks":[{"type":"strong"}]},{"text":" - Fetching docs from geminicli.com","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Refreshing the Index","type":"text","marks":[{"type":"strong"}]},{"text":" - Rebuilding metadata after changes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Detecting and Cleaning Drift","type":"text","marks":[{"type":"strong"}]},{"text":" - Finding and removing stale docs","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Adding Documentation Categories","type":"text","marks":[{"type":"strong"}]},{"text":" - Onboarding new doc sections","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Detailed Workflows:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/workflows.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/workflows.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Metadata & Keyword Audit Workflows","type":"text"}]},{"type":"paragraph","content":[{"text":"Quick validation:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"py -3.13 plugins/google-ecosystem/skills/gemini-cli-docs/scripts/validation/quick_validate.py","type":"text"}]},{"type":"paragraph","content":[{"text":"Search audit:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"py -3.13 plugins/google-ecosystem/skills/gemini-cli-docs/scripts/validation/run_search_audit.py\npy -3.13 plugins/google-ecosystem/skills/gemini-cli-docs/scripts/validation/analyze_search_audit.py","type":"text"}]},{"type":"paragraph","content":[{"text":"Tag configuration audit:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"py -3.13 plugins/google-ecosystem/skills/gemini-cli-docs/scripts/validation/audit_tag_config.py","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Platform-Specific Requirements","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Windows Users","type":"text"}]},{"type":"paragraph","content":[{"text":"MUST use PowerShell (recommended) or prefix Git Bash commands with ","type":"text","marks":[{"type":"strong"}]},{"text":"MSYS_NO_PATHCONV=1","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Git Bash on Windows converts Unix paths to Windows paths, breaking filter patterns.","type":"text"}]},{"type":"paragraph","content":[{"text":"Example:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"MSYS_NO_PATHCONV=1 python scripts/core/scrape_docs.py \\\n --llms-txt https://geminicli.com/llms.txt \\\n --filter \"/docs/\"","type":"text"}]},{"type":"paragraph","content":[{"text":"See:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/troubleshooting.md#git-bash-path-conversion","type":"text","marks":[{"type":"link","attrs":{"href":"references/troubleshooting.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Troubleshooting","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"spaCy Installation Issues","type":"text"}]},{"type":"paragraph","content":[{"text":"Problem:","type":"text","marks":[{"type":"strong"}]},{"text":" spaCy installation fails with Python 3.14+.","type":"text"}]},{"type":"paragraph","content":[{"text":"Solution:","type":"text","marks":[{"type":"strong"}]},{"text":" Use Python 3.13:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"py -3.13 -m pip install spacy\npy -3.13 -m spacy download en_core_web_sm","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Unicode Encoding Errors","type":"text"}]},{"type":"paragraph","content":[{"text":"Status:","type":"text","marks":[{"type":"strong"}]},{"text":" FIXED - Scripts auto-detect Windows and configure UTF-8 encoding.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"404 Errors During Scraping","type":"text"}]},{"type":"paragraph","content":[{"text":"Status:","type":"text","marks":[{"type":"strong"}]},{"text":" EXPECTED - Some llms.txt entries may reference docs that don't exist yet. Scripts handle gracefully and continue.","type":"text"}]},{"type":"paragraph","content":[{"text":"Full troubleshooting:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/troubleshooting.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/troubleshooting.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Public API","type":"text"}]},{"type":"paragraph","content":[{"text":"The gemini-cli-docs skill provides a clean public API for external tools:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"python"},"content":[{"text":"from gemini_docs_api import (\n find_document,\n resolve_doc_id,\n get_docs_by_tag,\n get_docs_by_category,\n search_by_keywords,\n get_document_section,\n detect_drift,\n cleanup_drift,\n refresh_index\n)\n\n# Natural language search\ndocs = find_document(\"model routing configuration\")\n\n# Resolve doc_id to metadata\ndoc = resolve_doc_id(\"geminicli-com-docs-checkpointing\")\n\n# Get docs by tag\ncli_docs = get_docs_by_tag(\"cli\")\n\n# Extract specific section\nsection = get_document_section(\"geminicli-com-docs-commands\", \"Built-in Commands\")\n\n# Detect drift\ndrift = detect_drift(check_404s=True, check_hashes=True)\n\n# Cleanup drift (dry run first)\nresult = cleanup_drift(clean_404s=True, dry_run=True)\n\n# Refresh index with drift detection\nresult = refresh_index(check_drift=True, cleanup_drift=False)","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Plugin Maintenance","type":"text"}]},{"type":"paragraph","content":[{"text":"For plugin-specific maintenance workflows:","type":"text"}]},{"type":"paragraph","content":[{"text":"See:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/plugin-maintenance.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/plugin-maintenance.md","title":null}}]}]},{"type":"paragraph","content":[{"text":"Quick reference:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Update workflow","type":"text","marks":[{"type":"strong"}]},{"text":": Scrape -> Validate -> Review -> Commit -> Version bump -> Push","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Version bumps","type":"text","marks":[{"type":"strong"}]},{"text":": Patch for doc refresh, Minor for new features, Major for breaking changes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Testing","type":"text","marks":[{"type":"strong"}]},{"text":": Run ","type":"text"},{"text":"manage_index.py verify","type":"text","marks":[{"type":"code_inline"}]},{"text":" and test search before pushing","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Development Mode","type":"text"}]},{"type":"paragraph","content":[{"text":"When developing this plugin locally, you may want changes to go to your dev repo instead of the installed plugin location.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Enabling Dev Mode","type":"text"}]},{"type":"paragraph","content":[{"text":"PowerShell:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"powershell"},"content":[{"text":"$env:GEMINI_DOCS_DEV_ROOT = \"D:\\repos\\gh\\melodic\\claude-code-plugins\"","type":"text"}]},{"type":"paragraph","content":[{"text":"Bash/Zsh:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"export GEMINI_DOCS_DEV_ROOT=\"/path/to/claude-code-plugins\"","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Verifying Mode","type":"text"}]},{"type":"paragraph","content":[{"text":"When you run any major script (scrape, refresh, rebuild), a mode banner will display:","type":"text"}]},{"type":"paragraph","content":[{"text":"Dev mode:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"text"},"content":[{"text":"[DEV MODE] Using local plugin: D:\\repos\\gh\\melodic\\claude-code-plugins","type":"text"}]},{"type":"paragraph","content":[{"text":"Prod mode:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"text"},"content":[{"text":"[PROD MODE] Using installed skill directory","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Disabling Dev Mode","type":"text"}]},{"type":"paragraph","content":[{"text":"PowerShell:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"powershell"},"content":[{"text":"Remove-Item Env:GEMINI_DOCS_DEV_ROOT","type":"text"}]},{"type":"paragraph","content":[{"text":"Bash/Zsh:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"unset GEMINI_DOCS_DEV_ROOT","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Documentation Categories","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Category","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Topics","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Get Started","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"installation, authentication, configuration, quickstart","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"CLI","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"commands, settings, themes, checkpointing, telemetry, trusted folders","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Core","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"architecture, tools API, policy engine, memport","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Tools","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"file system, shell, web fetch, web search, memory tool, MCP servers","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Extensions","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"creating, managing, releasing extensions","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"IDE","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"VS Code, JetBrains, IDE companion","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Gemini CLI Features","type":"text"}]},{"type":"paragraph","content":[{"text":"Key features documented:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Checkpointing","type":"text","marks":[{"type":"strong"}]},{"text":": File state snapshots, session management, rewind","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Model Routing","type":"text","marks":[{"type":"strong"}]},{"text":": Flash vs Pro selection, automatic routing","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Token Caching","type":"text","marks":[{"type":"strong"}]},{"text":": Prompt compression, cost optimization","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Policy Engine","type":"text","marks":[{"type":"strong"}]},{"text":": Security controls, trusted folders","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Memport","type":"text","marks":[{"type":"strong"}]},{"text":": Memory import/export","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"MCP Servers","type":"text","marks":[{"type":"strong"}]},{"text":": Model Context Protocol integration","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extensions","type":"text","marks":[{"type":"strong"}]},{"text":": Plugin system for CLI","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Sandbox","type":"text","marks":[{"type":"strong"}]},{"text":": Isolated execution environment","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Directory Structure","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"gemini-cli-docs/\n SKILL.md # This file (public)\n gemini_docs_api.py # Public API\n canonical/ # Documentation storage (private)\n geminicli-com/ # Scraped from geminicli.com\n index.yaml # Metadata index\n index.json # JSON mirror\n scripts/ # Implementation (private)\n core/ # Scraping, discovery\n management/ # Index management\n maintenance/ # Cleanup, drift detection\n validation/ # Validation scripts\n utils/ # Shared utilities\n setup/ # Setup scripts\n config/ # Configuration\n defaults.yaml # Default settings\n filtering.yaml # Content filtering\n tag_detection.yaml # Tag patterns\n references/ # Technical documentation (public)\n technical-details.md\n workflows.md\n troubleshooting.md\n plugin-maintenance.md\n configuration.md\n dependencies.md\n capabilities/\n scraping-guide.md\n extraction-guide.md\n change-detection-guide.md\n discovery-guide.md\n index-management-guide.md\n .cache/ # Cache storage (inverted index)\n logs/ # Log files","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Related Documentation","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/technical-details.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/technical-details.md","title":null}},{"type":"strong"}]},{"text":" - Architecture and internals","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/workflows.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/workflows.md","title":null}},{"type":"strong"}]},{"text":" - Common operational workflows","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/troubleshooting.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/troubleshooting.md","title":null}},{"type":"strong"}]},{"text":" - Problem resolution","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/plugin-maintenance.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/plugin-maintenance.md","title":null}},{"type":"strong"}]},{"text":" - Plugin update workflows","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/configuration.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/configuration.md","title":null}},{"type":"strong"}]},{"text":" - Configuration reference","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/dependencies.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/dependencies.md","title":null}},{"type":"strong"}]},{"text":" - Dependency management","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Source","type":"text"}]},{"type":"paragraph","content":[{"text":"Documentation is scraped from: https://geminicli.com/llms.txt","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Test Scenarios","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scenario 1: Keyword Search","type":"text"}]},{"type":"paragraph","content":[{"text":"Query","type":"text","marks":[{"type":"strong"}]},{"text":": \"Search for checkpointing documentation\" ","type":"text"},{"text":"Expected Behavior","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Skill activates on keyword \"documentation\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Returns relevant docs from index ","type":"text"},{"text":"Success Criteria","type":"text","marks":[{"type":"strong"}]},{"text":": User receives matching documentation entries","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scenario 2: Natural Language Query","type":"text"}]},{"type":"paragraph","content":[{"text":"Query","type":"text","marks":[{"type":"strong"}]},{"text":": \"How do I configure model routing in Gemini CLI?\" ","type":"text"},{"text":"Expected Behavior","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Skill activates on \"Gemini CLI\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Uses find_docs.py query command ","type":"text"},{"text":"Success Criteria","type":"text","marks":[{"type":"strong"}]},{"text":": Returns relevant documentation with configuration steps","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scenario 3: Doc ID Resolution","type":"text"}]},{"type":"paragraph","content":[{"text":"Query","type":"text","marks":[{"type":"strong"}]},{"text":": \"Resolve geminicli-com-docs-checkpointing\" ","type":"text"},{"text":"Expected Behavior","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Resolves doc_id to file path","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Returns document metadata ","type":"text"},{"text":"Success Criteria","type":"text","marks":[{"type":"strong"}]},{"text":": User receives full path and document content","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scenario 4: Drift Detection","type":"text"}]},{"type":"paragraph","content":[{"text":"Query","type":"text","marks":[{"type":"strong"}]},{"text":": \"Check for stale documentation\" ","type":"text"},{"text":"Expected Behavior","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Runs drift detection script","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reports 404 URLs, missing files, hash mismatches ","type":"text"},{"text":"Success Criteria","type":"text","marks":[{"type":"strong"}]},{"text":": User receives drift report with actionable items","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scenario 5: Section Extraction","type":"text"}]},{"type":"paragraph","content":[{"text":"Query","type":"text","marks":[{"type":"strong"}]},{"text":": \"Get the 'Built-in Commands' section from the commands doc\" ","type":"text"},{"text":"Expected Behavior","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extracts specific section from document","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Returns only the requested content ","type":"text"},{"text":"Success Criteria","type":"text","marks":[{"type":"strong"}]},{"text":": User receives targeted section, not full document","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Version History","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"v2.0.0 (2025-12-05): Full feature parity with docs-management - added maintenance scripts, validation scripts, enhanced API, comprehensive documentation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"v1.1.0 (2025-12-01): Added Test Scenarios section","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"v1.0.0 (2025-11-25): Initial release","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Last Updated","type":"text"}]},{"type":"paragraph","content":[{"text":"Date:","type":"text","marks":[{"type":"strong"}]},{"text":" 2025-12-05 ","type":"text"},{"text":"Model:","type":"text","marks":[{"type":"strong"}]},{"text":" claude-opus-4-5-20251101","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Status:","type":"text","marks":[{"type":"strong"}]},{"text":" Production-ready with full feature parity to docs-management skill.","type":"text"}]}]},"metadata":{"date":"2026-06-05","name":"gemini-cli-docs","author":"@skillopedia","source":{"stars":76,"repo_name":"claude-code-plugins","origin_url":"https://github.com/melodic-software/claude-code-plugins/blob/HEAD/plugins/google-ecosystem/skills/gemini-cli-docs/SKILL.md","repo_owner":"melodic-software","body_sha256":"9b1bdcf7237c1a5d00d591f31b655856cfeb758ec8d912a1cfd64605211e6c88","cluster_key":"f7c839a950bca2337fe9164d488a878ff07c10d9402f21ceae2da6121110741a","clean_bundle":{"format":"clean-skill-bundle-v1","source":"melodic-software/claude-code-plugins/plugins/google-ecosystem/skills/gemini-cli-docs/SKILL.md","attachments":[{"id":"153c7447-7201-5954-96af-9d27df427e88","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/153c7447-7201-5954-96af-9d27df427e88/attachment.md","path":"canonical/docs-cloud-google-com/gemini/docs/codeassist/overview.md","size":17532,"sha256":"9d4ed647b01282a8759cb1e9284118f8bd53397b0826b7388ea728bed3fc88b6","contentType":"text/markdown; charset=utf-8"},{"id":"daf6279e-8cdd-548f-9cd7-b3e1cd693ffe","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/daf6279e-8cdd-548f-9cd7-b3e1cd693ffe/attachment.md","path":"canonical/docs-cloud-google-com/logging/docs/view/logs-explorer-interface.md","size":55274,"sha256":"a7f31cc7d607f51545ec4a4ceb8709ecf490d28c7d160e45028edceabc69b168","contentType":"text/markdown; charset=utf-8"},{"id":"c37f0211-cf93-53cc-983e-76bd5ce6b0d3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c37f0211-cf93-53cc-983e-76bd5ce6b0d3/attachment.md","path":"canonical/docs-cloud-google-com/monitoring/charts/metrics-explorer.md","size":22171,"sha256":"bfff06257d48b55fc0c6aed9b3ba99d7acd17d343ce86adc1491b663328bcd36","contentType":"text/markdown; charset=utf-8"},{"id":"c546ee83-268d-5241-a7f2-a772efb5a112","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c546ee83-268d-5241-a7f2-a772efb5a112/attachment.md","path":"canonical/docs-cloud-google-com/trace/docs/finding-traces.md","size":22979,"sha256":"b691627e7406accad682a0c5351f555dd733d60676f28252623e4dfac18c6737","contentType":"text/markdown; charset=utf-8"},{"id":"dd56a078-1b06-5bf5-95a8-640acb29634c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/dd56a078-1b06-5bf5-95a8-640acb29634c/attachment.md","path":"canonical/geminicli-com/docs.md","size":6362,"sha256":"43cbded7f386f12bc1dd3b8e409b971c86939634e6dc58f9583416145fc9d7e0","contentType":"text/markdown; charset=utf-8"},{"id":"886997cd-8212-5fd2-af85-baa5e25f35b8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/886997cd-8212-5fd2-af85-baa5e25f35b8/attachment.md","path":"canonical/geminicli-com/docs/admin/enterprise-controls.md","size":6810,"sha256":"4c3396a8b0ec2828c8868dc3ac2610b7c0c848146837659b4ce2dd260c2c8aea","contentType":"text/markdown; charset=utf-8"},{"id":"1a22b3b0-6886-5486-b7fe-ce3564ad0903","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1a22b3b0-6886-5486-b7fe-ce3564ad0903/attachment.md","path":"canonical/geminicli-com/docs/architecture.md","size":4128,"sha256":"a8c0c0910a8a45b208248aaff4c9338b8d4e295d482333fbec2a2d19c2e170cb","contentType":"text/markdown; charset=utf-8"},{"id":"ccef40c8-b9c5-50d8-9063-5e01a4499d12","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ccef40c8-b9c5-50d8-9063-5e01a4499d12/attachment.md","path":"canonical/geminicli-com/docs/changelogs.md","size":51357,"sha256":"d95e887b1fab256c35354afd320877bcb0e916887c846736b2297973bc3e1109","contentType":"text/markdown; charset=utf-8"},{"id":"ee5558b6-7c2c-5808-8c8e-8a79b87fb917","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ee5558b6-7c2c-5808-8c8e-8a79b87fb917/attachment.md","path":"canonical/geminicli-com/docs/changelogs/latest.md","size":30218,"sha256":"f24b079937b6c62996905ef0dc340ff844b934550cb767ec45e48e0818414058","contentType":"text/markdown; charset=utf-8"},{"id":"447e32f5-8e1d-5387-b3d3-bf746361635d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/447e32f5-8e1d-5387-b3d3-bf746361635d/attachment.md","path":"canonical/geminicli-com/docs/changelogs/preview.md","size":23846,"sha256":"7b8c6a6f20c59c06dc48a00e67fd627a367335deee8b6f1ff8d1566021f21062","contentType":"text/markdown; charset=utf-8"},{"id":"4df78cb5-86b7-56be-b115-6f93cb130130","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4df78cb5-86b7-56be-b115-6f93cb130130/attachment.md","path":"canonical/geminicli-com/docs/cli.md","size":3259,"sha256":"74f34e6522ff3371dcfa81a159930828aade30a597ada7440c9fe82d5de5af3e","contentType":"text/markdown; charset=utf-8"},{"id":"817bf45c-0967-5181-bf0b-a2bb4d16c96a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/817bf45c-0967-5181-bf0b-a2bb4d16c96a/attachment.md","path":"canonical/geminicli-com/docs/cli/authentication.md","size":460,"sha256":"26074b1e83eed49ac2c6f8de4f637f00742006ca656b2bc750da072670ed37e0","contentType":"text/markdown; charset=utf-8"},{"id":"ffab2599-1df5-5629-8999-185b6ddf6482","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ffab2599-1df5-5629-8999-185b6ddf6482/attachment.md","path":"canonical/geminicli-com/docs/cli/checkpointing.md","size":3465,"sha256":"f55998c0181a7b72dfa3d309d3202902d68d76d4b461dae2c2f1407c1f5faf6a","contentType":"text/markdown; charset=utf-8"},{"id":"8a669fec-80ea-578d-8385-bbf9510c0e5b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8a669fec-80ea-578d-8385-bbf9510c0e5b/attachment.md","path":"canonical/geminicli-com/docs/cli/cli-reference.md","size":16534,"sha256":"10f8b44c488f5b8a26b42aa7a113f5054a40c52f36f329a2d8dec736ba8256f8","contentType":"text/markdown; charset=utf-8"},{"id":"ddad52d2-cb85-5cc8-83e4-060164edd758","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ddad52d2-cb85-5cc8-83e4-060164edd758/attachment.md","path":"canonical/geminicli-com/docs/cli/commands.md","size":20120,"sha256":"7c7f133ee39f1a1da9839f80eeacbb29de6fb9dcb073b69520c6c3d12f130956","contentType":"text/markdown; charset=utf-8"},{"id":"6b1edc6b-5efb-58dc-87f7-6422035ceb4f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6b1edc6b-5efb-58dc-87f7-6422035ceb4f/attachment.md","path":"canonical/geminicli-com/docs/cli/creating-skills.md","size":2738,"sha256":"0fec3d03c62be755af95b565df891e789e9e48ef36bf5f86fa3724b1df7ebe9d","contentType":"text/markdown; charset=utf-8"},{"id":"72e9989b-8403-5cf3-92d4-ad2276b4af60","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/72e9989b-8403-5cf3-92d4-ad2276b4af60/attachment.md","path":"canonical/geminicli-com/docs/cli/custom-commands.md","size":12393,"sha256":"13b2089ac35459d5148bfdc1f5d3322b66bff7c73d0c63ad18500b204271673c","contentType":"text/markdown; charset=utf-8"},{"id":"58d338d4-0fae-5adf-922b-ce4193afe3a8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/58d338d4-0fae-5adf-922b-ce4193afe3a8/attachment.md","path":"canonical/geminicli-com/docs/cli/enterprise.md","size":19470,"sha256":"9c98d9c577e2d7066064a7a739f9b3164204512fd6e5d2d73bbc5d19202c929d","contentType":"text/markdown; charset=utf-8"},{"id":"ef54846a-4ab1-5c86-9fe8-a661fd3cb0bf","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ef54846a-4ab1-5c86-9fe8-a661fd3cb0bf/attachment.md","path":"canonical/geminicli-com/docs/cli/gemini-ignore.md","size":2427,"sha256":"3b558890a2d74ead8bbdb5b94a99704025fb3298a901895dfd8066dc5677453a","contentType":"text/markdown; charset=utf-8"},{"id":"befc2093-7081-589e-8926-ca382454b14d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/befc2093-7081-589e-8926-ca382454b14d/attachment.md","path":"canonical/geminicli-com/docs/cli/gemini-md.md","size":4305,"sha256":"11004f9eea9e388554e7d2af23bc1f473ab245d4a035ff1d0bafc3a5492c9da4","contentType":"text/markdown; charset=utf-8"},{"id":"5062ea27-08aa-513b-88c3-f59480ba1243","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5062ea27-08aa-513b-88c3-f59480ba1243/attachment.md","path":"canonical/geminicli-com/docs/cli/generation-settings.md","size":6589,"sha256":"c96a3a94468807c48b4c0a132e2fc360bac3bdaca9f8df3913cdba6a00bee8e0","contentType":"text/markdown; charset=utf-8"},{"id":"54b0ac27-a5af-5466-bd0c-2c7b8f89737d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/54b0ac27-a5af-5466-bd0c-2c7b8f89737d/attachment.md","path":"canonical/geminicli-com/docs/cli/git-worktrees.md","size":3935,"sha256":"abfcc9ceae1d1382408be83f56a1148c0d6003c69446c9695eac7596523df9bb","contentType":"text/markdown; charset=utf-8"},{"id":"534eb012-a329-5953-b9b0-47e3fefba82a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/534eb012-a329-5953-b9b0-47e3fefba82a/attachment.md","path":"canonical/geminicli-com/docs/cli/headless.md","size":1936,"sha256":"d06fcdfa870df97267abc6ae0e634380af4aec5889bb4e075ca57cc2cce918e1","contentType":"text/markdown; charset=utf-8"},{"id":"07104f4a-5f84-5edf-aecf-e0b65bd83621","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/07104f4a-5f84-5edf-aecf-e0b65bd83621/attachment.md","path":"canonical/geminicli-com/docs/cli/keyboard-shortcuts.md","size":12101,"sha256":"52cae927544ea7cd50b5349e33416721861810d785a468683d72c4123f10f3ce","contentType":"text/markdown; charset=utf-8"},{"id":"b878522a-97e7-52c0-b754-c3dc9e591469","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b878522a-97e7-52c0-b754-c3dc9e591469/attachment.md","path":"canonical/geminicli-com/docs/cli/model-routing.md","size":3141,"sha256":"f3001829d8eaab944199c71c0c0c85aaaf2bbc61be1f46678e084214786184da","contentType":"text/markdown; charset=utf-8"},{"id":"dc64b974-5fac-54ae-8a3f-04639b63f3dd","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/dc64b974-5fac-54ae-8a3f-04639b63f3dd/attachment.md","path":"canonical/geminicli-com/docs/cli/model-steering.md","size":3251,"sha256":"11ebba6c24e72c99dec54955380327853695bf0ad6659a23eb672efce12dfe31","contentType":"text/markdown; charset=utf-8"},{"id":"b1d71882-9ebc-56af-886a-adf8d9a26c89","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b1d71882-9ebc-56af-886a-adf8d9a26c89/attachment.md","path":"canonical/geminicli-com/docs/cli/model.md","size":3075,"sha256":"f1411b3b6ccba2a801789f6e9bd211b45ba051d1eac6f0d843ebaf8943af63c3","contentType":"text/markdown; charset=utf-8"},{"id":"97c6c016-23e5-5ad2-adb9-c35e2d75cca1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/97c6c016-23e5-5ad2-adb9-c35e2d75cca1/attachment.md","path":"canonical/geminicli-com/docs/cli/notifications.md","size":2261,"sha256":"4c8bceb023157ec1b49bc19206c7c16a46be262f58820ce391c6e2f1409a98f2","contentType":"text/markdown; charset=utf-8"},{"id":"6636db91-e154-5cb0-b151-3bd6421d127e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6636db91-e154-5cb0-b151-3bd6421d127e/attachment.md","path":"canonical/geminicli-com/docs/cli/plan-mode.md","size":18624,"sha256":"bdc77bf888e82d99e6f62072ca8302c6c89db722349a780317294c4bd432ae55","contentType":"text/markdown; charset=utf-8"},{"id":"8dc7ea37-2c79-5e12-b90e-e073f318744e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8dc7ea37-2c79-5e12-b90e-e073f318744e/attachment.md","path":"canonical/geminicli-com/docs/cli/rewind.md","size":2676,"sha256":"deb290b165bddb83779d3447aadf369bdaaaff803d0231db02924eb20107ff57","contentType":"text/markdown; charset=utf-8"},{"id":"ca77fabb-049c-598c-a97e-366a20c0f4bd","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ca77fabb-049c-598c-a97e-366a20c0f4bd/attachment.md","path":"canonical/geminicli-com/docs/cli/sandbox.md","size":8357,"sha256":"75b8ffa40f586cc73d122236d516132601ecbcc775dc91b0aef1f31c933a0ac2","contentType":"text/markdown; charset=utf-8"},{"id":"4703dbde-745a-5df5-987b-1e974ddb5193","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4703dbde-745a-5df5-987b-1e974ddb5193/attachment.md","path":"canonical/geminicli-com/docs/cli/session-management.md","size":6724,"sha256":"3442ab6277ee03baeb7ffd50b0882c1f114a2bd8c6e5f2ca7871694a8735e595","contentType":"text/markdown; charset=utf-8"},{"id":"3e478bf0-bd1d-57cb-9709-fcec06bc672f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3e478bf0-bd1d-57cb-9709-fcec06bc672f/attachment.md","path":"canonical/geminicli-com/docs/cli/settings.md","size":30244,"sha256":"e9091cdf7463fe6248cc83e3e687adefb7eaa746e3ec0aee23047017390efaf9","contentType":"text/markdown; charset=utf-8"},{"id":"08266e5b-8de8-57d5-9b9a-63b6102596c6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/08266e5b-8de8-57d5-9b9a-63b6102596c6/attachment.md","path":"canonical/geminicli-com/docs/cli/skills.md","size":6194,"sha256":"7712e6b6275305bb9e0c24ac729b7642e9f215be59d063acb1ed434dc2ab7507","contentType":"text/markdown; charset=utf-8"},{"id":"6b7c13ae-4d55-5143-b1ca-7a2e8e5bda2c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6b7c13ae-4d55-5143-b1ca-7a2e8e5bda2c/attachment.md","path":"canonical/geminicli-com/docs/cli/system-prompt.md","size":4970,"sha256":"16cc33df73b7d61f99afd7e9d57df2716000f609fbb062090e734f50b7b27842","contentType":"text/markdown; charset=utf-8"},{"id":"51a45299-13c4-5fcc-a986-a1bfa64378d8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/51a45299-13c4-5fcc-a986-a1bfa64378d8/attachment.md","path":"canonical/geminicli-com/docs/cli/telemetry.md","size":29388,"sha256":"14a68c08c7651f32c983eac7df07c0bfbb28d126cf580078d4a85bfcec723e4a","contentType":"text/markdown; charset=utf-8"},{"id":"79a8158b-81fe-536a-acea-5126173c5b0e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/79a8158b-81fe-536a-acea-5126173c5b0e/attachment.md","path":"canonical/geminicli-com/docs/cli/themes.md","size":8306,"sha256":"7f736151a045279763b865a48d8f544e724e19889d10226e8fbcbc934ffa9f3c","contentType":"text/markdown; charset=utf-8"},{"id":"0aa7e6f5-b012-5570-8e80-89605faf1f9e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0aa7e6f5-b012-5570-8e80-89605faf1f9e/attachment.md","path":"canonical/geminicli-com/docs/cli/token-caching.md","size":1108,"sha256":"7a4e9605766524851517e684eda152e99776e9d97c16d1d4b26ca8661c640c5d","contentType":"text/markdown; charset=utf-8"},{"id":"5674d0aa-2ae8-5e5e-9288-3f27a4f6a0b8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5674d0aa-2ae8-5e5e-9288-3f27a4f6a0b8/attachment.md","path":"canonical/geminicli-com/docs/cli/trusted-folders.md","size":5345,"sha256":"47134414065db2533b93368594b9af6186661709722c7f7365c6ca89b272bab5","contentType":"text/markdown; charset=utf-8"},{"id":"51b60d73-770f-5658-bf55-4353c0a0da42","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/51b60d73-770f-5658-bf55-4353c0a0da42/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials.md","size":3063,"sha256":"87204462f27cfb7e24f8f14071554e183df76ac2452cb5953321edf2947139a3","contentType":"text/markdown; charset=utf-8"},{"id":"1b8cc399-8bf2-51dc-a6ea-8932a40e544d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1b8cc399-8bf2-51dc-a6ea-8932a40e544d/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/automation.md","size":7515,"sha256":"883fb3e9de624a2740d0110765ac2ba156a15f5a4219396be4ddf3acf3c68068","contentType":"text/markdown; charset=utf-8"},{"id":"35ff851b-6d7c-568f-8e88-2936b6448e14","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/35ff851b-6d7c-568f-8e88-2936b6448e14/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/file-management.md","size":4868,"sha256":"676f44bcef65c61c211d61daf2d4a6441aa4f1b7147ae4e612dcce4d7a902057","contentType":"text/markdown; charset=utf-8"},{"id":"5d65b707-0b1f-5b2b-8cc0-f73cd9b7062a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5d65b707-0b1f-5b2b-8cc0-f73cd9b7062a/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/mcp-setup.md","size":3603,"sha256":"eb00018402bf6e43418d5c3e7d9e997a35c74a456053e7877ba8b41604e10a05","contentType":"text/markdown; charset=utf-8"},{"id":"31d3d755-b434-5c75-9c29-ee67d712f9ef","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/31d3d755-b434-5c75-9c29-ee67d712f9ef/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/memory-management.md","size":4762,"sha256":"a06d28d36a0bcb6b8ed0154810d22196c2d7fcff263404ff4f087f5772c98070","contentType":"text/markdown; charset=utf-8"},{"id":"76537e74-8247-5984-a7e1-0c9a06c71cc3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/76537e74-8247-5984-a7e1-0c9a06c71cc3/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/plan-mode-steering.md","size":3890,"sha256":"a3548496c087f7d36984d02968fa6c9b4b33d2e72f93aa15fc7fc531f86132e5","contentType":"text/markdown; charset=utf-8"},{"id":"6ecb66b7-283a-5998-8bd2-6f5622798116","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6ecb66b7-283a-5998-8bd2-6f5622798116/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/session-management.md","size":3690,"sha256":"7ce67d72bf1ced488c5465cfd7413d6a08be81508f758b90df3cf30a3e7d3de7","contentType":"text/markdown; charset=utf-8"},{"id":"6c21984e-0e54-50a1-b602-60ea0ec26c51","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6c21984e-0e54-50a1-b602-60ea0ec26c51/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/shell-commands.md","size":3992,"sha256":"4a7738d7324eb0c658057673f18f6a687e24d2f4c44f604d82f4570a3f0102fc","contentType":"text/markdown; charset=utf-8"},{"id":"b5fc973e-a1f2-5628-9552-d433ff752c82","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b5fc973e-a1f2-5628-9552-d433ff752c82/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/skills-getting-started.md","size":3613,"sha256":"c53fbeb680d5528a777aa643dc9441b382f9a4c8392a74af8f2825867158749f","contentType":"text/markdown; charset=utf-8"},{"id":"c9c18439-590e-5868-ab92-59ada10777be","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c9c18439-590e-5868-ab92-59ada10777be/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/task-planning.md","size":3421,"sha256":"ea1501c24d6487cdf7e620970dc839733f1ca9c1848bf41d62c7e5f6b6d37abb","contentType":"text/markdown; charset=utf-8"},{"id":"e815c9a8-ebc8-51b7-b96d-a0cb0ca164f2","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e815c9a8-ebc8-51b7-b96d-a0cb0ca164f2/attachment.md","path":"canonical/geminicli-com/docs/cli/tutorials/web-tools.md","size":2894,"sha256":"821d73ddfeb20333157c639c890f9cc2d31da79d1fe61f200d775010a14a2620","contentType":"text/markdown; charset=utf-8"},{"id":"b363ed6a-ad5b-5c92-b3eb-fc0e6239c24c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b363ed6a-ad5b-5c92-b3eb-fc0e6239c24c/attachment.md","path":"canonical/geminicli-com/docs/cli/uninstall.md","size":1999,"sha256":"e198497eb3b56afdcad779ff8346a02dfd1fbab86a53afb3c756a9634b4ef42f","contentType":"text/markdown; charset=utf-8"},{"id":"c93aa32a-4205-5d12-b7d6-3ba30de498a1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c93aa32a-4205-5d12-b7d6-3ba30de498a1/attachment.md","path":"canonical/geminicli-com/docs/contributing.md","size":20501,"sha256":"0dfbe6efed9a22a98a4b4fe577e515b68ff4608a43f4c82f3da161d2c563e513","contentType":"text/markdown; charset=utf-8"},{"id":"21b64c74-22b5-5143-aefd-6623ab2cc793","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/21b64c74-22b5-5143-aefd-6623ab2cc793/attachment.md","path":"canonical/geminicli-com/docs/core.md","size":5372,"sha256":"1b0eefaed2bf09481faeec782a73bc4b190eaf79ba02c42d286cb53b99c43e86","contentType":"text/markdown; charset=utf-8"},{"id":"33016465-6264-54aa-85a2-0edf7c105399","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/33016465-6264-54aa-85a2-0edf7c105399/attachment.md","path":"canonical/geminicli-com/docs/core/local-model-routing.md","size":7206,"sha256":"42e017b1416e305cc34b8d441bdb652124d54338ec7c1af84c6eeeadbe2af3e2","contentType":"text/markdown; charset=utf-8"},{"id":"9f4ee038-bd6b-5609-bc64-f8803f245b96","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9f4ee038-bd6b-5609-bc64-f8803f245b96/attachment.md","path":"canonical/geminicli-com/docs/core/memport.md","size":6736,"sha256":"5bbb9f9d7b32d5329057f109c14f258b6ecdcbbd72e8bd5cc103e9208d2dba5c","contentType":"text/markdown; charset=utf-8"},{"id":"b0c33d80-f427-5c38-ae01-7b7736bcac10","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b0c33d80-f427-5c38-ae01-7b7736bcac10/attachment.md","path":"canonical/geminicli-com/docs/core/policy-engine.md","size":11699,"sha256":"1fb59adb8670a521cab36935c5145fd0534283e741d84d974011d47e6f692c38","contentType":"text/markdown; charset=utf-8"},{"id":"7411cad6-67d9-5e76-a6f8-46d669196bc6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7411cad6-67d9-5e76-a6f8-46d669196bc6/attachment.md","path":"canonical/geminicli-com/docs/core/remote-agents.md","size":15125,"sha256":"71519f2a83ee3c8d55bf5606558accdcf201dd5cae43b4eb825cdf65004d1808","contentType":"text/markdown; charset=utf-8"},{"id":"4bece4e2-43ed-57c4-adcf-55d447297fe0","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4bece4e2-43ed-57c4-adcf-55d447297fe0/attachment.md","path":"canonical/geminicli-com/docs/core/subagents.md","size":16384,"sha256":"2882747d2668fd13aceab95aad06d938a642739e5cefc8725e45715326c92f34","contentType":"text/markdown; charset=utf-8"},{"id":"cca0aac3-43db-54c1-99d5-38d754456b36","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cca0aac3-43db-54c1-99d5-38d754456b36/attachment.md","path":"canonical/geminicli-com/docs/core/tools-api.md","size":7267,"sha256":"36e801858d713080dc83889733ba1e5dc2175c3a7d2eeef0dd7d14c39ea764e6","contentType":"text/markdown; charset=utf-8"},{"id":"7de085f0-8c3e-550f-bb63-aa92f17d34cf","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7de085f0-8c3e-550f-bb63-aa92f17d34cf/attachment.md","path":"canonical/geminicli-com/docs/examples/proxy-script.md","size":3181,"sha256":"b40f7497c5f2a3297de0f45659897b01a3c1fda06fcfacdc9b54987775ae41b8","contentType":"text/markdown; charset=utf-8"},{"id":"03488b6c-a7f9-5c46-8755-b748f11174e9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/03488b6c-a7f9-5c46-8755-b748f11174e9/attachment.md","path":"canonical/geminicli-com/docs/extensions.md","size":2183,"sha256":"e626764f379177949e886166bab2faabb27452cca7adf82ea7fde2bd291cd1ef","contentType":"text/markdown; charset=utf-8"},{"id":"dc44dd44-c3b8-58e0-9806-b70a9c59abf7","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/dc44dd44-c3b8-58e0-9806-b70a9c59abf7/attachment.md","path":"canonical/geminicli-com/docs/extensions/best-practices.md","size":6139,"sha256":"7736847dd4d9e9975edce94e8d9bd0bef8ee9c6c60f731e72be6ca65f8459ed0","contentType":"text/markdown; charset=utf-8"},{"id":"3f67477c-1379-5e91-a680-b5a90bbd2f50","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3f67477c-1379-5e91-a680-b5a90bbd2f50/attachment.md","path":"canonical/geminicli-com/docs/extensions/reference.md","size":11664,"sha256":"5c465ed9c9f460aa5dd079e3843a614cf493c1f699cb683fd19fe6a3c02c2386","contentType":"text/markdown; charset=utf-8"},{"id":"0c15368b-8d15-5623-93b7-20f55f54351e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0c15368b-8d15-5623-93b7-20f55f54351e/attachment.md","path":"canonical/geminicli-com/docs/extensions/releasing.md","size":6799,"sha256":"eb6f72aaa937effd1d73b59b4f88f70041448954c8fc92db05d4caa61a40c54a","contentType":"text/markdown; charset=utf-8"},{"id":"f0722482-8f9f-5e0a-b353-db05c6cca051","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f0722482-8f9f-5e0a-b353-db05c6cca051/attachment.md","path":"canonical/geminicli-com/docs/extensions/writing-extensions.md","size":12288,"sha256":"af67ff2a7da076384ee3405c836a9e034c9b9a62c8ff71acf0b80c82bbc4d01d","contentType":"text/markdown; charset=utf-8"},{"id":"bbf3f9a6-b907-535d-86fb-d0aa8c48f115","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/bbf3f9a6-b907-535d-86fb-d0aa8c48f115/attachment.md","path":"canonical/geminicli-com/docs/faq.md","size":7028,"sha256":"1c7383602c6741cb0f0b5bb039b7b988bef0a9c0565c79e8961159f9508de110","contentType":"text/markdown; charset=utf-8"},{"id":"54d1d608-6fe9-5c7b-a506-7c0623913d71","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/54d1d608-6fe9-5c7b-a506-7c0623913d71/attachment.md","path":"canonical/geminicli-com/docs/get-started.md","size":2888,"sha256":"ecfb5f30366a61d8116e716afc6720b05c203430725b4817a19b3ba104d98dd7","contentType":"text/markdown; charset=utf-8"},{"id":"2113c838-9148-5d9a-b737-271ba65e40ad","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/2113c838-9148-5d9a-b737-271ba65e40ad/attachment.md","path":"canonical/geminicli-com/docs/get-started/authentication.md","size":14406,"sha256":"e3792ef09954e088c3cb133336a2c9dab9514cdf532403ab34103bc4e8543b3b","contentType":"text/markdown; charset=utf-8"},{"id":"722f5b32-fe2d-5736-833e-b6918c6ac730","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/722f5b32-fe2d-5736-833e-b6918c6ac730/attachment.md","path":"canonical/geminicli-com/docs/get-started/configuration-v1.md","size":39826,"sha256":"5c99b3096f27b1d4f35b63edb36cea11f0a75228e212627f5f7308c1d3eb1e62","contentType":"text/markdown; charset=utf-8"},{"id":"b5bed7d3-e4b0-5c46-9593-cf6d438a9dc1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b5bed7d3-e4b0-5c46-9593-cf6d438a9dc1/attachment.md","path":"canonical/geminicli-com/docs/get-started/configuration.md","size":61372,"sha256":"1852ed1443d2a99e64d67adfe5c47b0ae8848feb220a936adee4d618787b6ab2","contentType":"text/markdown; charset=utf-8"},{"id":"3d280757-cae2-5d68-95bf-e8e72f029ed4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3d280757-cae2-5d68-95bf-e8e72f029ed4/attachment.md","path":"canonical/geminicli-com/docs/get-started/examples.md","size":4803,"sha256":"5e9423de7fd8476ca8536de8c4fffc301a18acd48b0a874a82765fc5f4acdb47","contentType":"text/markdown; charset=utf-8"},{"id":"0cfdef0c-2a5e-5a10-a0ad-6bf80471bad1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0cfdef0c-2a5e-5a10-a0ad-6bf80471bad1/attachment.md","path":"canonical/geminicli-com/docs/get-started/gemini-3.md","size":4979,"sha256":"ba8d348ea3c303684724c8978561c010a3e9e3f62e1e964898ac07b26c84dda4","contentType":"text/markdown; charset=utf-8"},{"id":"0fc7b23c-fffb-5dd5-8d3b-5a4e608df0ca","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0fc7b23c-fffb-5dd5-8d3b-5a4e608df0ca/attachment.md","path":"canonical/geminicli-com/docs/get-started/installation.md","size":5321,"sha256":"36ff328a9abb80597e470df93e020c8f3554a29250deb2b255581079960c68c6","contentType":"text/markdown; charset=utf-8"},{"id":"bf4dc810-aee4-5c71-8f9a-55b8b844e9f4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/bf4dc810-aee4-5c71-8f9a-55b8b844e9f4/attachment.md","path":"canonical/geminicli-com/docs/hooks.md","size":8589,"sha256":"94629244bd62d46310e6e9b34761b8d44c47dfda40ffc34b852e906ec392ff32","contentType":"text/markdown; charset=utf-8"},{"id":"b4634a48-a506-5e77-b64e-5bb615c7438b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b4634a48-a506-5e77-b64e-5bb615c7438b/attachment.md","path":"canonical/geminicli-com/docs/hooks/best-practices.md","size":17932,"sha256":"d7f443afd2c41a44b28a5ee217e191b34815263dc53bbdaa53e445b4aa207784","contentType":"text/markdown; charset=utf-8"},{"id":"c852ec16-7744-59a8-95af-548f3b39130c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c852ec16-7744-59a8-95af-548f3b39130c/attachment.md","path":"canonical/geminicli-com/docs/hooks/reference.md","size":13624,"sha256":"67e39d91dbeef1a9ebde1a50f59a2df8ffcf887ee79c97da4f702ffb2a552446","contentType":"text/markdown; charset=utf-8"},{"id":"a450e507-1a6c-5733-ba30-44e898360358","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a450e507-1a6c-5733-ba30-44e898360358/attachment.md","path":"canonical/geminicli-com/docs/hooks/writing-hooks.md","size":11888,"sha256":"bb5a99e89b44bab4f1a9da0fea7a7ede873c1d6ad6b451b7e73c7efa2171518a","contentType":"text/markdown; charset=utf-8"},{"id":"a3549df1-d94a-59d0-bd87-6a6cee1bc8fa","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a3549df1-d94a-59d0-bd87-6a6cee1bc8fa/attachment.md","path":"canonical/geminicli-com/docs/ide-integration.md","size":9058,"sha256":"5a99b3177829841300d9533fdceea5dbc9d3747dc3dbf6dc75f6bfbd763cc4a5","contentType":"text/markdown; charset=utf-8"},{"id":"b5b1cebc-962a-59d1-bfe3-5e4055eb4a84","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b5b1cebc-962a-59d1-bfe3-5e4055eb4a84/attachment.md","path":"canonical/geminicli-com/docs/ide-integration/ide-companion-spec.md","size":11161,"sha256":"0635eacd3a68863d712c677408aa5fd3785e06ad476b73055473a56232a88604","contentType":"text/markdown; charset=utf-8"},{"id":"55653d3a-e32a-5445-a6ae-0d55de99f83c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/55653d3a-e32a-5445-a6ae-0d55de99f83c/attachment.md","path":"canonical/geminicli-com/docs/integration-tests.md","size":6244,"sha256":"c6c11b9bb60d71051fc3fca6acd5266de84c9e6c9ad637b41a356ea4c1833971","contentType":"text/markdown; charset=utf-8"},{"id":"79dca145-f35d-52a3-b337-b3fbbfd9d1cf","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/79dca145-f35d-52a3-b337-b3fbbfd9d1cf/attachment.md","path":"canonical/geminicli-com/docs/issue-and-pr-automation.md","size":8976,"sha256":"f7d900d44c07f4ce85025fddc17923fa8435317f77d16904ca63cba711885957","contentType":"text/markdown; charset=utf-8"},{"id":"42096b4e-99af-587f-ba9b-5d1ced2cc38f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/42096b4e-99af-587f-ba9b-5d1ced2cc38f/attachment.md","path":"canonical/geminicli-com/docs/local-development.md","size":5243,"sha256":"919122a2972da63965b6034c2512a78b7abe419d4894755f6222ed8aaffff138","contentType":"text/markdown; charset=utf-8"},{"id":"50da808e-6fa6-5a44-90ce-f66cffe33b92","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/50da808e-6fa6-5a44-90ce-f66cffe33b92/attachment.md","path":"canonical/geminicli-com/docs/npm.md","size":2888,"sha256":"ba952b9031fbda34f9bdd147368aafd2c83e8ddff35d778910be598f7e335682","contentType":"text/markdown; charset=utf-8"},{"id":"e50820b4-44cc-5024-b63f-4916e73bd092","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e50820b4-44cc-5024-b63f-4916e73bd092/attachment.md","path":"canonical/geminicli-com/docs/quota-and-pricing.md","size":6580,"sha256":"f6800565ca02239bd5b721550761746848b9ae81be08b2f9df996f2f525994db","contentType":"text/markdown; charset=utf-8"},{"id":"5d965248-c64e-5d34-919d-1d0aedb2cb43","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5d965248-c64e-5d34-919d-1d0aedb2cb43/attachment.md","path":"canonical/geminicli-com/docs/reference/commands.md","size":24090,"sha256":"7faf8ddd704c6f1ccc0426beb97f6d20b0144a31b9d6fd5ce41a1014dae34c10","contentType":"text/markdown; charset=utf-8"},{"id":"a90de1db-6874-5ace-b269-17a119e4e8a6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a90de1db-6874-5ace-b269-17a119e4e8a6/attachment.md","path":"canonical/geminicli-com/docs/reference/configuration.md","size":83551,"sha256":"9b131824d0d77cda38ebdf7a555e6ee75a241b5f2af116154d4510fc6576a1d1","contentType":"text/markdown; charset=utf-8"},{"id":"067a34f2-b404-590d-9068-54272229d49b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/067a34f2-b404-590d-9068-54272229d49b/attachment.md","path":"canonical/geminicli-com/docs/reference/keyboard-shortcuts.md","size":17556,"sha256":"e0345b6b643d42a12b439f40c7a7e62c372e8c2b1efbc53a6f61d38474f25f4d","contentType":"text/markdown; charset=utf-8"},{"id":"5f99d5c7-f35d-54bf-a7d8-19d4387a4aba","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5f99d5c7-f35d-54bf-a7d8-19d4387a4aba/attachment.md","path":"canonical/geminicli-com/docs/reference/memport.md","size":6740,"sha256":"250616afab74e4bc6cd374828f0d1f7357d9fb440cf9b2dfe241750f5a41e60c","contentType":"text/markdown; charset=utf-8"},{"id":"ed34c6ef-2fb7-50cf-90d6-397c7a4dc5d9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ed34c6ef-2fb7-50cf-90d6-397c7a4dc5d9/attachment.md","path":"canonical/geminicli-com/docs/reference/policy-engine.md","size":16454,"sha256":"0c4fd3679816b47e8335ce4584ace3a6f4bd785a4f94d846c021c770f4ce94b6","contentType":"text/markdown; charset=utf-8"},{"id":"862b6ade-ebba-5fca-ba38-198d19773175","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/862b6ade-ebba-5fca-ba38-198d19773175/attachment.md","path":"canonical/geminicli-com/docs/reference/tools.md","size":10052,"sha256":"41c5107e77afc3b3528465b324cdd7299b43f57c0861e001dee12a38ef92b579","contentType":"text/markdown; charset=utf-8"},{"id":"9420101a-0564-5283-91f2-e7d15b5883e1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9420101a-0564-5283-91f2-e7d15b5883e1/attachment.md","path":"canonical/geminicli-com/docs/release-confidence.md","size":5996,"sha256":"93c77a7c80218840e4f747ad4813bdc8fb9e32f1cd3365a03b399a5752c0f4eb","contentType":"text/markdown; charset=utf-8"},{"id":"412bc388-a913-54cb-8f28-f0bba8745031","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/412bc388-a913-54cb-8f28-f0bba8745031/attachment.md","path":"canonical/geminicli-com/docs/releases.md","size":23340,"sha256":"b5345a4dfd9d05f90449d1a0cda2711dcafb2c4e0e71b147ae7df222d5d1104d","contentType":"text/markdown; charset=utf-8"},{"id":"675fcdf7-00d5-5dcf-b452-5eab2ff225fa","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/675fcdf7-00d5-5dcf-b452-5eab2ff225fa/attachment.md","path":"canonical/geminicli-com/docs/resources/faq.md","size":8451,"sha256":"e969a4fecc38eea872ae3c5164d09905bd6f35f42ce6a54ed611e54fc48b37ad","contentType":"text/markdown; charset=utf-8"},{"id":"b8376c48-90f2-5a09-9294-a3fa57fc0fb5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b8376c48-90f2-5a09-9294-a3fa57fc0fb5/attachment.md","path":"canonical/geminicli-com/docs/resources/quota-and-pricing.md","size":8270,"sha256":"fd503beb55cc72865531ec695f0447333128a34b4cc236b88d362cdc3a410f90","contentType":"text/markdown; charset=utf-8"},{"id":"a1ff53d7-52a4-559d-8dd0-85d522647382","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a1ff53d7-52a4-559d-8dd0-85d522647382/attachment.md","path":"canonical/geminicli-com/docs/resources/tos-privacy.md","size":7044,"sha256":"8fe87ba7a5d3f86921aa982303627c073939ba58eff72c947515d1336301a69f","contentType":"text/markdown; charset=utf-8"},{"id":"bbd26572-5212-578f-b7d7-98280af8c94c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/bbd26572-5212-578f-b7d7-98280af8c94c/attachment.md","path":"canonical/geminicli-com/docs/resources/troubleshooting.md","size":10799,"sha256":"c346f4052858f5f50d38b431dbe4b0d313bf788c877f504e16582a890dfbd0e9","contentType":"text/markdown; charset=utf-8"},{"id":"eea0d356-402c-5643-84ec-257bf0796961","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/eea0d356-402c-5643-84ec-257bf0796961/attachment.md","path":"canonical/geminicli-com/docs/resources/uninstall.md","size":1874,"sha256":"8117c752c7096b1766d75095dd4b8ce6409617e47de1ca4973577cdacf9288b8","contentType":"text/markdown; charset=utf-8"},{"id":"3b8ec39a-b40b-59c7-ba22-a469b6b9dca1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3b8ec39a-b40b-59c7-ba22-a469b6b9dca1/attachment.md","path":"canonical/geminicli-com/docs/tools.md","size":4734,"sha256":"ccaf3030ab2376c72124e4ebac25f27fbcdea43704aff796735d1725dbc7204c","contentType":"text/markdown; charset=utf-8"},{"id":"c99dc261-d7e9-54ae-826b-7129c2a1ff92","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c99dc261-d7e9-54ae-826b-7129c2a1ff92/attachment.md","path":"canonical/geminicli-com/docs/tools/activate-skill.md","size":1874,"sha256":"08ad1cf04804a443236b0f7bbcad7408bbb74c10f763ea55597c364c69465cd9","contentType":"text/markdown; charset=utf-8"},{"id":"b34f7bc6-eb2c-54b6-97e5-702e558dd2d5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b34f7bc6-eb2c-54b6-97e5-702e558dd2d5/attachment.md","path":"canonical/geminicli-com/docs/tools/ask-user.md","size":3148,"sha256":"db374e53e492466570d350dc10b3c896b6915c03c4cce8472fbdb33661237f6c","contentType":"text/markdown; charset=utf-8"},{"id":"cd6d0559-b09a-598b-b275-1a3797b32613","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cd6d0559-b09a-598b-b275-1a3797b32613/attachment.md","path":"canonical/geminicli-com/docs/tools/file-system.md","size":5480,"sha256":"a2f268cf99d8d389d915b3a8ca3ee49317f082114b55fa64da7899dc49db66f9","contentType":"text/markdown; charset=utf-8"},{"id":"58ece0a2-f447-5394-8dcb-c8ba7b130a38","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/58ece0a2-f447-5394-8dcb-c8ba7b130a38/attachment.md","path":"canonical/geminicli-com/docs/tools/internal-docs.md","size":2038,"sha256":"74cf27e25abeeb645776d428e06835a584b3207d6e12c1065bf4f46f3175f76a","contentType":"text/markdown; charset=utf-8"},{"id":"4be2c6fc-c0cc-526c-8dd6-5be06e965fe7","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4be2c6fc-c0cc-526c-8dd6-5be06e965fe7/attachment.md","path":"canonical/geminicli-com/docs/tools/mcp-server.md","size":39529,"sha256":"5302e586645a5a59596c59e49ba45e3868390abdde9c4d4bed3537364dd126fd","contentType":"text/markdown; charset=utf-8"},{"id":"02fdd8a5-6aa4-5d65-9ff3-573d489aed98","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/02fdd8a5-6aa4-5d65-9ff3-573d489aed98/attachment.md","path":"canonical/geminicli-com/docs/tools/memory.md","size":1520,"sha256":"4e034dd441c536374d946549f770f9c709b2fcae36039471984ca282e7ce9b2e","contentType":"text/markdown; charset=utf-8"},{"id":"8cb811e2-76c8-5956-8dd4-dcb757e068de","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8cb811e2-76c8-5956-8dd4-dcb757e068de/attachment.md","path":"canonical/geminicli-com/docs/tools/planning.md","size":2841,"sha256":"9d9608f460fc54936b3b92e133bb3ab686b06e8793f786f20f392832e47310d2","contentType":"text/markdown; charset=utf-8"},{"id":"d5841fa5-2ec6-51c1-b155-eb00fc472150","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d5841fa5-2ec6-51c1-b155-eb00fc472150/attachment.md","path":"canonical/geminicli-com/docs/tools/shell.md","size":7597,"sha256":"63bf51983848bbfa09870a61187b704bfeac03c4524d64136f86949493c1b70c","contentType":"text/markdown; charset=utf-8"},{"id":"feec5b37-0dc3-5da9-a7b2-c089367b6aae","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/feec5b37-0dc3-5da9-a7b2-c089367b6aae/attachment.md","path":"canonical/geminicli-com/docs/tools/todos.md","size":1593,"sha256":"3a1f4238fd92d40f2e5b787dcb0a76da2d898b3f0d83af247c7b7b8f1785da13","contentType":"text/markdown; charset=utf-8"},{"id":"4ae2d262-1310-5694-a8b8-6696d2273c2c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4ae2d262-1310-5694-a8b8-6696d2273c2c/attachment.md","path":"canonical/geminicli-com/docs/tools/web-fetch.md","size":1552,"sha256":"572774bb5368d60538eb53238bb6474245fbfa8bb9967a5d33263eddaec4213b","contentType":"text/markdown; charset=utf-8"},{"id":"d16aa82f-29bf-530c-a967-38b95ee23d67","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d16aa82f-29bf-530c-a967-38b95ee23d67/attachment.md","path":"canonical/geminicli-com/docs/tools/web-search.md","size":1508,"sha256":"7b798b6f87c580d92b348365167b4be0c3a4d8dc7f6ccfda6e73071d8f1b05da","contentType":"text/markdown; charset=utf-8"},{"id":"ec1c1e59-920a-5483-bdbd-570dfd878ea7","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ec1c1e59-920a-5483-bdbd-570dfd878ea7/attachment.md","path":"canonical/geminicli-com/docs/tos-privacy.md","size":6134,"sha256":"82e260e0ffa9d17c3120278b30137e61b27b74b6419f9649db65b4a610ec1285","contentType":"text/markdown; charset=utf-8"},{"id":"f1187a78-e136-5a2f-96ce-538dca87c3fb","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f1187a78-e136-5a2f-96ce-538dca87c3fb/attachment.md","path":"canonical/geminicli-com/docs/troubleshooting.md","size":9718,"sha256":"04f516545d70577c5101e7d97409d40eb085b0a05014cc2e55cd545aed93300b","contentType":"text/markdown; charset=utf-8"},{"id":"de9810d2-cea2-59ec-9e13-797570530150","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/de9810d2-cea2-59ec-9e13-797570530150/attachment.md","path":"canonical/geminicli-com/products/gemini/pricing.md","size":9976,"sha256":"9c8a673c9a47feddc051078ac14d88392f45805a4f06496d939737694614f9d2","contentType":"text/markdown; charset=utf-8"},{"id":"d8077427-35a5-5154-8140-40f5c797afc7","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d8077427-35a5-5154-8140-40f5c797afc7/attachment.json","path":"canonical/index.json","size":430395,"sha256":"4dd8ec6a34a09f69a1530842d7c142c93b35d3b0df4add38494bc17faacb736a","contentType":"application/json; charset=utf-8"},{"id":"928d2cca-47c5-56f5-8c15-ff3e65fd93ec","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/928d2cca-47c5-56f5-8c15-ff3e65fd93ec/attachment.yaml","path":"canonical/index.yaml","size":302334,"sha256":"8b5645654243151801ade24793484d5da2884e70af93de82dd795db8e1dbf0f1","contentType":"application/yaml; charset=utf-8"},{"id":"18252431-cab1-5e0a-847c-88f87feac85f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/18252431-cab1-5e0a-847c-88f87feac85f/attachment.py","path":"config/__init__.py","size":42,"sha256":"727ce7a918da67ff65a89666bb93833b13f8d191002d00673ee285be5ed8fd70","contentType":"text/x-python; charset=utf-8"},{"id":"20b4cf4d-d6d7-568e-abff-b90add696f9d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/20b4cf4d-d6d7-568e-abff-b90add696f9d/attachment.py","path":"config/config_registry.py","size":14134,"sha256":"8391d7345c5dcabf3bc5c3d700687bc104f006cc0c186b3f1a4c48c87c095645","contentType":"text/x-python; charset=utf-8"},{"id":"e5c37bbe-2c30-5508-82f9-31f59628b1fa","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e5c37bbe-2c30-5508-82f9-31f59628b1fa/attachment.yaml","path":"config/content_filtering.yaml","size":1641,"sha256":"dd98265ac6e4931dff367872b52cf0dee698e78b2db6abfdd19ef49f09b5deb2","contentType":"application/yaml; charset=utf-8"},{"id":"ab8c09ac-ccc8-59e5-a333-0b9cc8a60b15","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ab8c09ac-ccc8-59e5-a333-0b9cc8a60b15/attachment.yaml","path":"config/defaults.yaml","size":8003,"sha256":"c848fa7f2890bd12210451e8ca0bf126ab84bd9fc1a0232dbee593307fd1d02d","contentType":"application/yaml; charset=utf-8"},{"id":"1b2b2562-b9de-5826-ae2c-d5dccf6159d5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1b2b2562-b9de-5826-ae2c-d5dccf6159d5/attachment.yaml","path":"config/filtering.yaml","size":4711,"sha256":"2505f753e32cee619cf9f64df879ffbf1d37ab80945c506911059877c15035ba","contentType":"application/yaml; charset=utf-8"},{"id":"37c2e27e-cbe9-5547-8197-664f3a8528f8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/37c2e27e-cbe9-5547-8197-664f3a8528f8/attachment.yaml","path":"config/tag_detection.yaml","size":4208,"sha256":"27df739dcd4cac0980a676d09f0a8053fef732263052e62734deb267122ddd30","contentType":"application/yaml; charset=utf-8"},{"id":"a270caf6-a6fa-5664-885a-0740a9841bb9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a270caf6-a6fa-5664-885a-0740a9841bb9/attachment.py","path":"gemini_docs_api.py","size":24115,"sha256":"b35840e396058eb575e5a48c96ac0fa7fa0be25c2af3d34c943aa5986a827326","contentType":"text/x-python; charset=utf-8"},{"id":"46e48b9c-f7b1-56f2-9393-f91117602ff5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/46e48b9c-f7b1-56f2-9393-f91117602ff5/attachment.md","path":"references/capabilities/change-detection-guide.md","size":8009,"sha256":"99a9b81e1530c9f6ae6b0aa2ad91392e65b8a270869c3f36222b9450aad2eaf3","contentType":"text/markdown; charset=utf-8"},{"id":"0271cc35-aaf5-532b-aa1a-adbd51613a5e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0271cc35-aaf5-532b-aa1a-adbd51613a5e/attachment.md","path":"references/capabilities/discovery-guide.md","size":6172,"sha256":"8e8b669796cbf4b7e72f3921e611a6b9b62468577b4e1892761f31621690c174","contentType":"text/markdown; charset=utf-8"},{"id":"8810efc4-187c-5db9-b35f-7327f67ebbde","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8810efc4-187c-5db9-b35f-7327f67ebbde/attachment.md","path":"references/capabilities/extraction-guide.md","size":6663,"sha256":"6caaf67ed072a9566e4573f33d3f6ae760f63e7d97248ffc89df079333353b7e","contentType":"text/markdown; charset=utf-8"},{"id":"a978009a-44cd-5476-aa05-d5bffc939a61","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a978009a-44cd-5476-aa05-d5bffc939a61/attachment.md","path":"references/capabilities/index-management-guide.md","size":7431,"sha256":"3fa9d8ca31b59f16d31a9f0257c97cbf827f8efcfeba3f8242a17c7961351933","contentType":"text/markdown; charset=utf-8"},{"id":"e54707a4-6b51-5287-b2f8-29a0e31026f4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e54707a4-6b51-5287-b2f8-29a0e31026f4/attachment.md","path":"references/capabilities/scraping-guide.md","size":6400,"sha256":"8540cf14c26cf2a37ceaa9a849ba0dee23a3f4890383a322fe034a2a0a11f808","contentType":"text/markdown; charset=utf-8"},{"id":"e6585422-05e9-56dd-ba36-b4e79c9f2daf","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e6585422-05e9-56dd-ba36-b4e79c9f2daf/attachment.md","path":"references/configuration.md","size":5695,"sha256":"b6ad90a4eb6ca1e8d902e43f419ef0373c560f44c514a7d2346dea84200ec56f","contentType":"text/markdown; charset=utf-8"},{"id":"d319da65-6ed8-54e6-9007-8e466ce911bb","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d319da65-6ed8-54e6-9007-8e466ce911bb/attachment.md","path":"references/dependencies.md","size":4799,"sha256":"532a6528e36e40f0ce556a676bf1cc2778206e7761d0bfdc2781713a18676220","contentType":"text/markdown; charset=utf-8"},{"id":"57b5ead3-9122-5436-ab8c-1c7e3044212d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/57b5ead3-9122-5436-ab8c-1c7e3044212d/attachment.md","path":"references/plugin-maintenance.md","size":5884,"sha256":"2f77cfb413d36e7121feaf0261e297fc2309816d5371ad7622b9b8760e7f3a85","contentType":"text/markdown; charset=utf-8"},{"id":"0d0a1c37-bed7-5afc-b304-c80b9dd6dd08","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0d0a1c37-bed7-5afc-b304-c80b9dd6dd08/attachment.json","path":"references/sources.json","size":409,"sha256":"a977fb09a91125f69eba1b2f2d50037f4669a58edaad5854a73f9686dcb1fc65","contentType":"application/json; charset=utf-8"},{"id":"295b159d-8cf8-54ed-9da4-862f66e7ccb9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/295b159d-8cf8-54ed-9da4-862f66e7ccb9/attachment.md","path":"references/technical-details.md","size":8017,"sha256":"1819e4ee6cc8753ccfcf362db2f118ae8538a74cfa6c8d75d214a730c4976787","contentType":"text/markdown; charset=utf-8"},{"id":"dca83b6c-1490-5e66-b311-d8e47f1b5109","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/dca83b6c-1490-5e66-b311-d8e47f1b5109/attachment.md","path":"references/troubleshooting.md","size":5515,"sha256":"deec5fcef3accd8ae459c170514a94ff4396e86b3d9f905a588778e6ebadca5b","contentType":"text/markdown; charset=utf-8"},{"id":"188dc3de-f3cf-52f1-aeef-b66f8d3df8a6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/188dc3de-f3cf-52f1-aeef-b66f8d3df8a6/attachment.md","path":"references/workflows.md","size":6562,"sha256":"779b642827d6d322ca5cb0ff1afd766761f37b402ae99bd9c2a5c44b32196476","contentType":"text/markdown; charset=utf-8"},{"id":"e091d122-fb97-52cc-abbb-ad43faafc687","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e091d122-fb97-52cc-abbb-ad43faafc687/attachment.py","path":"scripts/__init__.py","size":36,"sha256":"a5b6fc6012096bc432898d2852f59481b8910a634a3fa46ffbc50f5ec3fcabbd","contentType":"text/x-python; charset=utf-8"},{"id":"9d3f73ad-7e20-5d4a-a44d-e7e765f6edc5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9d3f73ad-7e20-5d4a-a44d-e7e765f6edc5/attachment.py","path":"scripts/bootstrap.py","size":4211,"sha256":"271578d268d443e0d96d0972c44c9c37bd5ba1f4ba05b2bfca6961d108c9dd41","contentType":"text/x-python; charset=utf-8"},{"id":"7ba1b513-d276-5d64-8e94-a22d0d16b6d8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7ba1b513-d276-5d64-8e94-a22d0d16b6d8/attachment.py","path":"scripts/core/__init__.py","size":100,"sha256":"e10535dc711e46388e4ccf5040b2904fbb3f8ad9e4512216dc4b21ef21e2cb0f","contentType":"text/x-python; charset=utf-8"},{"id":"5060e0bb-1b26-58d5-ba02-4cfc459461c2","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5060e0bb-1b26-58d5-ba02-4cfc459461c2/attachment.py","path":"scripts/core/chunked_storage.py","size":11673,"sha256":"035d0ce63d37c7596759dbacc0bf46977a18ce82766fa7bf7e12f85d6ca10872","contentType":"text/x-python; charset=utf-8"},{"id":"69e8956c-5f99-5512-af8d-65ae6e480c8f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/69e8956c-5f99-5512-af8d-65ae6e480c8f/attachment.py","path":"scripts/core/dedup_manager.py","size":12115,"sha256":"b4cc94c4f96c318c48a5d3d2e821bfcca3c8700011fa09cee58c17a9bd4403e2","contentType":"text/x-python; charset=utf-8"},{"id":"e3ecb0dd-7395-5f55-ac9d-7d2175c624d3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e3ecb0dd-7395-5f55-ac9d-7d2175c624d3/attachment.py","path":"scripts/core/delta_scraper.py","size":14446,"sha256":"71c329bd9f229facc8bab57bb0577ac2ef7b621c6860eb80f5afe5dd7e1f3f63","contentType":"text/x-python; charset=utf-8"},{"id":"992c56cd-e5fb-5ce5-80f5-97f3f83a2b96","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/992c56cd-e5fb-5ce5-80f5-97f3f83a2b96/attachment.py","path":"scripts/core/doc_resolver.py","size":46735,"sha256":"b6447ab1f85fe11f7b919b199bacdb082171f0a979af8520dde44e7c51351441","contentType":"text/x-python; charset=utf-8"},{"id":"8bd884ec-adbb-5e96-80f4-4d8df6ed03e8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8bd884ec-adbb-5e96-80f4-4d8df6ed03e8/attachment.py","path":"scripts/core/find_docs.py","size":16943,"sha256":"066790ed153d41fc214b91f98793ba08751cd8eb8f35a4c8e7b40cda712f808c","contentType":"text/x-python; charset=utf-8"},{"id":"604aec4c-de5d-584f-968a-d7564752b3dc","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/604aec4c-de5d-584f-968a-d7564752b3dc/attachment.py","path":"scripts/core/get_subsection_content.py","size":7910,"sha256":"efae657f08745fdc44a14b86ee739648a95715c8db3d0f208c4f4f3f2615b43c","contentType":"text/x-python; charset=utf-8"},{"id":"5c938e11-986b-5788-a02e-7267f3d0cf6a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5c938e11-986b-5788-a02e-7267f3d0cf6a/attachment.py","path":"scripts/core/llms_parser.py","size":14764,"sha256":"355e1dfdc19b7c8a4a09b705ad5fda03364d4c2f1ef41e8acc464412e7b2eb90","contentType":"text/x-python; charset=utf-8"},{"id":"10e99218-1fbc-5d3b-9751-315d672614b6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/10e99218-1fbc-5d3b-9751-315d672614b6/attachment.py","path":"scripts/core/scrape_all_sources.py","size":50342,"sha256":"fa5accef5572e99f7d17e315c9e42e6959db34e29d59d989dbd972ec258eebf1","contentType":"text/x-python; charset=utf-8"},{"id":"6490dc97-036a-5098-a82c-ef5345eccc61","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6490dc97-036a-5098-a82c-ef5345eccc61/attachment.py","path":"scripts/core/scrape_docs.py","size":112271,"sha256":"e7b61fb2642fa05d58f2799fc52b7edb787493e6dc7eb023bc6ec4b87de599e0","contentType":"text/x-python; charset=utf-8"},{"id":"71f1277f-4e9f-572b-9ce4-16d59ff28386","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/71f1277f-4e9f-572b-9ce4-16d59ff28386/attachment.py","path":"scripts/core/scrape_llms_full.py","size":12750,"sha256":"97dc49f4254bfd3032a57d321b775c3eec5f368a58a740f9337beacdff1150a7","contentType":"text/x-python; charset=utf-8"},{"id":"ea6ceab0-62ec-5ab8-b870-3e737d0a7369","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ea6ceab0-62ec-5ab8-b870-3e737d0a7369/attachment.py","path":"scripts/maintenance/__init__.py","size":60,"sha256":"038dd1e703a309e99b045cf5ec8e22bc13b45a72d489638524220fa876b294ea","contentType":"text/x-python; charset=utf-8"},{"id":"0c4b4340-c316-5815-b5bc-d62591e6a76c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0c4b4340-c316-5815-b5bc-d62591e6a76c/attachment.py","path":"scripts/maintenance/audit_performance.py","size":10330,"sha256":"d978bd795656c517d7aae610caa04852b41a8d25b4268077ffeb81b82ad25989","contentType":"text/x-python; charset=utf-8"},{"id":"b264ebd5-9092-5745-a2e2-c8c8585143b6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b264ebd5-9092-5745-a2e2-c8c8585143b6/attachment.py","path":"scripts/maintenance/cleanup_drift.py","size":21438,"sha256":"d21614c9c9cfc8f80b5a535e878cf78bbb4696ea6c45dd437971323be2e9cd17","contentType":"text/x-python; charset=utf-8"},{"id":"5689caf9-547a-5996-a58b-db130b88dfec","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5689caf9-547a-5996-a58b-db130b88dfec/attachment.py","path":"scripts/maintenance/cleanup_logs.py","size":8227,"sha256":"14ada32817a3724188f08d3386017b9d7804aae0eec030523b65693962c70108","contentType":"text/x-python; charset=utf-8"},{"id":"6166d685-d737-5c98-826c-c1255fa11ea4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6166d685-d737-5c98-826c-c1255fa11ea4/attachment.py","path":"scripts/maintenance/cleanup_stale.py","size":11899,"sha256":"9cbd0098a19d43a1626c2ea59aee51fc7417b399faef7a4c70af22313416a6f7","contentType":"text/x-python; charset=utf-8"},{"id":"f02c3b0f-1393-5dc2-9da3-9ae2d14d43f1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f02c3b0f-1393-5dc2-9da3-9ae2d14d43f1/attachment.py","path":"scripts/maintenance/clear_cache.py","size":5614,"sha256":"38b784cc58f1c75f116733473071cad9b44304e609bd441b67b2bcc61b826e95","contentType":"text/x-python; charset=utf-8"},{"id":"7fd7fb37-39dc-54e7-825a-5ff518874abd","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7fd7fb37-39dc-54e7-825a-5ff518874abd/attachment.py","path":"scripts/maintenance/detect_changes.py","size":24444,"sha256":"bc76743cc9856976e1666bd1e776ab927b92e42e457f673a63fbe5e002dc1e90","contentType":"text/x-python; charset=utf-8"},{"id":"98847d4f-5bfa-57d8-b6f9-f89916853637","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/98847d4f-5bfa-57d8-b6f9-f89916853637/attachment.py","path":"scripts/maintenance/discover_categories.py","size":7445,"sha256":"4040dcef0d146ee127f80815a62fa86dfa86130364d93dd8198682fd57e6b7f6","contentType":"text/x-python; charset=utf-8"},{"id":"2bc1c3d4-9f5e-5201-a3be-97bae3c6a2f4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/2bc1c3d4-9f5e-5201-a3be-97bae3c6a2f4/attachment.py","path":"scripts/management/__init__.py","size":64,"sha256":"7278170b8348addba91de5c3847cafff9d15d7a044c07e8e40385258fc579e33","contentType":"text/x-python; charset=utf-8"},{"id":"72449f7a-5e0e-5a17-a2f3-4b65d67ec5e5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/72449f7a-5e0e-5a17-a2f3-4b65d67ec5e5/attachment.py","path":"scripts/management/extract_metadata.py","size":65381,"sha256":"cee4c76aab8d65ee259f96fdb226bd430c1d6d0d2fefe09d7f984802827de420","contentType":"text/x-python; charset=utf-8"},{"id":"c178adde-ad41-5882-a891-949db5b066b3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c178adde-ad41-5882-a891-949db5b066b3/attachment.py","path":"scripts/management/extract_publication_dates.py","size":5256,"sha256":"175d2d284865268febc3b8f9e2a1f8ed92cba27882933ce570da0449a7c3dbf5","contentType":"text/x-python; charset=utf-8"},{"id":"5ad957ad-6699-5d8f-ae61-6f7a8717c5af","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5ad957ad-6699-5d8f-ae61-6f7a8717c5af/attachment.py","path":"scripts/management/extract_subsection.py","size":9377,"sha256":"a495142fbd6f91a5066af3a8e75ad42f2f506b4a249e1de9acd7112155b3af05","contentType":"text/x-python; charset=utf-8"},{"id":"6f86d4cb-773a-5e49-9d03-5db4be7a922b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6f86d4cb-773a-5e49-9d03-5db4be7a922b/attachment.py","path":"scripts/management/generate_report.py","size":6191,"sha256":"f92d1cbae2114889c169f5ea5108b26f024c7fa0c4b3ec6538fa57f93f91b01e","contentType":"text/x-python; charset=utf-8"},{"id":"25dc14dc-8fbc-521d-862f-0b85c7932416","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/25dc14dc-8fbc-521d-862f-0b85c7932416/attachment.py","path":"scripts/management/index_manager.py","size":27991,"sha256":"81c7b26b5129bd29e2c71861db273cf06c9f7c2fb7bc1e10f7f0e36e5a0950ab","contentType":"text/x-python; charset=utf-8"},{"id":"64b7fe1e-0364-5046-88c4-0fd610a46b81","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/64b7fe1e-0364-5046-88c4-0fd610a46b81/attachment.py","path":"scripts/management/keyword_stats.py","size":3622,"sha256":"cba1d29b7fa367100788a74f633ae3a2036ef0a0a7de6cf946b344f7dbacb9c7","contentType":"text/x-python; charset=utf-8"},{"id":"cd6d9ebf-4b29-5334-982a-52b9703c62fb","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cd6d9ebf-4b29-5334-982a-52b9703c62fb/attachment.py","path":"scripts/management/manage_index.py","size":43646,"sha256":"55057c4c1d6671d31260e7412d4e69f6981cb97b35f264d1a589be47e73a5755","contentType":"text/x-python; charset=utf-8"},{"id":"e576bd42-d9ef-58e1-90c0-d672a4a7b0ee","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e576bd42-d9ef-58e1-90c0-d672a4a7b0ee/attachment.py","path":"scripts/management/rebuild_index.py","size":15303,"sha256":"336d3ef40d39f6d4a03f16c4ccd3bfc2b4321b2a262c72fc81799fa2a91713f6","contentType":"text/x-python; charset=utf-8"},{"id":"5a271cc6-c5f9-560a-8d82-3d565402efdc","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5a271cc6-c5f9-560a-8d82-3d565402efdc/attachment.py","path":"scripts/management/refresh_index.py","size":21064,"sha256":"dd86e0600b1ab139b5eee4571e0425d8f564fe47f2e8dd5c879371a03d372d21","contentType":"text/x-python; charset=utf-8"},{"id":"7321cd8e-6b99-58b0-8d0e-526d4946f8cc","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7321cd8e-6b99-58b0-8d0e-526d4946f8cc/attachment.py","path":"scripts/setup/__init__.py","size":48,"sha256":"18602a75fadd67b8fa92c9f4aea9f9b54da0afb55b40bb582dae71278047a515","contentType":"text/x-python; charset=utf-8"},{"id":"ad98ab80-eac0-52f9-97f6-c16a374eb344","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ad98ab80-eac0-52f9-97f6-c16a374eb344/attachment.py","path":"scripts/setup/check_dependencies.py","size":23025,"sha256":"f1f854647c779a342c13e5eedb6de4370abeff61f7a792bc7559edda6d94bc31","contentType":"text/x-python; charset=utf-8"},{"id":"20e0cba3-7910-5a61-9b80-1d7ee2e2da92","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/20e0cba3-7910-5a61-9b80-1d7ee2e2da92/attachment.py","path":"scripts/setup/check_spacy_model_location.py","size":1869,"sha256":"253e70fcd9d42fbe421bca6ede214fca5e0cf59082ebc107591c648452337f50","contentType":"text/x-python; charset=utf-8"},{"id":"0c09d14d-da3b-54b6-a5ab-5b8a3aa74968","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0c09d14d-da3b-54b6-a5ab-5b8a3aa74968/attachment.py","path":"scripts/setup/enable_dev_mode.py","size":3265,"sha256":"b77d54436c0a3fdeaf3bbad61cf7dc698182c685efc0f9ab83caee6031a04f43","contentType":"text/x-python; charset=utf-8"},{"id":"97f60eba-ca8b-5bd1-9c77-15835b836eb6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/97f60eba-ca8b-5bd1-9c77-15835b836eb6/attachment.py","path":"scripts/setup/setup_dependencies.py","size":97877,"sha256":"d913d18dbc4294354b3f20cab9828af7b19c21994bb4350a2c58b7fbfc56e454","contentType":"text/x-python; charset=utf-8"},{"id":"6c1319f9-10cc-5515-8207-e7a364892fb2","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6c1319f9-10cc-5515-8207-e7a364892fb2/attachment.py","path":"scripts/setup/setup_references.py","size":3800,"sha256":"92da0587a4a3f999a7894a10a82da6d184f7941e84861d6cf6d168c7513d8527","contentType":"text/x-python; charset=utf-8"},{"id":"92d35e5a-ca0a-5e78-bdc8-e87f7bc66c7d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/92d35e5a-ca0a-5e78-bdc8-e87f7bc66c7d/attachment.py","path":"scripts/utils/__init__.py","size":252,"sha256":"f59e5df6e4f7066b5720343520aff51913893c91991f15bff7ceab7edc30b238","contentType":"text/x-python; charset=utf-8"},{"id":"bdb2d59e-6221-5e65-81c8-5e2da18e665f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/bdb2d59e-6221-5e65-81c8-5e2da18e665f/attachment.py","path":"scripts/utils/cache_manager.py","size":12056,"sha256":"81206f63d2d9e6b8868aa63e6189310f64febf7649d3345f41c862c89210814b","contentType":"text/x-python; charset=utf-8"},{"id":"bfcfa233-e8bf-570b-aa77-cf704370d8bf","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/bfcfa233-e8bf-570b-aa77-cf704370d8bf/attachment.py","path":"scripts/utils/cleanup_utils.py","size":8311,"sha256":"d1efaa60a9376530686b95648df859694715559bae0b512fd445ef4694023c3d","contentType":"text/x-python; charset=utf-8"},{"id":"8aae3d48-25b4-5556-8a03-052ec1fd3c32","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8aae3d48-25b4-5556-8a03-052ec1fd3c32/attachment.py","path":"scripts/utils/cli_utils.py","size":5417,"sha256":"738f11fec617f692de42a22905300d9b2ddd974b9120d3edf9f3e6a5a4618c88","contentType":"text/x-python; charset=utf-8"},{"id":"36b22b02-4785-50d3-a090-fb8d599cdf30","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/36b22b02-4785-50d3-a090-fb8d599cdf30/attachment.py","path":"scripts/utils/common_paths.py","size":5728,"sha256":"c88f32fed6d005391a04e904a4a6e24e35df85883f88a4c980557ee5d1b6d027","contentType":"text/x-python; charset=utf-8"},{"id":"6c3e1ba9-9ab4-58e6-826c-ae5b6444d2e5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6c3e1ba9-9ab4-58e6-826c-ae5b6444d2e5/attachment.py","path":"scripts/utils/config_helpers.py","size":16035,"sha256":"fff3ac0b94ac4b80fbff067bf8f026333c8e23d1d4d51d6f3b9379f881c98940","contentType":"text/x-python; charset=utf-8"},{"id":"75db060e-1aa1-5e6c-bbc6-dc7b0c4e5a53","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/75db060e-1aa1-5e6c-bbc6-dc7b0c4e5a53/attachment.py","path":"scripts/utils/config_loader.py","size":9489,"sha256":"cb754b6231de22fdf36e52b8b9554b0d81f379e5339d82a554ecd8b86cffe2fb","contentType":"text/x-python; charset=utf-8"},{"id":"8e68fb57-769a-51c2-8445-d371081a44f4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8e68fb57-769a-51c2-8445-d371081a44f4/attachment.py","path":"scripts/utils/constants.py","size":1242,"sha256":"94608f4f2ecf985b13d41e419e04bd506db077914263075e61d0c37a580368cd","contentType":"text/x-python; charset=utf-8"},{"id":"301345bc-7427-5d1a-812b-69ff7feeb781","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/301345bc-7427-5d1a-812b-69ff7feeb781/attachment.py","path":"scripts/utils/content_filter.py","size":15344,"sha256":"5897ddc8e7a33be573fb72ae5e16159fcd68b6d5e17773df93844f89492760a7","contentType":"text/x-python; charset=utf-8"},{"id":"49d8c7f9-5df2-562c-b9f7-21f766908b31","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/49d8c7f9-5df2-562c-b9f7-21f766908b31/attachment.py","path":"scripts/utils/dev_mode.py","size":8555,"sha256":"b15e864d522ec76dea1e2b134221ce2f57bed2151029c341c491c9e13b4af9c0","contentType":"text/x-python; charset=utf-8"},{"id":"47a7154c-e87b-508d-91f1-fa392a34c87e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/47a7154c-e87b-508d-91f1-fa392a34c87e/attachment.py","path":"scripts/utils/http_utils.py","size":24142,"sha256":"932e15f99fb43f1efad8c09186ee503d282f328659f9cfd5f4146c4ea80100f0","contentType":"text/x-python; charset=utf-8"},{"id":"ea7863b7-6458-5cf8-96f4-2b7e96951892","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ea7863b7-6458-5cf8-96f4-2b7e96951892/attachment.py","path":"scripts/utils/logging_utils.py","size":41655,"sha256":"ccb3bff218ec338d23306b2b5e078ad8e3da050984104abaf717b2b5db90e928","contentType":"text/x-python; charset=utf-8"},{"id":"59f50954-1901-5f67-b6cb-64f4b6652304","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/59f50954-1901-5f67-b6cb-64f4b6652304/attachment.py","path":"scripts/utils/metadata_utils.py","size":1744,"sha256":"f7e0af41ed157e7b1233c8973a103cc19993f88fbb994fd4600550aa51af4a6a","contentType":"text/x-python; charset=utf-8"},{"id":"5eb6af93-0f9d-5aba-a07c-2ed2b11152e9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5eb6af93-0f9d-5aba-a07c-2ed2b11152e9/attachment.py","path":"scripts/utils/path_config.py","size":5345,"sha256":"8f718e11df4f66169a70377ccbe28229282458e94ae49759f1343d5734f94831","contentType":"text/x-python; charset=utf-8"},{"id":"49d21495-8c67-589b-bce5-1afe42e0194a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/49d21495-8c67-589b-bce5-1afe42e0194a/attachment.py","path":"scripts/utils/publication_utils.py","size":12818,"sha256":"9277c5cb60bb5b60acfdd0c0e34d43148b7bd51407b2c5c8d0f3ef58487d9987","contentType":"text/x-python; charset=utf-8"},{"id":"9323134d-bf1c-58ea-ba6d-ca902662afb5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9323134d-bf1c-58ea-ba6d-ca902662afb5/attachment.py","path":"scripts/utils/run_tests_safely.py","size":1691,"sha256":"b63151821993afb52b62f941ff66e5ad42dc68e64b03708503bc91d29d8ca467","contentType":"text/x-python; charset=utf-8"},{"id":"9c1d4053-9799-5779-9528-094ad6589832","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9c1d4053-9799-5779-9528-094ad6589832/attachment.py","path":"scripts/utils/script_utils.py","size":8139,"sha256":"c6c6aae959f3a041354b844a0e1a7e7efa817558870dbb7c62d1b25249260ac1","contentType":"text/x-python; charset=utf-8"},{"id":"26143f37-16d9-5cde-928c-e9f59e8a1892","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/26143f37-16d9-5cde-928c-e9f59e8a1892/attachment.py","path":"scripts/utils/search_constants.py","size":4646,"sha256":"93d3d767960c5c02dc4ba6581be06266dcb7703ad28c1fb26246349892c4df2d","contentType":"text/x-python; charset=utf-8"},{"id":"341430b7-a452-58ad-a113-a9b4db396c76","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/341430b7-a452-58ad-a113-a9b4db396c76/attachment.py","path":"scripts/validation/__init__.py","size":69,"sha256":"a179e0552149abee1c5bb7bd1d20b8ffa0765661dd7d70b36f5baf78fb681000","contentType":"text/x-python; charset=utf-8"},{"id":"dcd7e381-e088-5f92-b99e-e4215bfe0464","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/dcd7e381-e088-5f92-b99e-e4215bfe0464/attachment.py","path":"scripts/validation/analyze_search_audit.py","size":8975,"sha256":"74851b4eedff300e7450d34e7a1edd43c90aa849c43c564802e1480275b01517","contentType":"text/x-python; charset=utf-8"},{"id":"3b120f96-edf0-53b3-8f87-9230a9e3b30c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3b120f96-edf0-53b3-8f87-9230a9e3b30c/attachment.py","path":"scripts/validation/audit_tag_config.py","size":10873,"sha256":"567cca79d6013ad48d3372ffb0c4b3513e85944bfee615773b3e84e3d53eaa5e","contentType":"text/x-python; charset=utf-8"},{"id":"67deefad-c782-5ff7-abeb-f9580956c856","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/67deefad-c782-5ff7-abeb-f9580956c856/attachment.py","path":"scripts/validation/quick_validate.py","size":6274,"sha256":"6414623ff32f106674cb37baf93bca67452dd21b87de730bbd75b21c213b6ede","contentType":"text/x-python; charset=utf-8"},{"id":"12bdca8e-c72c-59ad-a16f-6da23ebe2d83","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/12bdca8e-c72c-59ad-a16f-6da23ebe2d83/attachment.py","path":"scripts/validation/run_search_audit.py","size":6201,"sha256":"af59b88cf2c3bea434dac6fec31acaad92a6bb9d4d469a745936aa9629d607e2","contentType":"text/x-python; charset=utf-8"},{"id":"2391bbf1-0987-556e-8ae2-e29f02558e11","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/2391bbf1-0987-556e-8ae2-e29f02558e11/attachment.py","path":"scripts/validation/validate_filtering.py","size":3478,"sha256":"15beb8fbac291f40be84fceaed07e8372272fdc95e1b3db1b9c956219e817cda","contentType":"text/x-python; charset=utf-8"},{"id":"a21ee632-7a1a-5552-b1b6-fcea04ca166f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a21ee632-7a1a-5552-b1b6-fcea04ca166f/attachment.py","path":"scripts/validation/validate_scraped_docs.py","size":17981,"sha256":"1d4577dd6c288061620eaa930b99cb577f879f7ba2a536f1ec3f986f3b08522b","contentType":"text/x-python; charset=utf-8"},{"id":"68a47295-036b-5d1d-8c83-940002482bd3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/68a47295-036b-5d1d-8c83-940002482bd3/attachment.py","path":"tests/__init__.py","size":39,"sha256":"3f0e97fcbff3d026ede225c33d84f2ef4c338cc614804040d586ca2a50d997dc","contentType":"text/x-python; charset=utf-8"},{"id":"53b9260d-9709-568b-aaab-01e3b3835948","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/53b9260d-9709-568b-aaab-01e3b3835948/attachment.py","path":"tests/conftest.py","size":10081,"sha256":"53b8af200f570f3bfe9010d11348fc84df3e0b4ee9c2ceaaa83e0fdf600de87b","contentType":"text/x-python; charset=utf-8"},{"id":"a02d6bae-22e2-5931-bba1-9eb502908663","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a02d6bae-22e2-5931-bba1-9eb502908663/attachment.py","path":"tests/core/__init__.py","size":44,"sha256":"b5fadcde2484b4bec0b299ba79d967d4298b83bce7dcac89af26744382d29d4f","contentType":"text/x-python; charset=utf-8"},{"id":"2462e385-366d-51d8-95ea-cf30e26e8608","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/2462e385-366d-51d8-95ea-cf30e26e8608/attachment.py","path":"tests/core/test_doc_resolver.py","size":8331,"sha256":"eab0b76df85d86b9f0e3a0d7b4330aefb9e051151878be2295ba1fe26eb762dd","contentType":"text/x-python; charset=utf-8"},{"id":"3f125227-5aef-52b7-a0c6-db156721439e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3f125227-5aef-52b7-a0c6-db156721439e/attachment.py","path":"tests/core/test_gemini_docs_api.py","size":11779,"sha256":"d39297e67bb1062d5b287597844d02aebdfbf17a833dde84ce161837b560bff2","contentType":"text/x-python; charset=utf-8"},{"id":"34dd2fbd-647e-50f8-ace4-3d31616c5b78","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/34dd2fbd-647e-50f8-ace4-3d31616c5b78/attachment.py","path":"tests/core/test_llms_parser.py","size":6929,"sha256":"a63f1b1f56e494fec05b19173549f3dd7a8cd39ac4c5881cba44aa580e709088","contentType":"text/x-python; charset=utf-8"},{"id":"6d1b6fa9-8084-598e-86b6-c84b107bbcd3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6d1b6fa9-8084-598e-86b6-c84b107bbcd3/attachment.py","path":"tests/integration/__init__.py","size":51,"sha256":"2b50d91177504bb02a75262162839d56e84f19413ad6bb7de6a34b43ec07f407","contentType":"text/x-python; charset=utf-8"},{"id":"51d03271-dfa5-5e5c-a775-34fa7ac720a9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/51d03271-dfa5-5e5c-a775-34fa7ac720a9/attachment.py","path":"tests/integration/test_integration.py","size":7266,"sha256":"63622a2c23fb9cd038ca2dd6a123fb11d44fc053e51225f7751559a2151ee502","contentType":"text/x-python; charset=utf-8"},{"id":"ad3b0dfb-47ae-58ba-a8ab-db684295a84b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ad3b0dfb-47ae-58ba-a8ab-db684295a84b/attachment.py","path":"tests/integration/test_search_quality.py","size":8757,"sha256":"0dc89d410ef4975e01aab52af4abb4430705e5c2e759bf7b77a0342e2cb47fdb","contentType":"text/x-python; charset=utf-8"},{"id":"58f8a8a4-7562-5c91-bef2-673ca7254a36","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/58f8a8a4-7562-5c91-bef2-673ca7254a36/attachment.py","path":"tests/maintenance/__init__.py","size":0,"sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","contentType":"text/x-python; charset=utf-8"},{"id":"eb13561d-6b89-5abe-91e0-cbe5bbe9f572","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/eb13561d-6b89-5abe-91e0-cbe5bbe9f572/attachment.py","path":"tests/maintenance/test_cleanup_drift.py","size":5338,"sha256":"8b77487d5aad497a9ee05a521c3cca613726a2c1bacd2d59943e5448e0770b30","contentType":"text/x-python; charset=utf-8"},{"id":"500fd97f-8458-5940-9320-a0c20891f998","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/500fd97f-8458-5940-9320-a0c20891f998/attachment.py","path":"tests/maintenance/test_cleanup_stale.py","size":4363,"sha256":"4a6272ff34a65294b1bbcabf7fd7a924ac75fb26a9bd1c3071826ab2e2ddd777","contentType":"text/x-python; charset=utf-8"},{"id":"ac217054-7d4b-5e7c-9a7d-5ea4a9b477d4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ac217054-7d4b-5e7c-9a7d-5ea4a9b477d4/attachment.py","path":"tests/maintenance/test_clear_cache.py","size":4195,"sha256":"914b2652b83c24f6bf61f5936cf047817216c32f0cbe143748095f7247cbfca8","contentType":"text/x-python; charset=utf-8"},{"id":"a06f12b4-9eeb-54d2-aa73-60d6f70a5172","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a06f12b4-9eeb-54d2-aa73-60d6f70a5172/attachment.py","path":"tests/maintenance/test_detect_changes.py","size":6135,"sha256":"55bc250286cc2d97ec5486d7e8b43f7a3b9f6291d727c0b1594c3c96fd52b61c","contentType":"text/x-python; charset=utf-8"},{"id":"bde1bcec-f2a4-5e4a-ad95-2bad33623035","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/bde1bcec-f2a4-5e4a-ad95-2bad33623035/attachment.py","path":"tests/maintenance/test_discover_categories.py","size":5237,"sha256":"bc50e170ba96234a14e133e979a672c85ae56333586eb8c2b541d790b956361b","contentType":"text/x-python; charset=utf-8"},{"id":"2d003cc4-782a-5f80-be60-02091604bf0d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/2d003cc4-782a-5f80-be60-02091604bf0d/attachment.py","path":"tests/shared/__init__.py","size":55,"sha256":"676a2652ed1c0f3bf4042f1561ebf1ef0b3e83905f94826c41e4224474ae1bb3","contentType":"text/x-python; charset=utf-8"},{"id":"6c1ed64c-0118-5e0b-a38e-85c3bc87e33e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6c1ed64c-0118-5e0b-a38e-85c3bc87e33e/attachment.py","path":"tests/shared/test_utils.py","size":8437,"sha256":"166d3504bd9b6754d5970af67b056540aee8a6d2d38b74144c33cccf9340bda4","contentType":"text/x-python; charset=utf-8"},{"id":"7298d0aa-c415-56d7-b408-e662c4b84f0f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7298d0aa-c415-56d7-b408-e662c4b84f0f/attachment.py","path":"tests/validation/__init__.py","size":0,"sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","contentType":"text/x-python; charset=utf-8"},{"id":"af1d2fb5-4172-5a89-a011-0352268a9857","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/af1d2fb5-4172-5a89-a011-0352268a9857/attachment.py","path":"tests/validation/test_audit_tag_config.py","size":4217,"sha256":"137373c4b9c10ea067e288bee5ec6d1b6d992dcd823d13dc7170e1384df57f4c","contentType":"text/x-python; charset=utf-8"},{"id":"6de9278a-32e0-5e8f-ad60-c278efa1bc7d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6de9278a-32e0-5e8f-ad60-c278efa1bc7d/attachment.py","path":"tests/validation/test_quick_validate.py","size":6719,"sha256":"e3b66b795e9186bc905cf8c73e7e46a3eb4e5b165f7e4942056fead0a813146e","contentType":"text/x-python; charset=utf-8"},{"id":"94533713-2e56-567a-8cc6-11a744eea228","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/94533713-2e56-567a-8cc6-11a744eea228/attachment.py","path":"tests/validation/test_validate_scraped_docs.py","size":7282,"sha256":"0d27fca9ea7c66ea50a3167bacfecc8a05db45e68a0aac9e96e58cdb9e57d16d","contentType":"text/x-python; charset=utf-8"},{"id":"e1221792-9be0-5d9f-b988-c59a4c70de72","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e1221792-9be0-5d9f-b988-c59a4c70de72/attachment.py","path":"validation/__init__.py","size":47,"sha256":"8c66e0e9c1eceb5c35b247022b6b10ae082785c4ab33b4cb4217062acf93f574","contentType":"text/x-python; charset=utf-8"},{"id":"23a2bb65-1314-5071-83a5-8f85cd999bad","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/23a2bb65-1314-5071-83a5-8f85cd999bad/attachment.py","path":"validation/validate_index_vs_docs.py","size":11419,"sha256":"03667f0e57b4ae7348f6b2ecf3ad1e65e2b6a5274f3cfa6b9a4103bd3e71639b","contentType":"text/x-python; charset=utf-8"},{"id":"86d5143e-8b53-540e-bece-864927b8285d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/86d5143e-8b53-540e-bece-864927b8285d/attachment.py","path":"validation/verify_index.py","size":6505,"sha256":"3943b506809706ef21197497f744aae31741a2c51d036c7ce6718acc830c48f9","contentType":"text/x-python; charset=utf-8"}],"bundle_sha256":"974ab8320f8ffce408be266f1c56c95e29560acb3cbab006f58b94fe54fdaea1","attachment_count":219,"text_attachments":219,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"plugins/google-ecosystem/skills/gemini-cli-docs/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"browser-automation-scraping","category_label":"Browser"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"browser-automation-scraping","import_tag":"clean-skills-v1","description":"Single source of truth and librarian for ALL Gemini CLI documentation. Manages local documentation storage, scraping, discovery, and resolution. Use when finding, locating, searching, or resolving Gemini CLI documentation; discovering docs by keywords, category, tags, or natural language queries; scraping from llms.txt; managing index metadata (keywords, tags, aliases); or rebuilding index from filesystem. Run scripts to scrape, find, and resolve documentation. Handles doc_id resolution, keyword search, natural language queries, category/tag filtering, alias resolution, llms.txt parsing, markdown subsection extraction for internal use, hash-based drift detection, and comprehensive index maintenance.","allowed-tools":"Read, Glob, Grep, Bash"}},"renderedAt":1782979368916}

Gemini CLI Documentation Skill CRITICAL: Path Doubling Prevention - MANDATORY ABSOLUTE PROHIBITION: NEVER use with in PowerShell when running scripts from this skill. The Problem: If your current working directory is already inside the skill directory, using relative paths causes PowerShell to resolve paths relative to the current directory instead of the repository root, resulting in path doubling. REQUIRED Solutions (choose one): 1. ALWAYS use absolute paths (recommended) 2. Use separate commands (never with ) 3. Run from repository root with relative paths NEVER DO THIS: - Chain with : cau…