Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 75 additions & 1 deletion packages/web/src/content/docs/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ You can configure TUI-specific settings through the `tui` option.
"scroll_speed": 3,
"scroll_acceleration": {
"enabled": true
}
},
"diff_style": "auto"
}
}
```
Expand All @@ -115,6 +116,7 @@ Available options:

- `scroll_acceleration.enabled` - Enable macOS-style scroll acceleration. **Takes precedence over `scroll_speed`.**
- `scroll_speed` - Custom scroll speed multiplier (default: `1`, minimum: `1`). Ignored if `scroll_acceleration.enabled` is `true`.
- `diff_style` - Control diff rendering. `"auto"` adapts to terminal width, `"stacked"` always shows single column.

[Learn more about using the TUI here](/docs/tui).

Expand Down Expand Up @@ -178,6 +180,25 @@ You can configure the providers and models you want to use in your OpenCode conf

The `small_model` option configures a separate model for lightweight tasks like title generation. By default, OpenCode tries to use a cheaper model if one is available from your provider, otherwise it falls back to your main model.

Provider options can include `timeout` and `setCacheKey`:

```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"anthropic": {
"options": {
"timeout": 600000,
"setCacheKey": true
}
}
}
}
```

- `timeout` - Request timeout in milliseconds (default: 300000). Set to `false` to disable.
- `setCacheKey` - Ensure a cache key is always set for designated provider.

You can also configure [local models](/docs/models#local). [Learn more](/docs/models).

---
Expand Down Expand Up @@ -363,6 +384,42 @@ For example, to ensure that the `edit` and `bash` tools require user approval:

---

### Compaction

You can control context compaction behavior through the `compaction` option.

```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"compaction": {
"auto": true,
"prune": true
}
}
```

- `auto` - Automatically compact the session when context is full (default: `true`).
- `prune` - Remove old tool outputs to save tokens (default: `true`).

---

### Watcher

You can configure file watcher ignore patterns through the `watcher` option.

```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"watcher": {
"ignore": ["node_modules/**", "dist/**", ".git/**"]
}
}
```

Patterns follow glob syntax. Use this to exclude noisy directories from file watching.

---

### MCP servers

You can configure MCP servers you want to use through the `mcp` option.
Expand Down Expand Up @@ -438,6 +495,23 @@ If a provider appears in both `enabled_providers` and `disabled_providers`, the

---

### Experimental

The `experimental` key contains options that are under active development.

```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"experimental": {}
}
```

:::caution
Experimental options are not stable. They may change or be removed without notice.
:::

---

## Variables

You can use variable substitution in your config files to reference environment variables and file contents.
Expand Down