open-browser-cli
v1.1.0
Published
CLI tool to control your real Chrome browser from the terminal — same cookies, sessions, and extensions
Maintainers
Readme
Open Browser CLI
CLI tool to control your real Chrome browser from the terminal — same cookies, login sessions, extensions, and bookmarks. No sandboxed profiles.
Companion to open-browser-mcp. Uses the same Chrome extension and WebSocket protocol, but as a direct CLI instead of an MCP server — no token overhead from tool registrations.
Architecture
Terminal / Claude Code Skill
| shell command
open-browser-cli (Node.js)
| WebSocket (localhost:9877)
Chrome Extension (same as open-browser-mcp)
| chrome.debugger CDP + content scripts
Your Real BrowserInstall
npm install -g open-browser-cliPrerequisites
The Open Browser Bridge Chrome extension must be installed in Chrome. Install from the Chrome Web Store or load manually from the open-browser-mcp repository's extension/ folder.
The CLI and MCP server share the same extension and WebSocket port. Only one can run at a time.
Usage
# Start a session (required first step)
open-browser session
# Navigate
open-browser navigate https://github.com
# See what's on the page
open-browser snapshot
# Interact
open-browser click @e5
open-browser type @e2 "hello world"
open-browser key Enter
# Read content
open-browser read
open-browser markdown
# Screenshot
open-browser screenshot --full-page
# JSON output for scripting
open-browser snapshot --jsonCommands
Session & Navigation
session Create browser session (required first)
navigate <url> Navigate to URL [--wait networkIdle]
close Close active tab [--tab-id N]
back Go back in history
forward Go forward in historyInput & Interaction
click <ref> Click element [--button right] [--count 2]
type <ref> <text> Type text [--slowly]
hover <ref> Hover over element
drag <source> <target> Drag element to target
select <ref> <value> Select dropdown option
key <key> Press key (Enter, Tab, Ctrl+A, etc.)
upload <ref> <file...> Upload files to inputReading & Inspection
snapshot Get interactive elements with @eN refs
read Read page content [--format html] [--offset N] [--limit N]
markdown Read as markdown [--full] [--no-links] [--images]
find <query> Search by CSS selector or text
js <code> Execute JavaScript
console Read console messages [--pattern "error"]Verification
verify element <selector> Check element is visible
verify text <text> Check text exists on page
verify list <item1> <item2> Check all items visible
verify value <selector> <val> Check element has valueMouse & Coordinates
mouse click <x> <y> Click at coordinates [--human-like] [--button right]
mouse move <x> <y> Move mouse [--human-like]
mouse drag <x1> <y1> <x2> <y2> Drag between points [--steps 8]Tabs
tabs List all tabs
tab create [url] Create new tab
tab switch <id> Switch to tab by IDScreenshots & Media
screenshot Capture screenshot [--full-page] [--clip x,y,w,h] [--filename name.png]
pdf Save page as PDF [--landscape]
captcha-screenshot Screenshot captcha area [--padding 20]
resize <width> <height> Resize browser windowCaptcha
solve-captcha Detect and click captcha [--x N --y N]
captcha-tiles Analyze tile challenge grid [--detailed]
batch-click <targets...> Click multiple refs/coords [--human-like]Batch Operations
batch '<json>' Execute multiple actions as JSON arrayNetwork & Storage
network Read network requests [--url-pattern "api"] [--status 200]
cookies Read cookies [--urls url1,url2]
set-cookie <name> <val> <dom> Set cookie [--path /] [--secure] [--http-only]
clear-storage Clear storage [--type cookies]
block-urls <pattern...> Block URL patternsDevice Emulation
emulate Emulate mobile [--width 375] [--height 812] [--network "Slow 3G"]
geolocation <lat> <lng> Set GPS coordinates [--accuracy 100]DevTools & Performance
a11y-tree Get accessibility tree
trace start Start performance trace [--categories "..."]
trace stop Stop trace and get results
locator <ref> Generate CSS/XPath/aria locators
memory Memory and performance snapshot
audit-a11y Run accessibility auditTiming & Waiting
wait Wait for time or selector [--time 1000] [--selector ".done"]
wait-text <text> Wait for text to appear [--timeout 10000]
scroll Scroll page [--down 500] [--ref @e15] [--selector ".footer"]Dialogs
dialog accept Accept JS dialog [--text "response"]
dialog dismiss Dismiss JS dialogScript Injection
inject <script> Inject persistent JS (runs before every page load)
inject --remove <identifier> Remove injected scriptScreen Recording
screencast start Start recording [--interval 1000]
screencast stop Stop and save framesDomain Permissions
domain-mode <mode> Set mode: approval, allow_all, strict [--scope global]
domains allow <domain...> Pre-approve domains [--scope global]
domains block <domain...> Block domains
domains remove <domain...> Remove domain rulesGlobal Flags
| Flag | Default | Description |
|------|---------|-------------|
| --json | — | Output JSON instead of human-readable text |
| --port <N> | 9877 | WebSocket port (must match extension) |
| --timeout <ms> | 60000 | Request timeout in milliseconds |
| --help, -h | — | Show help |
| --version, -v | — | Show version |
Domain Permissions
The Chrome extension prompts for approval when navigating to new domains. Domain configs are stored at:
- Project:
{cwd}/.open-browser-mcp/domains.json - Global:
~/.open-browser-mcp/domains.json
Localhost URLs are always allowed.
License
MIT
