Commit 70aa489
feat: opencode (#2)
* feat(opencode): add OpenCode plugin with 40 sandbox tools
Port the Pi extension's CreateOS Sandbox integration to OpenCode's plugin
system. The plugin registers 40 tools (sandbox_exec, sandbox_pull,
sandbox_push, lifecycle, networks, disks, VPN, sync) and injects a
Pi-style system prompt into all agents directing them to use sandbox_exec
for all shell commands.
Key differences from Pi:
- Cannot replace built-in tools (bash/read/write) — uses system prompt
injection via config hook instead
- Uses child_process.execSync instead of OpenCode's $ shell (routing fix)
- Lazy sandbox creation on first tool call
- No TUI integration (OpenCode limitation)
* refactor(opencode): remove built-in tool overrides (bash/read/write/edit/ls/find/grep)
OpenCode cannot replace built-in tools — having duplicate names just confuses
the LLM. Keep only sandbox_* prefixed tools (33 total). The plugin shim in
.opencode/plugins/createos.ts already uses sandbox_exec/pull/push directly.
* docs: update tool count to 33, remove stray files
* chore: rename claude-code-plugin to @createos/claude-code
* chore: apply lint fixes across opencode plugin
* chore: remove accidentally committed node_modules
* fix(opencode): swap network attach/detach arg order to match CLI
The CLI now expects `<network> <sandbox|device>` instead of
`<sandbox|device> <network>`.
---------
Co-authored-by: pratikbin <68642400+pratikbin@users.noreply.github.com>1 parent fc0ac9a commit 70aa489
16 files changed
Lines changed: 2473 additions & 40 deletions
File tree
- .claude-plugin
- .opencode/plugins
- docs/plans
- packages
- claude-code-plugin/.claude-plugin
- opencode-plugin
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
0 commit comments