Sandbox plugin reference
Install, options, account fields, limits, environment variables, and tools of @gitterm/opencode-sandbox.
This is the reference for @gitterm/opencode-sandbox, the OpenCode plugin that gives your local agent remote sandboxes: every option, account field, limit, environment variable, and tool. Use it to look up a field. For step-by-step setup, see Sandbox setup.
Formerly part of @gitterm/opencode-plugin. The /cloud command is now a separate plugin; see Cloud plugin reference.
Install
opencode plugin add @gitterm/opencode-sandboxThis installs the plugin and adds it to your global OpenCode config. You can instead list it under plugins in a project's opencode.json, or in ~/.config/opencode/opencode.json for all projects.
The tools need an account, so replace the plugin's string entry with an object that has options. Keep your other settings and plugin entries.
{
"$schema": "https://opencode.ai/config.json",
"plugins": [
{
"package": "@gitterm/opencode-sandbox",
"options": { "provider": "e2b", "apiKey": "{env:E2B_API_KEY}" },
},
],
}Restart OpenCode after changing the options. When you load the plugin from a local path, point package at the package directory, not a file.
Sign in
Managed accounts need a Gitterm login. Direct accounts do not.
npm install -g @gitterm/cli
gitterm loginThe plugin uses the CLI's saved login. For a self-hosted deployment, run gitterm login --server <url>, where <url> is your Gitterm API URL. You can instead set GITTERM_API_TOKEN (and GITTERM_SERVER_URL) before starting OpenCode.
Options
These go directly in the plugin's options, next to one account's fields. For several accounts, put them under accounts instead. Without options, the tools report that sandboxes are not configured.
Account names use letters, digits, _, ., and -, start with a letter or digit, and are at most 63 characters.
Account fields
For what each provider does with a sandbox, see Providers.
Limits
Set these under limits. Any field you leave out uses its default.
Providers also cap the lifetime: 24 hours, or 5 hours on Vercel.
Environment variables
Set variables before OpenCode starts. This includes variables you reference with {env:VAR} and variables you pass to jobs with secretEnv.
Tools
The plugin adds nine tools, and a tenth when snapshots is on. You ask in plain words and the agent picks them; their arguments are in Tools.
Which tools ask for approval, and how to pre-approve them: Approvals.
Sidebar
OpenCode's right sidebar has a Sandboxes list with this checkout's live sandboxes, newest first. Each line shows the sandbox name and a dot for its state (green running, yellow pending or paused, red deleting), then any running jobs, preview ports, and its purpose or provider. The list refreshes every few seconds from the local sandbox records. It never calls the provider, and it is hidden when the checkout has no sandboxes.