Docs › CLI › Zed and JetBrains

Zed and JetBrains

Use the AstraCode agent inside Zed or a JetBrains IDE through the Agent Client Protocol, with trust, sign-in and approvals set up.

On this page

astracode-agent acp speaks the Agent Client Protocol, so an editor that runs external agents (Zed, the JetBrains IDEs, and others in the ACP registry) can use AstraCode as its agent. The editor starts the process itself; you do not run it. Each session is a conversation, edits arrive as diffs the editor shows, and the todo list as its plan.

Before you start

  1. Install the CLI and note its full path: which astracode-agent (or where astracode-agent on Windows).
  2. Sign in once in a terminal with astracode-agent login, or set ASTRACODE_API_KEY where the editor will see it. You can also sign in from the editor when it asks.
  3. Decide how to trust your projects (below). Without trust, the agent reads and answers but cannot edit or run commands.

Zed

  1. Open Zed's settings.json and add the entry below.
  2. Open the agent panel and pick AstraCode.

settings.json (Zed)

{
  "agent_servers": {
    "AstraCode": {
      "type": "custom",
      "command": "astracode-agent",
      "args": ["acp"]
    }
  }
}

JetBrains IDEs

  1. In the AI Chat tool window, choose Add Custom Agent. It opens ~/.jetbrains/acp.json.
  2. Add the entry below, with the full path which astracode-agent printed.
  3. Pick AstraCode in AI Chat.

~/.jetbrains/acp.json

{
  "agent_servers": {
    "AstraCode": {
      "command": "/Users/you/.local/bin/astracode-agent",
      "args": ["acp"]
    }
  }
}

Trust

acp treats a folder as untrusted unless told otherwise. Untrusted, edits and terminal commands are refused outright, not asked about, and a read-only command is asked about with a warning. The project's rules, hooks, skills, commands and agents do not load. Trust a folder one of these ways:

WayCoversHow
Trust it once in a terminalThat folder, from now onRun astracode-agent in the folder and answer Yes, I trust this folder. It is added to trustedFolders, which acp reads.
--trust in the argsEvery folder the editor opens"args": ["acp", "--trust"]
ASTRACODE_TRUST=1Every folder, wherever the variable is setSet it in the agent entry's environment (Zed accepts an env object) or the editor's.

--trust and ASTRACODE_TRUST=1 trust every project the editor opens, including a repository you just cloned. Trusting folders one at a time is the safer choice.

Signing in from the editor

When you are not signed in, the editor shows AstraCode's sign-in methods. Sign in to AstraCode opens your browser; where the editor supports it, a second one runs astracode-agent login in a terminal. If the sign-in is not finished, the editor shows Sign-in was not completed. An ASTRACODE_API_KEY in the environment is used without asking.

Approvals

In a trusted folder, reads run without asking; each edit and command is put to you through the editor's permission prompt with Allow, Always allow (for that tool, this session) and Reject. Actions that are confirmed in every mode, such as risky commands, requests to other machines, memories and connector tools that may change something, show their warning and never offer Always allow. Cancel in the editor stops the run.

Choosing an agent

The session has an Agent option: AstraCode, the agent with every tool, or one of your agents from .astracode/agents, .claude/agents, ~/.astracode/agents or ~/.claude/agents. --agent <name> in the args picks one at start, and --agents adds definitions. A project's agent files start the MCP servers they declare only with --allow-agent-mcp.

Limits

If something goes wrong

← Reviewing a branch CLI reference →

All documentation

Get started

Using the editor

Agent

Context

Workspaces

Connectors

Extending AstraCode

CLI

Account and usage

Troubleshooting

Reference