| name | remote-browser |
| description | Controls a local browser from a sandboxed remote machine. Use when the agent is running in a sandbox (no GUI) and needs to navigate websites, interact with web pages, fill forms, take screenshots, or expose local dev servers via tunnels. |
| allowed-tools | Bash(browser-use:*) |
Browser Automation for Sandboxed Agents
This skill is for agents running on sandboxed remote machines (cloud VMs, CI, coding agents) that need to control a headless browser.
Prerequisites
browser-use doctor
For setup details, see https://github.com/browser-use/browser-use/blob/main/browser_use/skill_cli/README.md
Core Workflow
- Navigate:
browser-use open <url> — starts headless browser if needed
- Inspect:
browser-use state — returns clickable elements with indices
- Interact: use indices from state (
browser-use click 5, browser-use input 3 "text")
- Verify:
browser-use state or browser-use screenshot to confirm
- Repeat: browser stays open between commands
- Cleanup:
browser-use close when done
Browser Modes
browser-use open <url>
browser-use cloud connect
browser-use --connect open <url>
browser-use --cdp-url ws://localhost:9222/... open <url>
Commands
browser-use open <url>
browser-use back
browser-use scroll down
browser-use scroll up
browser-use tab list
browser-use tab new [url]
browser-use tab switch <index>
browser-use tab close <index> [index...]
browser-use state
browser-use screenshot [path.png]
browser-use click <index>
browser-use click <x> <y>
browser-use type "text"
browser-use input <index> "text"
browser-use keys "Enter"
browser-use select <index> "option"
browser-use upload <index> <path>
browser-use hover <index>
browser-use dblclick <index>
browser-use rightclick <index>
browser-use eval "js code"
browser-use get title
browser-use get html [--selector "h1"]
browser-use get text <index>
browser-use get value <index>
browser-use get attributes <index>
browser-use get bbox <index>
browser-use wait selector "css"
browser-use wait text "text"
browser-use cookies get [--url <url>]
browser-use cookies set <name> <value>
browser-use cookies clear [--url <url>]
browser-use cookies export <file>
browser-use cookies import <file>
browser-use python "code"
browser-use python --file script.py
browser-use python --vars
browser-use python --reset
browser-use close
browser-use sessions
browser-use close --all
The Python browser object provides: browser.url, browser.title, browser.html, browser.goto(url), browser.back(), browser.click(index), browser.type(text), browser.input(index, text), browser.keys(keys), browser.upload(index, path), browser.screenshot(path), browser.scroll(direction, amount), browser.wait(seconds).
Tunnels
Expose local dev servers to the browser via Cloudflare tunnels.
browser-use tunnel <port>
browser-use tunnel list
browser-use tunnel stop <port>
browser-use tunnel stop --all
Command Chaining
Commands can be chained with &&. The browser persists via the daemon, so chaining is safe and efficient.
browser-use open https://example.com && browser-use state
browser-use input 5 "user@example.com" && browser-use input 6 "password" && browser-use click 7
Chain when you don't need intermediate output. Run separately when you need to parse state to discover indices first.
Common Workflows
Exposing Local Dev Servers
python -m http.server 3000 &
browser-use tunnel 3000
browser-use open https://abc.trycloudflare.com
Tunnels are independent of browser sessions and persist across browser-use close.
Multi-Agent (--connect mode)
Multiple agents can share one browser via --connect. Each agent gets its own tab — other agents can't interfere.
Setup: Register once, then pass the index with every --connect command:
INDEX=$(browser-use register)
browser-use --connect $INDEX open <url>
browser-use --connect $INDEX state
browser-use --connect $INDEX click <element>
- Tab locking: When an agent mutates a tab (click, type, navigate), that tab is locked to it. Other agents get an error if they try to mutate the same tab.
- Read-only access:
state, screenshot, get, and wait commands work on any tab regardless of locks.
- Agent sessions expire after 5 minutes of inactivity. Run
browser-use register again to get a new index.
Global Options
| Option | Description |
|---|
--headed | Show browser window |
--connect | Auto-discover running Chrome via CDP |
--cdp-url <url> | Connect via CDP URL (http:// or ws://) |
--session NAME | Target a named session (default: "default") |
--json | Output as JSON |
Tips
- Always run
state first to see available elements and their indices
- Sessions persist — browser stays open between commands until you close it
- Tunnels are independent — they persist across
browser-use close
tunnel is idempotent — calling again for the same port returns the existing URL
Troubleshooting
- Browser won't start?
browser-use close then retry. Run browser-use doctor to check.
- Element not found?
browser-use scroll down then browser-use state
- Tunnel not working?
which cloudflared to check, browser-use tunnel list to see active tunnels
Cleanup
browser-use close
browser-use tunnel stop --all