OpenCode CLI
An open-source command-line tool for agentic coding with any model provider.
Usage
{
"features": {
"ghcr.io/hansehart/devcontainer-features/opencode:1": {}
}
}Version 1.0.1, see the changelog for what changed.
Options
| Option | Default | Description |
|---|---|---|
version | latest | Channel (latest), a release line (major or major.minor), or an exact version (major.minor.patch). |
stateDir | If set, puts this feature's data at this path, which must be inside the remote user's home. Mount a volume there to persist it across rebuilds. |
Customizations
Open Secure Software Suite
The hosts the tool reaches:
| Host | Ports | Secret | For |
|---|---|---|---|
opencode.ai | 443 | OPENCODE_API_KEY | OpenCode Zen inference |
models.opencode.ai | 443 | The model catalog |
The variables that set its defaults:
| Variable | Value | For |
|---|---|---|
OPENCODE_DISABLE_AUTOUPDATE | 1 | With 1, updates stay off |
OPENCODE_CONFIG_DIR | ${stateDir} | OpenCode's config in the state dir |
OPENCODE_DB | ${stateDir}/opencode.db | OpenCode's sessions and sign-ins in the state dir |
The config files it reads:
| File | Path | For |
|---|---|---|
opencode.json | ${stateDir}/opencode.json | The agent's rules and integrations |
VS Code
The extensions it installs: