OpenCode Integration
AIO Sandbox includes the OpenCode CLI. OpenCode is an open-source terminal coding agent, so you can run it directly inside the sandbox or launch it through the built-in terminal page.
Access
- Browser: open
http://localhost:8080/opencodeto redirect to the built-in terminal and startopencode - Terminal: run
opencodeinside the container
Environment Variables
You can generate the OpenCode configuration at container startup with environment variables:
OPENCODE_PROVIDER_NPM usually does not need to be set manually. If OPENCODE_BASE_URL contains anthropic, AIO Sandbox uses @ai-sdk/anthropic; otherwise it defaults to @ai-sdk/openai-compatible.
Examples
The default provider is ark, so most setups only need an API key and model ID:
Anthropic-compatible endpoint:
OpenAI-compatible endpoint:
For full customization, pass an OpenCode config JSON with OPENCODE_JSON:
Configuration Priority
OPENCODE_JSONOPENCODE_API_KEY+OPENCODE_MODELand otherOPENCODE_*environment variables- A user-managed
~/.config/opencode/config.json
When OPENCODE_JSON or OPENCODE_API_KEY + OPENCODE_MODEL is set, AIO Sandbox writes ~/.config/opencode/config.json during container startup. For long-lived custom configuration, either pin the full configuration with OPENCODE_JSON or edit the file while not setting OPENCODE_* environment variables.