Sam Moore's avatarSM

Set up Gemini CLI in Zed (5-min guide)

By Sam Moore 0 comments • about 14 hours ago
  1. Open the Agent Panel
  • In Zed, press cmd-?+Gemini CLI. This uses Zed’s new External Agents flow over ACP. :contentReference[oaicite:12]{index=12}
  1. Install / upgrade Gemini CLI If you don’t have it, Zed can install a compatible version automatically. To install or upgrade yourself:
npm install -g @google/gemini-cli@latest

Zed requires Gemini CLI ≥ 0.2.0; if your version is too old, you’ll see an in-editor warning.

  1. Authenticate

When the Gemini panel opens, pick one:

  • Log in with Google (recommended). Zed launches a browser; tokens are handled by Gemini CLI (Zed doesn’t see your OAuth tokens).
  • API key: set GEMINI_API_KEY, or paste when prompted (securely stored in your OS keychain).
  • Vertex AI: use if your env is already configured.
  1. Optional keybinding

Bind a hotkey to start a new Gemini thread:

[
  {
    "bindings": {
      "cmd-alt-g": ["agent::NewExternalAgentThread", { "agent": "gemini" }]
    }
  }
]
  1. Use Zed like a pro
  • @ mention files, symbols, or prior threads to feed context; the agent can also fetch URLs you provide.
  • Review multi-file diffs and accept granular changes (no copy/paste).
  • Debug agent traffic via Command Palette → dev: open acp logs
  1. Bonus: bring your own agent

Building an ACP-compatible agent? Point Zed at your command with agent_servers:

{
  "agent_servers": {
    "Custom Agent": {
      "command": "node",
      "args": ["~/projects/agent/index.js", "--acp"],
      "env": {}
    }
  }
}

Please sign in to join the discussion.

No comments yet. Be the first to reply!