> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mossx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode

> Configure OpenCode CLI, local opencode.json, or a third-party provider.

OpenCode uses local `opencode`. Open **Settings → CLI configuration → OpenCode CLI** to detect the version, install, and configure credentials.

## How to connect

1. **Use local config**: read `~/.config/opencode/opencode.json` (`.jsonc` is also supported). `$OPENCODE_CONFIG` wins
2. **Add provider**: name, base URL, API key, model list
3. You can override the `opencode` executable path
4. You can move this engine to **Disabled** so it no longer appears in the input
5. If it is not installed, click **Install** on that page, or install with the terminal commands below

OpenCode hosted providers use env injection and **do not** change `opencode.json`. Login and sessions still follow OpenCode's own config.

<Note>
  Config stays on this computer. The app does not upload keys to a CC GUI server.
</Note>

## Add a provider

Click **Add** and fill in:

* Name, base URL, API key
* Model list (comma-separated; leave empty for no limit)
* Optional: notes

Quick preset: OpenCode Zen (official).

## Install

```bash theme={null}
curl -fsSL https://opencode.ai/install | bash
opencode --version
```

Alternative:

```bash theme={null}
npm install -g opencode-ai
```

In-app **Install** previews the fallback `npm install -g opencode-ai`. The app does not uninstall OpenCode, so you do not delete login and session data by accident.

Docs: [https://opencode.ai/docs/](https://opencode.ai/docs/)

## Capability differences

Compared with Claude Code:

* No plan mode
* Does not use desktop MCP
* Supports session continue and image input
* Stop ends the `opencode` child process
* History is isolated per runtime

## When detect fails

See [Detect and install](/en/desktop/providers/cli).

## Next steps

* [Provider overview](/en/desktop/providers/overview)
* [Send the first message](/en/desktop/start/first-task)
