Integrating Code Assistant with Zed using the SourceCraft CLI
Zed is a fast cross-platform open-source editor written in Rust and designed for collaborative development with integrated AI agents.
To integrate Code Assistant with Zed, you need to use the SourceCraft CLI over ACP (Agent Client Protocol).
To use Code Assistant in Zed:
-
Install and configure the SourceCraft CLI.
Warning
Make sure to confirm the OpenCode installation.
-
Install Zed.
-
Connect the SourceCraft CLI to Zed as an external custom AI agent:
GUIConfiguration file- Open Zed settings by pressing Ctrl + , for Windows/Linux or Command + , for macOS.
- Go to AI → General → External Agents → Configure >.
- Click
Add Agent and select Add Custom Agent. - Fill out the fields as follows:
-
Agent Name: Agent name, e.g.,
SourceCraft Code Assistant. -
Command: Path to the SourceCraft CLI executable, such as the following:
- In Linux:
/home/<username>/sourcecraft/bin/src - In macOS:
/Users/<username>/sourcecraft/bin/src - In Windows:
C:\Users\<username>\AppData\Local\Programs\src\src.exe
- In Linux:
-
Arguments: Settings for running OpenCode from the SourceCraft CLI in ACP mode:
code -- acp. -
Environment Variables: Leave empty.
-
- Click Save and close the settings window.
-
Open the
settings.jsonZed configuration file by pressing Ctrl + Alt + , for Windows or Linux or Command + Option + , for macOS. -
Add the
agent_serverssection:{ "agent_servers": { "SourceCraftCA": { "type": "custom", "command": "<path_to_SourceCraft_CLI_executable>", "args": [ "code", "--", "acp" ], "default_config_options": { "mode": "plan" } } } }Where
commandis the path to the SourceCraft CLI executable, such as the following:- In Linux:
/home/<username>/sourcecraft/bin/src - In macOS:
/Users/<username>/sourcecraft/bin/src - In Windows:
C:\Users\<username>\AppData\Local\Programs\src\src.exe
- In Linux:
-
Save your changes.
-
Open the agent panel by pressing Ctrl + Alt + B for Windows or Linux or Command + B for macOS, click
on top of the panel, and select the externalSourceCraft Code Assistantagent. -
Test the agent by typing a prompt in the chat window.