Skip to content

Commit 0ccabeb

Browse files
elithrarOpenCoderekram1-node
authored andcommitted
docs: add compaction, watcher, experimental and provider options (anomalyco#6304)
Co-authored-by: OpenCode <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
1 parent f95535f commit 0ccabeb

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

packages/web/src/content/docs/config.mdx

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ You can configure TUI-specific settings through the `tui` option.
106106
"scroll_speed": 3,
107107
"scroll_acceleration": {
108108
"enabled": true
109-
}
109+
},
110+
"diff_style": "auto"
110111
}
111112
}
112113
```
@@ -115,6 +116,7 @@ Available options:
115116

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

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

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

179181
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.
180182

183+
Provider options can include `timeout` and `setCacheKey`:
184+
185+
```json title="opencode.json"
186+
{
187+
"$schema": "https://opencode.ai/config.json",
188+
"provider": {
189+
"anthropic": {
190+
"options": {
191+
"timeout": 600000,
192+
"setCacheKey": true
193+
}
194+
}
195+
}
196+
}
197+
```
198+
199+
- `timeout` - Request timeout in milliseconds (default: 300000). Set to `false` to disable.
200+
- `setCacheKey` - Ensure a cache key is always set for designated provider.
201+
181202
You can also configure [local models](/docs/models#local). [Learn more](/docs/models).
182203

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

364385
---
365386

387+
### Compaction
388+
389+
You can control context compaction behavior through the `compaction` option.
390+
391+
```json title="opencode.json"
392+
{
393+
"$schema": "https://opencode.ai/config.json",
394+
"compaction": {
395+
"auto": true,
396+
"prune": true
397+
}
398+
}
399+
```
400+
401+
- `auto` - Automatically compact the session when context is full (default: `true`).
402+
- `prune` - Remove old tool outputs to save tokens (default: `true`).
403+
404+
---
405+
406+
### Watcher
407+
408+
You can configure file watcher ignore patterns through the `watcher` option.
409+
410+
```json title="opencode.json"
411+
{
412+
"$schema": "https://opencode.ai/config.json",
413+
"watcher": {
414+
"ignore": ["node_modules/**", "dist/**", ".git/**"]
415+
}
416+
}
417+
```
418+
419+
Patterns follow glob syntax. Use this to exclude noisy directories from file watching.
420+
421+
---
422+
366423
### MCP servers
367424

368425
You can configure MCP servers you want to use through the `mcp` option.
@@ -455,6 +512,23 @@ If a provider appears in both `enabled_providers` and `disabled_providers`, the
455512

456513
---
457514

515+
### Experimental
516+
517+
The `experimental` key contains options that are under active development.
518+
519+
```json title="opencode.json"
520+
{
521+
"$schema": "https://opencode.ai/config.json",
522+
"experimental": {}
523+
}
524+
```
525+
526+
:::caution
527+
Experimental options are not stable. They may change or be removed without notice.
528+
:::
529+
530+
---
531+
458532
## Variables
459533

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

0 commit comments

Comments
 (0)