> ## Documentation Index
> Fetch the complete documentation index at: https://ade-ac1c6011-dependabot-github-actions-actions-cache-6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode & Windsurf

> Run OpenCode as a managed agent provider inside ADE — and keep using Windsurf as your editor on the same worktrees.

This page covers two things: **OpenCode**, one of ADE's five agent providers, and how to keep using **Windsurf** as your editor next to ADE.

## OpenCode as a provider

[OpenCode](https://opencode.ai) is one of ADE's five agents, alongside Claude Code, Codex, Cursor, and Factory Droid. ADE runs it as a local server and routes chat and worker turns through it like any other provider. OpenCode gives you the broadest model reach — back it with a provider API key, OpenRouter, or a local model (Ollama, LM Studio, vLLM).

### Setup

<Steps>
  <Step title="Open Settings → AI → OpenCode">
    Turn OpenCode on. ADE downloads the binary if needed and starts the local server.
  </Step>

  <Step title="Configure the backend">
    | Mode           | Config                                                                                       |
    | -------------- | -------------------------------------------------------------------------------------------- |
    | **API key**    | An Anthropic, OpenAI, Google, or other supported key — OpenCode calls the provider directly. |
    | **OpenRouter** | An OpenRouter key for broad model access.                                                    |
    | **Local**      | No key — point at Ollama, LM Studio, or another local endpoint.                              |
  </Step>

  <Step title="Pick OpenCode in chat">
    OpenCode models appear in the model picker alongside the other agents. Choose one to route that session through OpenCode.
  </Step>
</Steps>

<AccordionGroup>
  <Accordion title="How ADE manages OpenCode" icon="gear">
    ADE owns the full lifecycle:

    * **Binary manager** — downloads and verifies the OpenCode binary and checks for updates.
    * **Server manager** — starts and monitors the local server process, detects crashes, and restarts it.
    * **Runtime** — handles session lifecycle, model discovery, and event routing into ADE's chat model.
  </Accordion>

  <Accordion title="Permission modes" icon="shield-halved">
    OpenCode uses its own permission modes:

    | Mode        | Behavior                                         |
    | ----------- | ------------------------------------------------ |
    | `plan`      | Read-only.                                       |
    | `edit`      | Read and write allowed; bash commands are gated. |
    | `full-auto` | Proceeds without asking.                         |

    See [Permissions](/configuration/permissions) for how modes map across providers.
  </Accordion>
</AccordionGroup>

## Using Windsurf alongside ADE

ADE doesn't run [Windsurf](https://windsurf.com) as an agent provider — ADE's five agents are Claude Code, Codex, Cursor, Factory Droid, and OpenCode. But you can still use Windsurf as your editor on the same code, because a lane is just a git worktree on disk.

<Steps>
  <Step title="Find the lane's worktree path">
    Open the lane in ADE; its worktree path is shown in the lane detail header (under `.ade/worktrees/`).
  </Step>

  <Step title="Open that folder in Windsurf">
    Open the worktree directory in Windsurf the way you normally open any project — from Windsurf, or with `windsurf <path>` if its CLI is on your `PATH`.
  </Step>

  <Step title="Edit, and ADE keeps up">
    ADE watches the worktree, so edits you save in Windsurf show up in the lane's diff, Files view, and Git status in real time. Use Windsurf's own AI features in the editor; ADE doesn't route requests through Windsurf.
  </Step>
</Steps>

<Note>
  Edit inside the **lane's worktree** (`.ade/worktrees/<lane>/…`), not the primary checkout — otherwise your changes won't land in that lane's diff.
</Note>

<CardGroup cols={2}>
  <Card title="AI providers" icon="brain" href="/configuration/ai-providers">
    Connect each agent and set defaults.
  </Card>

  <Card title="Agent chat" icon="comments" href="/chat/overview">
    Run OpenCode in a lane and compare it with other providers.
  </Card>
</CardGroup>
