Browser automation plugin for OpenCode.
Note: This is a fork of @different-ai/opencode-browser modified to support Windows (win32) natively alongside macOS and Linux.
Control your real Chromium browser (Chrome/Brave/Arc/Edge) using your existing profile (logins, cookies, bookmarks). No DevTools Protocol, no security prompts.
This version includes specific optimizations for Windows:
- Registry Automation: Automatically registers the Chrome Native Messaging Host using
reg.exe. - Batch Wrapper: Uses
.batwrappers instead of.shscripts. - Universal Installer: Detects OS (Win/Mac/Linux) and applies the correct installation method automatically.
- Node.js: v18 or higher (This plugin is pure JavaScript.).
- Browser: Google Chrome, Brave, Edge, or Arc.
- OpenCode CLI: The main agent to run this plugin.
Since this is a custom fork, install directly from GitHub:
npm install -g git+https://github.com/INTEGRITY2077/opencode-browser-win.gitRun the following command in your terminal (PowerShell or CMD):
opencode-browser installImportant: Since this plugin is private/unpublished, you must manually install the dependency in your OpenCode config directory as instructed by the installer:
cd $env:USERPROFILE\.config\opencode
npm install git+https://github.com/INTEGRITY2077/opencode-browser-win.gitThen add "@integrity2077/opencode-browser-win" to your opencode.json.
The installer will:
- Copy extension files to
%USERPROFILE%\.opencode-browser\extension\ - Walk you through loading + pinning the extension in
chrome://extensions - Automatically register the Native Messaging Host in the Windows Registry (
HKCU\Software\Google\Chrome\NativeMessagingHosts) - Update your OpenCode config (
~/.config/opencode/opencode.json) to include the plugin (key:"plugin"array)
- Open
chrome://extensions - Enable Developer mode (top right)
- Click Load unpacked
- Select the folder:
%USERPROFILE%\.opencode-browser\extension - Copy the Extension ID and paste it into the terminal if prompt (or restart install if needed).
Restart OpenCode and try:
opencode run "browser_navigate('https://google.com')"To remove the registry keys and files:
opencode-browser uninstallThis will cleanly remove:
- The Registry Key (
HKCU\Software\Google\Chrome\NativeMessagingHosts\com.opencode.browser_automation) - The installation directory (
~/.opencode-browser)
- Local Execution: Use standard
os.homedir()paths. No hardcoded personal paths. - Source Code: Transparently modified to add Windows
bat/regsupport. - Original Logic: All core browser logic remains identical to the original upstream project.