Files
dev/docs/integration-zed.md
T
zeekay 901a81abe9 docs: describe this product, and only what it can do
The docs read as OpenAI's Codex CLI: a getting-started page titled for it,
`codex --enable skills` and `code sandbox macos` for commands that do not
exist, defaults given as gpt-5.1-codex-max/openai when they are
zen5-coder/hanzo, a Homebrew page describing a formula we do not publish.

Removed three tui-stream-chunking notes and the execpolicy page: they
document modules and a subcommand that live only in the vendored upstream
copy. There is no execpolicy subcommand and no .codexpolicy loader in
code-rs; the page told users to run something the binary does not have.

Rewrote tui-alternate-screen against the source. It described an
auto/always/never enum and a --no-alt-screen flag; the shipped behavior is a
tui.alternate_screen bool with Ctrl+T, which replays the transcript into
scrollback on the way out — a better answer to Zellij than the one written
down. Genuine openai-provider documentation stays.
2026-08-07 21:51:19 -07:00

3.1 KiB
Raw Blame History

Zed Integration

To point Zed at Dev's ACP server, add this block to settings.json:

{
  "agent_servers": {
    "Dev": {
      "command": "npx",
      "args": ["-y", "@hanzo/dev", "acp"]
    }
  }
}

Adjust the command or args only if you pin a different version or use a globally installed binary.

Zed prerequisites

  • Zed Stable 0.201.5 (released August 27, 2025) or newer adds ACP support with the Agent Panel. Update via Zed → Check for Updates before wiring Dev in. Zed’s docs call out ACP as the mechanism powering Gemini CLI and other external agents.
  • External agents live inside the Agent Panel (cmd-?). Use the + button to start a new thread and pick Dev from the external agent list. Zed runs our CLI as a subprocess over JSON‑RPC, so all prompts and diff previews stay local.
  • Zed installs dependencies per entry automatically. If you keep command = "npx", Zed will download the published @hanzo/dev package the first time you trigger the integration.

How Dev implements ACP

  • The Rust MCP server exposes ACP tools: session/new, session/prompt, and fast interrupts via session/cancel. These are backed by the same conversation manager that powers the TUI, so approvals, confirm guards, and sandbox policies remain intact.
  • Streaming session/update notifications bridge Dev events into Zed. You get Answer/Reasoning updates, shell command progress, approvals, and apply_patch diffs in the Zed UI without losing terminal parity.
  • MCP configuration stays centralized in $CODE_HOME/config.toml. Use [experimental_client_tools] to delegate file read/write and permission requests back to Zed when you want its UI to handle approvals. A minimal setup looks like:
[experimental_client_tools]
request_permission = { mcp_server = "zed", tool_name = "requestPermission" }
read_text_file = { mcp_server = "zed", tool_name = "readTextFile" }
write_text_file = { mcp_server = "zed", tool_name = "writeTextFile" }

Zed wires these tools automatically when you add the Dev agent, so the identifiers above match the defaults.

  • The CLI entry point (npx @hanzo/dev acp) is a thin wrapper over the Rust binary (cargo run -p code-mcp-server -- --stdio) that ships alongside the rest of Dev. Build-from-source workflows plug in by swapping command for an absolute path to that binary.

Tips and troubleshooting

  • Need to inspect the handshake? Run Zed’s dev: open acp logs command from the Command Palette; the log shows JSON‑RPC requests and Dev replies.
  • If prompts hang, make sure no other process is bound to the same MCP port and that your CODE_HOME points to the intended config directory. The ACP server inherits all of Dev’s sandbox settings, so restrictive policies (e.g., approval_policy = "never") still apply.
  • Zed currently skips history restores and checkpoint UI for third-party agents. Stick to the TUI if you rely on those features; ACP support is still evolving upstream.
  • After a session starts, the model selector in Zed lists Dev’s built-in presets (e.g., zen5-coder, enso). Picking a new preset updates the running session immediately, so you don’t have to restart the agent to change models.