Devcontainers
このコンテンツはまだ日本語訳がありません。
Devcontainers is a community plugin (not built by or affiliated with the OpenCode team) for isolated branch workspaces, currently at version 0.x — pre-1.0 software where minor versions may contain breaking changes.
Why devcontainers or worktrees?
| Option | Isolation | Best for |
|---|---|---|
| Devcontainers | Full container isolation | Different dependencies, databases, runtimes per branch |
| Git worktrees | Lightweight filesystem isolation | Same dependencies, just different code |
Key features
| Feature | Description |
|---|---|
| Session state management | The agent remembers your workspace |
| Auto-assigned ports | From a configurable range (13000–13099) |
| Secrets copying | Automatically copies gitignored secrets (.env, credentials, etc.) |
| Unified management | Workspace creation and cleanup in one place |
Installation
Add to ~/.config/opencode/opencode.json:
{
"plugin": ["opencode-devcontainers"]
}