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
- Before you start
- Zed
- JetBrains IDEs
- Trust
- Signing in from the editor
- Approvals
- Choosing an agent
- Limits
- If something goes wrong
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
- Install the CLI and note its full path:
which astracode-agent(orwhere astracode-agenton Windows). - Sign in once in a terminal with
astracode-agent login, or setASTRACODE_API_KEYwhere the editor will see it. You can also sign in from the editor when it asks. - Decide how to trust your projects (below). Without trust, the agent reads and answers but cannot edit or run commands.
Zed
- Open Zed's
settings.jsonand add the entry below. - Open the agent panel and pick AstraCode.
settings.json (Zed)
{
"agent_servers": {
"AstraCode": {
"type": "custom",
"command": "astracode-agent",
"args": ["acp"]
}
}
}
JetBrains IDEs
- In the AI Chat tool window, choose Add Custom Agent. It opens
~/.jetbrains/acp.json. - Add the entry below, with the full path
which astracode-agentprinted. - 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:
| Way | Covers | How |
|---|---|---|
| Trust it once in a terminal | That folder, from now on | Run astracode-agent in the folder and answer Yes, I trust this folder. It is added to trustedFolders, which acp reads. |
--trust in the args | Every folder the editor opens | "args": ["acp", "--trust"] |
ASTRACODE_TRUST=1 | Every folder, wherever the variable is set | Set it in the agent entry's environment (Zed accepts an env object) or the editor's. |
--trustandASTRACODE_TRUST=1trust 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
- Images and audio are not accepted in a prompt.
- A saved session cannot be loaded again; each session starts fresh.
- One run at a time per session; a new prompt waits for the current run.
- MCP servers from your CLI settings file are not started, and there are no memories. Language-server lookups and the code index need the AstraCode editor.
astracode-agent undo, run in the folder, takes back anacprun's changes.
If something goes wrong
- The agent says an edit is disabled in an untrusted folder: trust the folder as above.
- The editor cannot start the agent: use the full path to
astracode-agentincommand; editors started from a desktop menu often do not have your shell's PATH. - Sign-in loops: sign in once in a terminal with
astracode-agent login, then restart the agent in the editor. - Everything else: CLI problems.
← Reviewing a branch CLI reference →
All documentation
Get started
Using the editor
- Tab completion
- Edit and ask about a selection
- Reviewing the agent's changes
- Git: commit messages, branch review and conflicts
- Dictation
- Layout, themes and the settings page
Agent
- Agent overview
- Agent, Plan, Ask and Debug
- Approvals and permissions
- Plan mode
- Debug mode
- Tools
- Browser tools
- How the agent checks its work
- Checkpoints and undo
- Running several agents at once
- Subagents and background tasks
- Remote agents in GitHub Actions
- Infrastructure as code
Context
Workspaces
Connectors
- Connectors (MCP servers)
- Connector configuration reference
- Use AstraCode from Claude, ChatGPT and other apps
Extending AstraCode
CLI
Account and usage
- Usage and limits
- Bring your own key
- What AstraCode sends and keeps
- Reporting a problem and getting help
Troubleshooting
- Troubleshooting
- Sign-in problems
- Install and update problems
- Chat panel problems
- Agent run problems
- Connector problems
- Dictation problems
- Usage, billing and network errors
- CLI problems