Skip to content

feat: opencode - #2

Open
BhautikChudasama wants to merge 7 commits into
feat/pifrom
feat/opencode
Open

feat: opencode#2
BhautikChudasama wants to merge 7 commits into
feat/pifrom
feat/opencode

Conversation

@BhautikChudasama

@BhautikChudasama BhautikChudasama commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds packages/opencode-plugin/ — OpenCode plugin with 33 sandbox tools that route commands to remote CreateOS Sandboxes.

Install

# From npm (global)
opencode plugin @createos/opencode --global

Local development

cd packages/opencode-plugin && bun install
mkdir -p .opencode/plugins
opencode

Usage

> create a sandbox and run hostname
⚙ sandbox_exec [command=hostname]
competent-euclid-87d3

> list sandbox shapes
⚙ sandbox_shapes
[{"name":"s-2vcpu-2gb",...}]

> start nginx and get the preview URL
⚙ sandbox_exec [command=apt install -y nginx && nginx]
⚙ sandbox_preview_url [port=80]
https://sb-xxx-80.ingress.createos.sh

Stacked on

@BhautikChudasama
BhautikChudasama force-pushed the feat/opencode branch 2 times, most recently from a27da8b to 65cd144 Compare August 5, 2026 10:36
@BhautikChudasama BhautikChudasama mentioned this pull request Aug 5, 2026
@BhautikChudasama BhautikChudasama changed the title feat(opencode): add OpenCode plugin with 40 sandbox tools feat: opencode Aug 5, 2026
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)
…dit/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.
The CLI now expects `<network> <sandbox|device>` instead of
`<sandbox|device> <network>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant