Skip to main content

OpenCode

Install, authenticate, and resume OpenCode inside Daintree, including its inline --mini launch and the resume-latest fallback.

Reviewed

OpenCode

OpenCode is a provider-agnostic, open-source CLI coding agent. It runs as a process in its own Daintree terminal panel with full PTY emulation, like every other built-in agent.

Commandopencode
ShortcutNone by default — assign one in Keyboard Shortcuts
ColorEmerald (#10b981)
Default renderingInline, via --mini
Permission bypassNone — OpenCode has no bypass flag
PlatformsmacOS, Windows, Linux

Install & Authenticate

curl -fsSL https://opencode.ai/install | bash

Or npm install -g opencode-ai@latest, or brew install opencode.

Run opencode and use /connect inside the session to add a provider (Anthropic, OpenAI, OpenRouter, and the rest of the Models.dev list); opencode auth login does the same from a shell. Daintree reads that state from ~/.config/opencode/opencode.json and ~/.local/share/opencode/auth.json. Because OpenCode is provider-agnostic, any of ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY also counts as authenticated.

The curl installer drops the binary in ~/.opencode/bin or ~/.local/bin. Daintree probes both, so a script install is detected even when the Electron process inherits a PATH that misses them.

How Daintree Launches It

OpenCode is one of the three agents that launch inline by default, but it gets there differently from Codex and Grok. Its full-screen Bubble Tea interface garbles if the renderer strips alt-screen escapes, so Daintree instead passes OpenCode's own --mini flag — the minimal, scrollback-native interface, which emits no alt-screen enter and no mouse reporting. Output lands in Daintree's scrollback and stays selectable. Turn on "use alt-screen mode by default", or flip the per-agent or per-preset override, and the flag is dropped.

Note
OpenCode has no permission-bypass flag, on purpose. The --dangerously-skip-permissions flag exists only on OpenCode's run subcommand, not on the bare interactive launch Daintree uses, so there is nothing to inject. OpenCode is left out of the bypass list entirely and the global "skip permission prompts" switch does not reach it. Approve inside the session as usual.

Resuming Sessions

Daintree captures OpenCode's session ID and resumes with opencode -s <session-id>. Quit cleanly with /quit so the ID is captured. When capture misses, the fallback is opencode --continue, which reopens OpenCode's latest session for that directory — so a restart lands you back in the conversation rather than on a failed-restore banner. For the resume mechanics across all agents, see Session Resume.

Tip
If opencode isn't detected after install, confirm it's on your PATH (which opencode on macOS/Linux, where opencode on Windows), then restart Daintree. See Agent Availability for the five detection states, and Presets for launch configurations.