⚠️ Important: Browser commands reuse your Chrome login session. You must be logged into the target website in Chrome before running commands.
OpenCLI connects to your browser through a lightweight Browser Bridge Chrome Extension + micro-daemon (zero config, auto-start).
- Go to the GitHub Releases page and download the latest
opencli-extension-v{version}.zip. - Unzip the file and open
chrome://extensions, enable Developer mode (top-right toggle). - Click Load unpacked and select the unzipped folder.
- Open
chrome://extensionsand enable Developer mode. - Click Load unpacked and select the
extension/directory from the repository.
That's it! The daemon auto-starts when you run any browser command. No tokens, no manual configuration.
opencli doctor # Check extension + daemon connectivityBrowser commands require an explicit <session> positional immediately after browser. Use the same session name for a multi-step flow, and use different names to isolate parallel work.
opencli browser baidu open https://www.baidu.com/
opencli browser baidu tab list
opencli browser baidu tab new https://www.baidu.com/
opencli browser baidu eval --tab <targetId> 'document.title'
opencli browser baidu tab select <targetId>
opencli browser baidu get title
opencli browser baidu tab close <targetId>Key rules:
opencli browser <session> open <url>andopencli browser <session> tab new [url]return atargetId.opencli browser <session> tab listprints thetargetIdvalues of tabs that already exist.--tab <targetId>routes a single browser command to that specific tab.tab newcreates a new tab but does not change the default browser target.tab select <targetId>makes that tab the default target for later untargetedopencli browser ...commands.tab close <targetId>removes the tab; if it was the current default target, the stored default is cleared.
┌─────────────┐ WebSocket ┌──────────────┐ Chrome API ┌─────────┐
│ opencli │ ◄──────────────► │ micro-daemon │ ◄──────────────► │ Chrome │
│ (Node.js) │ localhost:19825 │ (auto-start) │ Extension │ Browser │
└─────────────┘ └──────────────┘ └─────────┘
The daemon manages the WebSocket connection between your CLI commands and the Chrome extension. The extension executes JavaScript in the context of web pages, with access to the logged-in session.
The daemon auto-starts on first browser command and stays alive persistently.
opencli daemon stop # Graceful shutdownThe daemon is persistent — it stays alive until you explicitly stop it (opencli daemon stop) or uninstall the package.
If you need to run opencli on a remote server (CI runner, agent host) but keep the browser session on your local machine, see Remote Orchestration. It walks through the SSH reverse-tunnel pattern so the daemon never leaves localhost.