Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Add section on opencode agent (#8567)

vincent d warmerdam7a0ad6c67201
diff --git a/docs/guides/editor_features/agents.md b/docs/guides/editor_features/agents.md
index ebb5a33efc..0b84f1e1ea 100644
--- a/docs/guides/editor_features/agents.md
+++ b/docs/guides/editor_features/agents.md
@@ -90,6 +90,61 @@ codex
npx stdio-to-ws "cmd /c npx @zed-industries/codex-acp" --port 3021
```
+### OpenCode Agent
+
+[OpenCode](https://opencode.ai/) is an open source AI coding agent built for the terminal, but also supports ACP.
+
+**Installation:**
+
+```bash
+# Install
+npm install -g opencode-ai@latest
+
+# You can now use and configure opencode from the commandline
+opencode
+```
+
+**Connection command:**
+
+=== "macOS/Linux"
+
+ ```bash
+ npx stdio-to-ws "npx opencode-ai acp" --port 3023
+ ```
+
+=== "Windows"
+
+ ```bash
+ npx stdio-to-ws "cmd /c npx opencode-ai acp" --port 3023
+ ```
+
+
+Opencode supports many models, including local ones through Ollama, and can be configured via a [configuration file](https://opencode.ai/docs/config/).
+
+```json
+{
+ "$schema": "https://opencode.ai/config.json",
+ "provider": {
+ "ollama": {
+ "npm": "@ai-sdk/openai-compatible",
+ "options": {
+ "baseURL": "http://localhost:11434/v1"
+ },
+ "models": {
+ "<model_name>": {
+ "tools": true
+ }
+ }
+ }
+ }
+}
+```
+
+If you choose to use a local model with Ollama, make sure that you set the maximum context length to be much higher than the 4K default. [This video tutorial](https://www.youtube.com/watch?v=4hUI2GF90nQ) explains how to set this up.
+
+Opencode can also be configured to use remote models like those hosted by [OpenRouter](https://openrouter.ai/) or via [the Zen service](https://opencode.ai/docs/zen/). For more information on configuring OpenCode providers, see the [provider documentation](https://opencode.ai/docs/providers).
+
+
## Connecting to an agent
1. **Start the agent server**: Run the connection command for your chosen agent in a terminal