From b27402bea32e9dd635d55a7c23939070870e70a9 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 21 Aug 2025 11:47:15 -0600 Subject: [PATCH 01/12] docs --- docs/src/SUMMARY.md | 1 + docs/src/ai/agent-panel.md | 7 ++++--- docs/src/ai/gemini-cli.md | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 docs/src/ai/gemini-cli.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 251cad6234..2404bafa46 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -47,6 +47,7 @@ - [Overview](./ai/overview.md) - [Agent Panel](./ai/agent-panel.md) - [Tools](./ai/tools.md) + - [Gemini CLI](./ai/gemini-cli.md) - [Inline Assistant](./ai/inline-assistant.md) - [Edit Prediction](./ai/edit-prediction.md) - [Text Threads](./ai/text-threads.md) diff --git a/docs/src/ai/agent-panel.md b/docs/src/ai/agent-panel.md index f944eb88b0..6caa2047d2 100644 --- a/docs/src/ai/agent-panel.md +++ b/docs/src/ai/agent-panel.md @@ -8,7 +8,8 @@ If you're using the Agent Panel for the first time, you need to have at least on You can do that by: 1. [subscribing to our Pro plan](https://zed.dev/pricing), so you have access to our hosted models -2. or by [bringing your own API keys](./llm-providers.md#use-your-own-keys) for your desired provider +2. [bringing your own API keys](./llm-providers.md#use-your-own-keys) for your desired provider +3. Using [Gemini CLI](./gemini-cli.md) through the Zed Agent Panel. ## Overview {#overview} @@ -71,9 +72,9 @@ So, if your active tab had edits made by the AI, you'll see diffs with the same Although Zed's agent is very efficient at reading through your code base to autonomously pick up relevant files, directories, and other context, manually adding context is still encouraged as a way to speed up and improve the AI's response quality. If you have a tab open while using the Agent Panel, that tab appears as a suggested context in form of a dashed button. -You can also add other forms of context by either mentioning them with `@` or hitting the `+` icon button. +You can also add other forms of context by mentioning them by typing `@` in the editor. -You can even add previous threads as context by mentioning them with `@thread`, or by selecting the "New From Summary" option from the `+` menu to continue a longer conversation, keeping it within the context window. +You can include files with `@files`, symbols with `@symbol`, previous Agent Panel threads with `@thread` or fetch from the web with `@fetch`. Pasting images as context is also supported by the Agent Panel. diff --git a/docs/src/ai/gemini-cli.md b/docs/src/ai/gemini-cli.md new file mode 100644 index 0000000000..ee1c771f0b --- /dev/null +++ b/docs/src/ai/gemini-cli.md @@ -0,0 +1,23 @@ +# Gemini CLI + +Zed provides the ability to run Gemini CLI directly in our [Agent Panel](./agent-panel.md). + +Under the hood we run Gemini CLI in the background, and talk to it over [ACP](TODO TODO). This means that you're running the real Gemini CLI, with all of the advantages of that, but you can see and interact with files in your editor. + +## Getting Started + +The Gemini integration should be enabled by default, run `agent: new gemini cli thread`. + +If you don't yet have Gemini CLI installed, then Zed will install a version for you. If you do, then we will use the version of Gemini on your path. + +If it is too old, you will see an error message, and you will have to upgrade Gemini. The instructions depend on how you originally installed it, but typically `npm install -g gemini-cli@preview` should work. + +After you have Gemini running, you'll be prompted to choose your authentication method. Most users should click "Log in with Google", but if you have an API key already you can also click "Use Gemini API Key". The "Vertex AI" option is for those who are using Vertex AI, and have already configured their environment correctly. + +For more information, see the [Gemini docs](TODO TODO) + +## Usage + +Similar to the built in agent, you can use Gemini CLI to do anything that you need. You can @-mention files, recent conversations, symbols, or fetch the web. + +In the initial version, Gemini CLI does not support editing previous messages. We hope to add this ability soon. From a2b0c3531e12bf51f1bb3c7ccd05f50b498d7a39 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Fri, 22 Aug 2025 20:38:03 -0300 Subject: [PATCH 02/12] Content tweaks --- docs/src/ai/agent-panel.md | 2 +- docs/src/ai/gemini-cli.md | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/src/ai/agent-panel.md b/docs/src/ai/agent-panel.md index 6caa2047d2..9e997de7ed 100644 --- a/docs/src/ai/agent-panel.md +++ b/docs/src/ai/agent-panel.md @@ -9,7 +9,7 @@ You can do that by: 1. [subscribing to our Pro plan](https://zed.dev/pricing), so you have access to our hosted models 2. [bringing your own API keys](./llm-providers.md#use-your-own-keys) for your desired provider -3. Using [Gemini CLI](./gemini-cli.md) through the Zed Agent Panel. +3. using an external agent like [Gemini CLI](./gemini-cli.md) ## Overview {#overview} diff --git a/docs/src/ai/gemini-cli.md b/docs/src/ai/gemini-cli.md index ee1c771f0b..5dffe3661b 100644 --- a/docs/src/ai/gemini-cli.md +++ b/docs/src/ai/gemini-cli.md @@ -2,22 +2,29 @@ Zed provides the ability to run Gemini CLI directly in our [Agent Panel](./agent-panel.md). -Under the hood we run Gemini CLI in the background, and talk to it over [ACP](TODO TODO). This means that you're running the real Gemini CLI, with all of the advantages of that, but you can see and interact with files in your editor. +Under the hood we run Gemini CLI in the background, and talk to it over the [Agent Client Protocol (ACP)](https://agentclientprotocol.com). +This means that you're running the real Gemini CLI, with all of the advantages of that, but you can see and interact with files in your editor. ## Getting Started The Gemini integration should be enabled by default, run `agent: new gemini cli thread`. -If you don't yet have Gemini CLI installed, then Zed will install a version for you. If you do, then we will use the version of Gemini on your path. +If you don't yet have Gemini CLI installed, then Zed will install a version for you. +If you do, then we will use the version of Gemini on your path. -If it is too old, you will see an error message, and you will have to upgrade Gemini. The instructions depend on how you originally installed it, but typically `npm install -g gemini-cli@preview` should work. +If it is too old, you will see an error message, and you will have to upgrade Gemini. +The instructions depend on how you originally installed it, but typically `npm install -g gemini-cli@preview` should work. -After you have Gemini running, you'll be prompted to choose your authentication method. Most users should click "Log in with Google", but if you have an API key already you can also click "Use Gemini API Key". The "Vertex AI" option is for those who are using Vertex AI, and have already configured their environment correctly. +After you have Gemini CLI running, you'll be prompted to choose your authentication method. +Most users should click "Log in with Google", but if you have an API key already you can also click "Use Gemini API Key". +The "Vertex AI" option is for those who are using Vertex AI, and have already configured their environment correctly. -For more information, see the [Gemini docs](TODO TODO) +For more information, see the [Gemini CLI docs](TODO TODO). ## Usage -Similar to the built in agent, you can use Gemini CLI to do anything that you need. You can @-mention files, recent conversations, symbols, or fetch the web. +Similar to the built-in agent in [the agent panel](./agent-panel.md), you can use Gemini CLI to do anything that you need. +You can @-mention files, recent conversations, symbols, or fetch the web. -In the initial version, Gemini CLI does not support editing previous messages. We hope to add this ability soon. +In this initial version, Gemini CLI does not support editing previous messages. +We hope to add this ability soon. From 2c745ed823a70e6dbbf80d23efac1467359061cb Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Mon, 25 Aug 2025 11:07:36 -0300 Subject: [PATCH 03/12] Note that not all agent panel features work for external agents --- docs/src/ai/agent-panel.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/src/ai/agent-panel.md b/docs/src/ai/agent-panel.md index 9e997de7ed..c310127590 100644 --- a/docs/src/ai/agent-panel.md +++ b/docs/src/ai/agent-panel.md @@ -1,10 +1,10 @@ # Agent Panel -The Agent Panel provides you with a surface to interact with LLMs, enabling various types of tasks, such as generating code, asking questions about your codebase, and general inquiries like emails, documentation, and more. +The Agent Panel allows you to interact with many LLMs and coding agents that can support you in various types of tasks, such as generating code, codebase understanding, and other general inquiries like writing emails, documentation, and more. To open it, use the `agent: new thread` action in [the Command Palette](../getting-started.md#command-palette) or click the ✨ (sparkles) icon in the status bar. -If you're using the Agent Panel for the first time, you need to have at least one LLM provider configured. +If you're using the Agent Panel for the first time, you need to have at least one LLM or agent provider configured. You can do that by: 1. [subscribing to our Pro plan](https://zed.dev/pricing), so you have access to our hosted models @@ -18,6 +18,9 @@ If you need extra room to type, you can expand the message editor with {#kb agen You should start to see the responses stream in with indications of [which tools](./tools.md) the model is using to fulfill your prompt. +> Note that, currently, not all features outlined below work for external agents, like Gemini CLI. +> Features like checkpoints, token usage display, and model selection may be supported in the future for them. + ### Editing Messages {#editing-messages} Any message that you send to the AI is editable. From 4d1adaa257b63448d3e1e4075a6a169d2ac5dd3f Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Mon, 25 Aug 2025 11:11:51 -0300 Subject: [PATCH 04/12] Update docs to reflect new UI --- docs/src/ai/agent-panel.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/src/ai/agent-panel.md b/docs/src/ai/agent-panel.md index c310127590..1758a483a5 100644 --- a/docs/src/ai/agent-panel.md +++ b/docs/src/ai/agent-panel.md @@ -34,7 +34,7 @@ The checkpoint button appears even if you interrupt the thread midway through an ### Navigating History {#navigating-history} -To quickly navigate through recently opened threads, use the {#kb agent::ToggleNavigationMenu} binding, when focused on the panel's editor, or click the menu icon button at the top left of the panel to open the dropdown that shows you the six most recent threads. +To quickly navigate through recently opened threads, use the {#kb agent::ToggleNavigationMenu} binding, when focused on the panel's editor, or click the menu icon button at the top right of the panel to open the dropdown that shows you the six most recent threads. The items in this menu function similarly to tabs, and closing them doesn’t delete the thread; instead, it simply removes them from the recent list. @@ -74,16 +74,13 @@ So, if your active tab had edits made by the AI, you'll see diffs with the same Although Zed's agent is very efficient at reading through your code base to autonomously pick up relevant files, directories, and other context, manually adding context is still encouraged as a way to speed up and improve the AI's response quality. -If you have a tab open while using the Agent Panel, that tab appears as a suggested context in form of a dashed button. -You can also add other forms of context by mentioning them by typing `@` in the editor. - -You can include files with `@files`, symbols with `@symbol`, previous Agent Panel threads with `@thread` or fetch from the web with `@fetch`. +To add any file, directory, symbol, previous threads, rules files, or even web pages as context, type `@` to mention them in the editor. Pasting images as context is also supported by the Agent Panel. ### Token Usage {#token-usage} -Zed surfaces how many tokens you are consuming for your currently active thread in the panel's toolbar. +Zed surfaces how many tokens you are consuming for your currently active thread nearby the profile selector in the panel's message editor. Depending on how many pieces of context you add, your token consumption can grow rapidly. With that in mind, once you get close to the model's context window, a banner appears below the message editor suggesting to start a new thread with the current one summarized and added as context. @@ -149,7 +146,7 @@ Zed's UI will inform about this via a warning icon that appears close to the mod ## Text Threads {#text-threads} -["Text threads"](./text-threads.md) present your conversation with the LLM in a different format—as raw text. +["Text Threads"](./text-threads.md) present your conversation with the LLM in a different format—as raw text. With text threads, you have full control over the conversation data. You can remove and edit responses from the LLM, swap roles, and include more context earlier in the conversation. From 1de489a283bd77d986efd3a8b69e06a12f512456 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Mon, 25 Aug 2025 11:17:26 -0300 Subject: [PATCH 05/12] Tweak Gemini CLI page --- docs/src/ai/gemini-cli.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/src/ai/gemini-cli.md b/docs/src/ai/gemini-cli.md index 5dffe3661b..379d300243 100644 --- a/docs/src/ai/gemini-cli.md +++ b/docs/src/ai/gemini-cli.md @@ -1,30 +1,36 @@ # Gemini CLI -Zed provides the ability to run Gemini CLI directly in our [Agent Panel](./agent-panel.md). +Zed provides the ability to run [Gemini CLI](https://github.com/google-gemini/gemini-cli) directly in the [Agent Panel](./agent-panel.md). Under the hood we run Gemini CLI in the background, and talk to it over the [Agent Client Protocol (ACP)](https://agentclientprotocol.com). This means that you're running the real Gemini CLI, with all of the advantages of that, but you can see and interact with files in your editor. ## Getting Started -The Gemini integration should be enabled by default, run `agent: new gemini cli thread`. +The Gemini integration should be enabled by default. +To access it, run `agent: new gemini cli thread`. + +### Installation If you don't yet have Gemini CLI installed, then Zed will install a version for you. -If you do, then we will use the version of Gemini on your path. +If you do, then we will use the version of Gemini CLI on your path. -If it is too old, you will see an error message, and you will have to upgrade Gemini. -The instructions depend on how you originally installed it, but typically `npm install -g gemini-cli@preview` should work. +If the version you haven installed is too old, you will see an error message, and you will have to upgrade Gemini CLI. +The instructions depend on how you originally installed it, but typically, running `npm install -g gemini-cli@preview` should work to fix it. + +### Authentication After you have Gemini CLI running, you'll be prompted to choose your authentication method. -Most users should click "Log in with Google", but if you have an API key already you can also click "Use Gemini API Key". +Most users should click the "Log in with Google" button that will show up in the UI, but if you have an API key already you can also click "Use Gemini API Key". + The "Vertex AI" option is for those who are using Vertex AI, and have already configured their environment correctly. -For more information, see the [Gemini CLI docs](TODO TODO). +For more information, see the [Gemini CLI docs](https://github.com/google-gemini/gemini-cli/blob/main/docs/index.md). ## Usage Similar to the built-in agent in [the agent panel](./agent-panel.md), you can use Gemini CLI to do anything that you need. You can @-mention files, recent conversations, symbols, or fetch the web. -In this initial version, Gemini CLI does not support editing previous messages. -We hope to add this ability soon. +In this initial version, some features supported by the first-party agent are not avaialble for Gemini CLI. +Capacities such as editing previous messages, checkpoints, profile selection, and others should hopefully be added in the future. From a570fe9692a5455005a9f2b2fe8bd656e09648e7 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Mon, 25 Aug 2025 17:37:13 -0300 Subject: [PATCH 06/12] Add external agents page + creating new threads section --- docs/src/SUMMARY.md | 2 +- docs/src/ai/agent-panel.md | 10 +++++++++- .../ai/{gemini-cli.md => external-agents.md} | 20 +++++++++++++------ docs/src/ai/overview.md | 2 ++ 4 files changed, 26 insertions(+), 8 deletions(-) rename docs/src/ai/{gemini-cli.md => external-agents.md} (78%) diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 2404bafa46..9d07881914 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -47,7 +47,7 @@ - [Overview](./ai/overview.md) - [Agent Panel](./ai/agent-panel.md) - [Tools](./ai/tools.md) - - [Gemini CLI](./ai/gemini-cli.md) + - [External Agents](./ai/external-agents.md) - [Inline Assistant](./ai/inline-assistant.md) - [Edit Prediction](./ai/edit-prediction.md) - [Text Threads](./ai/text-threads.md) diff --git a/docs/src/ai/agent-panel.md b/docs/src/ai/agent-panel.md index 1758a483a5..f828af825b 100644 --- a/docs/src/ai/agent-panel.md +++ b/docs/src/ai/agent-panel.md @@ -19,7 +19,15 @@ If you need extra room to type, you can expand the message editor with {#kb agen You should start to see the responses stream in with indications of [which tools](./tools.md) the model is using to fulfill your prompt. > Note that, currently, not all features outlined below work for external agents, like Gemini CLI. -> Features like checkpoints, token usage display, and model selection may be supported in the future for them. +> Features like _checkpoints_, _token usage display_, and _model selection_ may be supported in the future for them. + +### Creating New Threads + +The default view for the Agent Panel uses Zed's first-party agent. +Every time that you hit {#kb agent::NewThread}, it creates a new thread using the currently selected agent and view. + +To change that, go to the plus button in the top-right of the Agent Panel and choose another option. +You'll see the option to create a new [Text Thread](./text-threads.md) or, if you have [external agents](/.external-agents.md) connected, to chose new threads with them. ### Editing Messages {#editing-messages} diff --git a/docs/src/ai/gemini-cli.md b/docs/src/ai/external-agents.md similarity index 78% rename from docs/src/ai/gemini-cli.md rename to docs/src/ai/external-agents.md index 379d300243..5fc773e8a5 100644 --- a/docs/src/ai/gemini-cli.md +++ b/docs/src/ai/external-agents.md @@ -1,16 +1,24 @@ -# Gemini CLI +# External Agents -Zed provides the ability to run [Gemini CLI](https://github.com/google-gemini/gemini-cli) directly in the [Agent Panel](./agent-panel.md). +Through the Agent Client Protocol (ACP), Zed can expose external agents that run as a subprocess. + +Read the ACP documentation to learn how to add your agent to Zed. + +At the moment, Zed supports [Gemini CLI](https://github.com/google-gemini/gemini-cli) as a reference implementation of an external agent speaking ACP. + +## Gemini CLI + +Zed provides the ability to run [Gemini CLI](https://github.com/google-gemini/gemini-cli) directly in the [agent panel](./agent-panel.md). Under the hood we run Gemini CLI in the background, and talk to it over the [Agent Client Protocol (ACP)](https://agentclientprotocol.com). This means that you're running the real Gemini CLI, with all of the advantages of that, but you can see and interact with files in your editor. -## Getting Started +### Getting Started The Gemini integration should be enabled by default. To access it, run `agent: new gemini cli thread`. -### Installation +#### Installation If you don't yet have Gemini CLI installed, then Zed will install a version for you. If you do, then we will use the version of Gemini CLI on your path. @@ -18,7 +26,7 @@ If you do, then we will use the version of Gemini CLI on your path. If the version you haven installed is too old, you will see an error message, and you will have to upgrade Gemini CLI. The instructions depend on how you originally installed it, but typically, running `npm install -g gemini-cli@preview` should work to fix it. -### Authentication +#### Authentication After you have Gemini CLI running, you'll be prompted to choose your authentication method. Most users should click the "Log in with Google" button that will show up in the UI, but if you have an API key already you can also click "Use Gemini API Key". @@ -27,7 +35,7 @@ The "Vertex AI" option is for those who are using Vertex AI, and have already co For more information, see the [Gemini CLI docs](https://github.com/google-gemini/gemini-cli/blob/main/docs/index.md). -## Usage +### Usage Similar to the built-in agent in [the agent panel](./agent-panel.md), you can use Gemini CLI to do anything that you need. You can @-mention files, recent conversations, symbols, or fetch the web. diff --git a/docs/src/ai/overview.md b/docs/src/ai/overview.md index 6f081cb243..8bd45240fd 100644 --- a/docs/src/ai/overview.md +++ b/docs/src/ai/overview.md @@ -6,6 +6,8 @@ Learn how to get started using AI with Zed and all its capabilities. - [Configuration](./configuration.md): Learn how to set up different language model providers like Anthropic, OpenAI, Ollama, Google AI, and more. +- [External Agents](./external-agents.md): Learn how to plug in your favorite agent into Zed. + - [Subscription](./subscription.md): Learn about Zed's hosted model service and other billing-related information. - [Privacy and Security](./privacy-and-security.md): Understand how Zed handles privacy and security with AI features. From a02f6bbfc9bcac7f469624c1912fb3aa6ecdc7dd Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Mon, 25 Aug 2025 15:33:01 -0600 Subject: [PATCH 07/12] More detail --- docs/src/ai/agent-panel.md | 2 +- docs/src/ai/external-agents.md | 63 ++++++++++++++++++++++++++-------- 2 files changed, 50 insertions(+), 15 deletions(-) diff --git a/docs/src/ai/agent-panel.md b/docs/src/ai/agent-panel.md index f828af825b..64ece6a108 100644 --- a/docs/src/ai/agent-panel.md +++ b/docs/src/ai/agent-panel.md @@ -9,7 +9,7 @@ You can do that by: 1. [subscribing to our Pro plan](https://zed.dev/pricing), so you have access to our hosted models 2. [bringing your own API keys](./llm-providers.md#use-your-own-keys) for your desired provider -3. using an external agent like [Gemini CLI](./gemini-cli.md) +3. using an external agent like [Gemini CLI](./external-agents.md#gemini-cli) ## Overview {#overview} diff --git a/docs/src/ai/external-agents.md b/docs/src/ai/external-agents.md index 5fc773e8a5..b0829d472f 100644 --- a/docs/src/ai/external-agents.md +++ b/docs/src/ai/external-agents.md @@ -1,35 +1,50 @@ # External Agents -Through the Agent Client Protocol (ACP), Zed can expose external agents that run as a subprocess. - -Read the ACP documentation to learn how to add your agent to Zed. +Zed has support for integrating with existing terminal based agentic coding tools through the [Agent Client Protocol (ACP)](https://agentclientprotocol.com), At the moment, Zed supports [Gemini CLI](https://github.com/google-gemini/gemini-cli) as a reference implementation of an external agent speaking ACP. -## Gemini CLI +You can also [configure your own](#custom-agents) if you'd like to add ACP support to an existing tool. + +## Gemini CLI {#gemini-cli} Zed provides the ability to run [Gemini CLI](https://github.com/google-gemini/gemini-cli) directly in the [agent panel](./agent-panel.md). -Under the hood we run Gemini CLI in the background, and talk to it over the [Agent Client Protocol (ACP)](https://agentclientprotocol.com). +Under the hood we run Gemini CLI in the background, and talk to it over ACP. This means that you're running the real Gemini CLI, with all of the advantages of that, but you can see and interact with files in your editor. ### Getting Started -The Gemini integration should be enabled by default. -To access it, run `agent: new gemini cli thread`. +As of Zed Stable v0.201.5 you should be able to use Gemini CLI directly from Zed. First open the agent panel with {#kb agent::ToggleFocus}, and then use the `+` button in the top right to start a New Gemini CLI thread. + +If you'd like to bind this to a keyboard shortcut, you can do so by editing your keybindings file to include: + +```json +[ + { + "bindings": { + "cmd-alt-g": ["agent::NewExternalAgentThread", { "agent": "gemini" }] + } + } +] +``` #### Installation -If you don't yet have Gemini CLI installed, then Zed will install a version for you. -If you do, then we will use the version of Gemini CLI on your path. +If you don't yet have Gemini CLI installed, then Zed will install a version for you. If you do, then we will use the version of Gemini CLI on your path. -If the version you haven installed is too old, you will see an error message, and you will have to upgrade Gemini CLI. -The instructions depend on how you originally installed it, but typically, running `npm install -g gemini-cli@preview` should work to fix it. +You need to be running at least Gemini version `0.2.0-preview`, and if your version of Gemini is too old you will see an +error message. + +The instructions to upgrade Gemini depend on how you originally installed it, but typically, running `npm install -g gemini-cli@preview` should work. #### Authentication After you have Gemini CLI running, you'll be prompted to choose your authentication method. -Most users should click the "Log in with Google" button that will show up in the UI, but if you have an API key already you can also click "Use Gemini API Key". + +Most users should click the "Log in with Google". This will cause a browser window to pop-up and auth directly with Gemini CLI. Zed does not see your oauth or access tokens in this case. + +You can also use the "Gemini API Key". If you select this, and have the `GEMINI_API_KEY` set, then we will use that. Otherwise Zed will prompt you for an API key which will be stored securely in your keychain, and used to start Gemini CLI from within Zed. The "Vertex AI" option is for those who are using Vertex AI, and have already configured their environment correctly. @@ -38,7 +53,27 @@ For more information, see the [Gemini CLI docs](https://github.com/google-gemini ### Usage Similar to the built-in agent in [the agent panel](./agent-panel.md), you can use Gemini CLI to do anything that you need. + You can @-mention files, recent conversations, symbols, or fetch the web. -In this initial version, some features supported by the first-party agent are not avaialble for Gemini CLI. -Capacities such as editing previous messages, checkpoints, profile selection, and others should hopefully be added in the future. +There are two features that don't yet work with Gemini CLI: editing past messages, which we hope to add support for soon; and resuming a conversation from history. + +## Custom Agents {#custom-agents} + +If you have written (or are writing) a tool that speaks ACP, and you'd like to test it with Zed, you can add it to your settings: + +```json +{ + "agent_servers": { + "Claude Code": { + "command": "node", + "args": [ + "/Users/conrad/projects/claude-code-acp/index.js", + "--acp" + ] + } + } +} +``` + +Zed has some support for debugging acp connections, and you can open the debug view with `dev: open acp logs` from the command line. From 25c40fae52887ee036c5d183e85bdcaf44dd7fb9 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Mon, 25 Aug 2025 19:32:11 -0300 Subject: [PATCH 08/12] Tiny tweaks --- docs/src/ai/external-agents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/ai/external-agents.md b/docs/src/ai/external-agents.md index b0829d472f..9c44b36c5b 100644 --- a/docs/src/ai/external-agents.md +++ b/docs/src/ai/external-agents.md @@ -1,6 +1,6 @@ # External Agents -Zed has support for integrating with existing terminal based agentic coding tools through the [Agent Client Protocol (ACP)](https://agentclientprotocol.com), +Zed has support for integrating with existing terminal-based agentic coding tools through the [Agent Client Protocol (ACP)](https://agentclientprotocol.com). At the moment, Zed supports [Gemini CLI](https://github.com/google-gemini/gemini-cli) as a reference implementation of an external agent speaking ACP. From b69bbaef452eef4c53d92fe08608848365767767 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Tue, 26 Aug 2025 12:55:01 -0300 Subject: [PATCH 09/12] Tweaks to the agent panel page Co-authored-by: Bennet Bo Fenner --- docs/src/ai/agent-panel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/ai/agent-panel.md b/docs/src/ai/agent-panel.md index 64ece6a108..9b39f9abdd 100644 --- a/docs/src/ai/agent-panel.md +++ b/docs/src/ai/agent-panel.md @@ -24,10 +24,10 @@ You should start to see the responses stream in with indications of [which tools ### Creating New Threads The default view for the Agent Panel uses Zed's first-party agent. -Every time that you hit {#kb agent::NewThread}, it creates a new thread using the currently selected agent and view. +Every time that you hit {#kb agent::NewThread}, it creates a new thread using the currently selected agent. To change that, go to the plus button in the top-right of the Agent Panel and choose another option. -You'll see the option to create a new [Text Thread](./text-threads.md) or, if you have [external agents](/.external-agents.md) connected, to chose new threads with them. +You choose to create a new [Text Thread](./text-threads.md) or, if you have [external agents](/.external-agents.md) connected, you can create new threads with them. ### Editing Messages {#editing-messages} From 114662fdab67ebcc0585f88551945ed0db28ea94 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Tue, 26 Aug 2025 12:55:16 -0300 Subject: [PATCH 10/12] Tweaks to the external agents page Co-authored-by: Bennet Bo Fenner --- docs/src/ai/external-agents.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/src/ai/external-agents.md b/docs/src/ai/external-agents.md index 9c44b36c5b..e07ee65304 100644 --- a/docs/src/ai/external-agents.md +++ b/docs/src/ai/external-agents.md @@ -4,7 +4,7 @@ Zed has support for integrating with existing terminal-based agentic coding tool At the moment, Zed supports [Gemini CLI](https://github.com/google-gemini/gemini-cli) as a reference implementation of an external agent speaking ACP. -You can also [configure your own](#custom-agents) if you'd like to add ACP support to an existing tool. +You can also [configure your own](#custom-agents) agent if you'd like to add ACP support to an existing tool. ## Gemini CLI {#gemini-cli} @@ -52,7 +52,7 @@ For more information, see the [Gemini CLI docs](https://github.com/google-gemini ### Usage -Similar to the built-in agent in [the agent panel](./agent-panel.md), you can use Gemini CLI to do anything that you need. +Similar to Zed's first-party agent, you can use Gemini CLI to do anything that you need. You can @-mention files, recent conversations, symbols, or fetch the web. @@ -65,15 +65,13 @@ If you have written (or are writing) a tool that speaks ACP, and you'd like to t ```json { "agent_servers": { - "Claude Code": { + "Custom Agent": { "command": "node", - "args": [ - "/Users/conrad/projects/claude-code-acp/index.js", - "--acp" - ] + "args": ["~/projects/agent/index.js", "--acp"], + "env": {} } } } ``` -Zed has some support for debugging acp connections, and you can open the debug view with `dev: open acp logs` from the command line. +Zed has some support for debugging ACP connections, and you can open the debug view with `dev: open acp logs` from the command palette. From 07fe86f586e82941aa834e393b4e7ba791707255 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Tue, 26 Aug 2025 13:10:45 -0300 Subject: [PATCH 11/12] Make debugging agents section more prominent Co-authored-by: Antonio Scandurra Co-authored-by: Matt Miller Co-authored-by: Bennet Bo Fenner --- docs/src/ai/external-agents.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/src/ai/external-agents.md b/docs/src/ai/external-agents.md index e07ee65304..8e40ea1e6e 100644 --- a/docs/src/ai/external-agents.md +++ b/docs/src/ai/external-agents.md @@ -74,4 +74,6 @@ If you have written (or are writing) a tool that speaks ACP, and you'd like to t } ``` -Zed has some support for debugging ACP connections, and you can open the debug view with `dev: open acp logs` from the command palette. +## Debugging Agents + +When using external agents in Zed, you can access the debug via with `dev: open acp logs` from the Command Palette. From 2fbe2589c77631ae3ef357007e1e1b815dc1d2e3 Mon Sep 17 00:00:00 2001 From: Danilo Leal Date: Tue, 26 Aug 2025 13:40:23 -0300 Subject: [PATCH 12/12] Riff on the external agents page Co-authored-by: Antonio Scandurra Co-authored-by: Bennet Bo Fenner --- docs/src/ai/external-agents.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/src/ai/external-agents.md b/docs/src/ai/external-agents.md index 8e40ea1e6e..c50b1cdc49 100644 --- a/docs/src/ai/external-agents.md +++ b/docs/src/ai/external-agents.md @@ -1,10 +1,8 @@ # External Agents -Zed has support for integrating with existing terminal-based agentic coding tools through the [Agent Client Protocol (ACP)](https://agentclientprotocol.com). +Zed supports terminal-based agentic coding tools through the [Agent Client Protocol (ACP)](https://agentclientprotocol.com). -At the moment, Zed supports [Gemini CLI](https://github.com/google-gemini/gemini-cli) as a reference implementation of an external agent speaking ACP. - -You can also [configure your own](#custom-agents) agent if you'd like to add ACP support to an existing tool. +Currently, [Gemini CLI](https://github.com/google-gemini/gemini-cli) serves as the reference implementation, and you can [add custom ACP-compatible agents](#add-custom-agents) as well. ## Gemini CLI {#gemini-cli} @@ -58,9 +56,9 @@ You can @-mention files, recent conversations, symbols, or fetch the web. There are two features that don't yet work with Gemini CLI: editing past messages, which we hope to add support for soon; and resuming a conversation from history. -## Custom Agents {#custom-agents} +## Add Custom Agents {#add-custom-agents} -If you have written (or are writing) a tool that speaks ACP, and you'd like to test it with Zed, you can add it to your settings: +You can run any agent speaking ACP in Zed by changing your settings as follows: ```json { @@ -74,6 +72,10 @@ If you have written (or are writing) a tool that speaks ACP, and you'd like to t } ``` +This can also be useful if you're in the middle of developing a new agent that speaks the protocol and you want to debug it. + ## Debugging Agents -When using external agents in Zed, you can access the debug via with `dev: open acp logs` from the Command Palette. +When using external agents in Zed, you can access the debug view via with `dev: open acp logs` from the Command Palette. This lets you see the messages being sent and received between Zed and the agent. + +[screenshot here]