Browser automation plugin for OpenCode.
Control your real Chromium browser (Chrome/Brave/Arc/Edge) using your existing profile (logins, cookies, bookmarks). No DevTools Protocol, no security prompts.
demo-1.mp4
This version is optimized for reliability and predictable multi-session behavior:
- No MCP -> just opencode plugin
- No WebSocket port → no port conflicts
- Chrome Native Messaging between extension and a local host process
- A local broker multiplexes multiple OpenCode plugin sessions and enforces per-tab ownership
Help me improve this!
bunx @different-ai/opencode-browser@latest installinstall-1.mp4
The installer will:
- Copy the extension to
~/.opencode-browser/extension/ - Walk you through loading + pinning it in
chrome://extensions - Ask for the extension ID and install a Native Messaging Host manifest
- Update your
opencode.jsonoropencode.jsoncto load the plugin
Note: if you run the installer you'll be prompted to include this automatically. If you said "yes", you can skip this part.
Your opencode.json or opencode.jsonc should contain:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@different-ai/opencode-browser"]
}OpenCode Plugin <-> Local Broker (unix socket) <-> Native Host <-> Chrome Extension
- The extension connects to the native host.
- The plugin talks to the broker over a local unix socket.
- The broker forwards tool requests to the extension and enforces tab ownership.
- First time a session touches a tab, the broker auto-claims it for that session.
- Other sessions attempting to use the same tab will get an error.
- Use
browser_statusto inspect claims if needed.
Core primitives:
browser_statusbrowser_get_tabsbrowser_open_tabbrowser_navigatebrowser_query(modes:text,value,list,exists,page_text; optionaltimeoutMs/pollMs)browser_clickbrowser_typebrowser_scrollbrowser_wait
Diagnostics:
browser_snapshotbrowser_screenshotbrowser_version
- Add tab management tools (
browser_set_active_tab,browser_close_tab) - Add navigation helpers (
browser_back,browser_forward,browser_reload) - Add keyboard input tool (
browser_key) - Add download support (
browser_download,browser_list_downloads) - Add upload support (
browser_set_file_input)
Extension says native host not available
- Re-run
npx @different-ai/opencode-browser install - Confirm the extension ID you pasted matches the loaded extension in
chrome://extensions
Tab ownership errors
- Use
browser_statusto see current claims - Close the other OpenCode session to release ownership
npx @different-ai/opencode-browser uninstallThen remove the unpacked extension in chrome://extensions and remove the plugin from opencode.json or opencode.jsonc.