initial commit

This commit is contained in:
felix
2026-07-02 12:54:55 +02:00
commit a52876cd66
6 changed files with 95 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
data/*
!data/.gitkeep
docker-compose.override.yml

35
README.md Normal file
View File

@@ -0,0 +1,35 @@
# app-open-code-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:
```
docker compose up -d
docker compose exec opencode opencode
```
Or a one-shot against a registered model:
```
docker compose exec opencode opencode run --model weave/glm-5.2 "..."
```
## Layout
- `config/opencode/` - image: Dockerfile + baked `opencode.json`
- `data/` - persisted opencode state (gitignored)
- `docker-compose.yml` - opencode service

View File

@@ -0,0 +1,19 @@
FROM node:22-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl ca-certificates python3 \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g \
opencode-ai@1.17.9 \
typescript \
typescript-language-server \
pyright
ENV NODE_PATH=/usr/local/lib/node_modules
COPY opencode.json /root/.config/opencode/opencode.json
WORKDIR /workspace
CMD ["sleep", "infinity"]

View File

@@ -0,0 +1,31 @@
{
"$schema": "https://opencode.ai/config.json",
"model": "weave/glm-5.2",
"small_model": "weave/glm-5.2",
"lsp": {
"typescript": {
"command": ["typescript-language-server", "--stdio"],
"extensions": [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"]
},
"pyright": {
"command": ["pyright-langserver", "--stdio"],
"extensions": [".py", ".pyi"]
}
},
"provider": {
"weave": {
"npm": "@ai-sdk/openai-compatible",
"options": { "baseURL": "https://weave.redpencil.io/v1", "apiKey": "{env:WEAVE_API_KEY}" },
"models": {
"deepinfra/anthropic/claude-4-opus": { "tools": true },
"glm-5.2": { "tools": true }
}
}
},
"permission": {
"read": "allow",
"edit": "allow",
"bash": "allow",
"external_directory": "allow"
}
}

0
data/.gitkeep Normal file
View File

7
docker-compose.yml Normal file
View File

@@ -0,0 +1,7 @@
version: '3.7'
services:
opencode:
build: ./config/opencode/
volumes:
- ./data/opencode/share:/root/.local/share/opencode