Docs

OpenCode Local

opencodelocal runs OpenCode on the same machine as Paperclip. Use it when you want provider/model routing in OpenCode's provider/model format and session resume across heartbeats. --- - You already u…

OpenCode Local

opencodelocal runs OpenCode on the same machine as Paperclip. Use it when you want provider/model routing in OpenCode's provider/model format and session resume across heartbeats.

---

When To Use

You already use OpenCode locally. You want to use provider/model routing — for example anthropic/claude-sonnet-4-5 or openai/gpt-5.2-codex. You want Paperclip to resume OpenCode sessions across heartbeats via --session.

When Not To Use

The runtime lives behind a webhook or API. Use OpenClaw Gateway (/docs/adapters/openclaw-gateway) or HTTP (/docs/adapters/http). You only need a one-shot shell command or script. Use Process (/docs/adapters/process). OpenCode CLI is not installed on the machine.

---

Common Fields

| Field | Required | Notes | |---|---:|---| | cwd | no | Absolute working directory. Recommended. Created when permissions allow; otherwise falls back to the process working directory. | | model | yes | OpenCode model id in provider/model format (e.g. openai/gpt-5.2-codex, anthropic/claude-sonnet-4-5). | | variant | no | Provider-specific reasoning/profile variant passed as --variant. Accepts minimal, low, medium, high, xhigh, max. | | dangerouslySkipPermissions | no | Injects a temporary runtime config with permission.externaldirectory=allow so headless runs don't stall on approval prompts. Defaults to true for unattended Paperclip runs. | | promptTemplate | no | Run prompt template. | | instructionsFilePath | no | Absolute path to a Markdown instructions file prepended to the run prompt. | | command | no | Defaults to opencode. Override only for a non-default executable path. | | extraArgs | no | Extra CLI arguments appended to the OpenCode invocation. | | env | no | Environment variables. Secret refs supported. | | timeoutSec | no | Run timeout in seconds. 0 means no timeout. | | graceSec | no | SIGTERM grace period before a forced stop. |