Skip to main content
OpenCode is a terminal-based AI coding agent that supports a wide range of models — both local (Ollama, LM Studio) and cloud (OpenAI, Anthropic, Google, etc). This makes it a great choice if you want to use models that aren’t available through the other agents. OpenCode uses a plugin bridge instead of OTLP telemetry. A small JavaScript plugin runs inside OpenCode and sends real-time events to CliDeck over HTTP.

Setup

1

Launch an OpenCode session

Click OpenCode in the session launcher. The session starts normally.
2

Install the bridge plugin

On first launch, CliDeck shows a setup toast: “OpenCode — Bridge Plugin”. Click Install plugin.CliDeck automatically copies the bridge plugin to ~/.config/opencode/plugins/clideck-bridge.js.
3

Restart the session

After installation, click Restart Session on the toast. The new session will have the bridge active.
This is a one-time setup. The plugin stays in place across OpenCode and CliDeck updates. CliDeck also detects the plugin on startup — if it’s already installed, the integration is enabled automatically.
You can also install the plugin manually if you prefer:
mkdir -p ~/.config/opencode/plugins
cp "$(npm root -g)/clideck/opencode-plugin/clideck-bridge.js" ~/.config/opencode/plugins/

What the Plugin Does

The CliDeck bridge plugin sends events to http://localhost:4000/opencode-events when:
EventWhat CliDeck Gets
session.status (busy/idle)Working/idle status indicator
message.part.updatedLive message preview in sidebar
session.updatedSession title and ID for resume
session.createdInitial session connection
The plugin doesn’t modify OpenCode’s behavior or read your prompts. It only observes status changes and output text.

Session Resume

OpenCode supports session resume. CliDeck captures the session ID from plugin events and uses opencode --session <sessionId> to reconnect to previous sessions. Session IDs in OpenCode look like ses_ followed by alphanumeric characters (e.g., ses_abc123xyz).

How It Differs from OTLP Agents

AspectOTLP (Claude/Codex/Gemini)Plugin (OpenCode)
Status detectionI/O heuristics (byte rates)Explicit busy/idle events from plugin
Message previewTerminal output buffer parsingDirect text from plugin events
Session ID captureOTLP log attributesPlugin event payload
SetupEnv vars or config fileCopy plugin file
The plugin approach gives more accurate status information since OpenCode explicitly reports when it’s busy or idle, rather than CliDeck having to guess from output patterns.
If OpenCode releases a major update that changes its plugin API, the bridge plugin may need updating. Check for the latest CliDeck version with npm update -g clideck.