Files
app-opencode/README.md
2026-07-02 15:13:09 +02:00

52 lines
1.2 KiB
Markdown

# app-opencode-experiment
[opencode](https://opencode.ai/) in a Docker container, wired to [weave](https://weave.redpencil.io) as the model provider. Default model `weave/glm-5.2`. LSP baked in for TypeScript/JS and Python.
## Setup
Create a `docker-compose.override.yml` (gitignored) with your weave key and repo mount:
```yaml
services:
opencode:
environment:
WEAVE_API_KEY: "..."
volumes:
- /path/to/your/repo:/workspace/repo
```
Then:
```
drc up -d
drc exec opencode opencode
```
## TUI
In the TUI, type `/models` to select a model from the registered weave models.
## Layout
- `config/opencode/` - image: Dockerfile + `opencode.json` (mounted live, see below)
- `data/` - persisted opencode state (gitignored)
- `docker-compose.yml` - opencode service
## Updating the config
`opencode.json` is mounted into the container, so edits take effect with a restart — no rebuild needed:
```
drc restart opencode
```
Rebuild only when changing the `Dockerfile` or installed packages:
```
drc build opencode
```
## Caveats
- Copy from the TUI is weird over Docker: To copy text out of the opencode TUI running in a container, I have to do `Shift`+click to select the text, then `Ctrl`+`Shift`+`C` to copy. Plain `COPY` doesn't work.