Skip to main content

Module 28: Zed Integration

Run your Java ACP agent inside the Zed editor.

What You’ll Learn

  • Building an agent JAR for editor integration
  • Configuring Zed to launch your agent
  • The stdio transport mechanism editors use to communicate with agents

Prerequisites

  • Zed editor installed
  • Java 17+
  • Agent JAR built (see below)

The Agent

The agent is the same sync builder pattern from Module 12, with conversational responses:
Logging goes to stderr because Zed captures stdout for the JSON-RPC protocol.

Build and Configure

1. Build the JAR

2. Get the absolute path

3. Configure Zed

Open Zed settings (Ctrl+, on Linux, Cmd+, on Mac) and add:

4. Use in Zed

Open the Agent Panel (Ctrl+?), click +, select Java Tutorial Agent, and start chatting.

How It Works

Zed launches your agent as a subprocess and communicates via JSON-RPC over stdio. This is the same mechanism used by LSP language servers. Your agent receives initialize, session/new, and session/prompt requests, and responds with JSON-RPC responses and notifications. No code changes are needed for different editors. The same JAR works in Zed, JetBrains, and VS Code.

Source Code

View on GitHub

Running the Example

Next Module

Module 29: JetBrains Integration — configure the same agent for IntelliJ, PyCharm, and other JetBrains IDEs.