| name | remote-browser |
| description | Controls a cloud 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:*) |
Remote 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 browser. Install browser-use and drive a cloud browser — no local Chrome needed.
Setup
Remote-only install (recommended for sandboxed agents)
curl -fsSL https://browser-use.com/cli/install.sh | bash -s -- --remote-only
This configures browser-use to only use cloud browsers:
Manual install (alternative)
pip install "browser-use[cli]"
brew install cloudflared
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o ~/.local/bin/cloudflared && chmod +x ~/.local/bin/cloudflared
winget install Cloudflare.cloudflared
Then configure your API key:
export BROWSER_USE_API_KEY=bu_xxx
Verify installation:
browser-use doctor
Core Workflow
When installed with --remote-only, commands automatically use the cloud browser — no --browser flag needed:
browser-use open https://example.com
browser-use state
browser-use click 5
browser-use type "Hello World"
browser-use input 3 "text"
browser-use screenshot
browser-use screenshot page.png
browser-use close
Understanding Installation Modes
| Install Command | Available Modes | Default Mode | Use Case |
|---|
--remote-only | remote | remote | Sandboxed agents, no GUI |
--local-only | chromium, real | chromium | Local development |
--full | chromium, real, remote | chromium | Full flexibility |
When only one mode is installed, it becomes the default and no --browser flag is needed.
Exposing Local Dev Servers
If you're running a dev server on the remote machine and need the cloud browser to reach it:
python -m http.server 3000 &
browser-use tunnel 3000
browser-use open https://abc.trycloudflare.com
Tunnel commands:
browser-use tunnel <port>
browser-use tunnel <port>
browser-use tunnel list
browser-use tunnel stop <port>
browser-use tunnel stop --all
Note: Tunnels are independent of browser sessions. They persist across browser-use close and can be managed separately.
Cloudflared is installed by install.sh --remote-only. If missing, install manually (see Setup section).
Commands
Navigation
browser-use open <url>
browser-use back
browser-use scroll down
browser-use scroll up
browser-use scroll down --amount 1000
Page State
browser-use state
browser-use screenshot
browser-use screenshot path.png
browser-use screenshot --full p.png
Interactions (use indices from state)
browser-use click <index>
browser-use type "text"
browser-use input <index> "text"
browser-use keys "Enter"
browser-use keys "Control+a"
browser-use select <index> "option"
browser-use hover <index>
browser-use dblclick <index>
browser-use rightclick <index>
JavaScript & Data
browser-use eval "document.title"
browser-use extract "all prices"
browser-use get title
browser-use get html
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>
Wait Conditions
browser-use wait selector "h1"
browser-use wait selector ".loading" --state hidden
browser-use wait text "Success"
browser-use wait selector "#btn" --timeout 5000
Cookies
browser-use cookies get
browser-use cookies get --url <url>
browser-use cookies set <name> <val>
browser-use cookies set name val --domain .example.com --secure
browser-use cookies set name val --same-site Strict
browser-use cookies set name val --expires 1735689600
browser-use cookies clear
browser-use cookies clear --url <url>
browser-use cookies export <file>
browser-use cookies import <file>
Tab Management
browser-use switch <tab>
browser-use close-tab
browser-use close-tab <tab>
Python Execution (Persistent Session)
browser-use python "x = 42"
browser-use python "print(x)"
browser-use python "print(browser.url)"
browser-use python --vars
browser-use python --reset
browser-use python --file script.py
The Python session maintains state across commands. The browser object provides:
browser.url - Current page URL
browser.title - Page title
browser.html - Get page HTML
browser.goto(url) - Navigate
browser.click(index) - Click element
browser.type(text) - Type text
browser.input(index, text) - Click element, then type
browser.keys(keys) - Send keyboard keys
browser.screenshot(path) - Take screenshot
browser.scroll(direction, amount) - Scroll page
browser.back() - Go back in history
browser.wait(seconds) - Sleep/pause execution
browser.extract(query) - Extract data using LLM
Agent Tasks
browser-use run "Fill the contact form with test data"
browser-use run "Extract all product prices" --max-steps 50
browser-use run "task" --llm gpt-4o
browser-use run "task" --llm claude-sonnet-4-20250514
browser-use run "task" --llm gemini-2.0-flash
browser-use run "task" --proxy-country gb
browser-use run "task" --proxy-country de
browser-use run "task 1" --keep-alive
browser-use run "task 2" --session-id abc-123
browser-use run "task" --no-wait
browser-use run "task" --wait
browser-use run "task" --stream
browser-use run "task" --flash
browser-use run "task" --thinking
browser-use run "task" --vision
browser-use run "task" --no-vision
browser-use run "task" --profile <cloud-profile-id>
browser-use run "task" --start-url https://example.com
browser-use run "task" --allowed-domain example.com
browser-use run "task" --metadata key=value
browser-use run "task" --secret API_KEY=xxx
browser-use run "task" --skill-id skill-123
browser-use run "task" --structured-output '{"type":"object"}'
browser-use run "task" --judge
browser-use run "task" --judge-ground-truth "answer"
Task Management
Manage cloud tasks:
browser-use task list
browser-use task list --limit 20
browser-use task list --status running
browser-use task list --status finished
browser-use task list --session <id>
browser-use task list --json
browser-use task status <task-id>
browser-use task status <task-id> -c
browser-use task status <task-id> -v
browser-use task status <task-id> --last 5
browser-use task status <task-id> --step 3
browser-use task status <task-id> --reverse
browser-use task status <task-id> --json
browser-use task stop <task-id>
browser-use task logs <task-id>
Cloud Session Management
Manage cloud browser sessions:
browser-use session list
browser-use session list --limit 20
browser-use session list --status active
browser-use session list --json
browser-use session get <session-id>
browser-use session get <session-id> --json
browser-use session stop <session-id>
browser-use session stop --all
browser-use session create
browser-use session create --profile <id>
browser-use session create --proxy-country gb
browser-use session create --start-url https://example.com
browser-use session create --screen-size 1920x1080
browser-use session create --keep-alive
browser-use session create --persist-memory
browser-use session share <session-id>
browser-use session share <session-id> --delete
Cloud Profile Management
Cloud profiles store browser state (cookies) persistently across sessions. Use profiles to maintain login sessions.
browser-use profile list
browser-use profile list --page 2 --page-size 50
browser-use profile get <id>
browser-use profile create
browser-use profile create --name "My Profile"
browser-use profile update <id> --name "New Name"
browser-use profile delete <id>
Using profiles:
browser-use run "Log into site" --profile <profile-id> --keep-alive
browser-use session create --profile <profile-id>
browser-use open https://example.com --profile <profile-id>
Import cookies to cloud profile:
browser-use cookies export /tmp/cookies.json
browser-use cookies import /tmp/cookies.json --profile <profile-id>
Running Subagents
Cloud sessions and tasks provide a powerful model for running subagents - autonomous browser agents that execute tasks in parallel.
Key Concepts
- Session = Agent: Each cloud session is a browser agent with its own state (cookies, tabs, history)
- Task = Work: Tasks are jobs given to an agent. An agent can run multiple tasks sequentially
- Parallel agents: Run multiple sessions simultaneously for parallel work
- Session reuse: While a session is alive, you can assign it more tasks
- Session lifecycle: Once stopped, a session cannot be revived - start a new one
Basic Subagent Workflow
browser-use run "Search for AI news and summarize top 3 articles" --no-wait
browser-use task status task-abc
browser-use task logs task-abc
Running Parallel Subagents
Launch multiple agents to work simultaneously:
browser-use run "Research competitor A pricing" --no-wait
browser-use run "Research competitor B pricing" --no-wait
browser-use run "Research competitor C pricing" --no-wait
browser-use task list --status running
browser-use task status task-1
browser-use task status task-2
browser-use task status task-3
Reusing an Agent for Multiple Tasks
Keep a session alive to run sequential tasks in the same browser context:
browser-use run "Log into example.com" --keep-alive --no-wait
browser-use task status task-1
browser-use run "Navigate to settings and export data" --session-id sess-123 --no-wait
Managing Active Agents
browser-use session list --status active
browser-use session get sess-123
browser-use session stop sess-123
browser-use session stop --all
Stopping Tasks vs Sessions
browser-use task stop task-abc
browser-use session stop sess-123
Custom Agent Configuration
browser-use run "task" --no-wait
browser-use run "task" \
--llm gpt-4o \
--proxy-country gb \
--keep-alive \
--no-wait
browser-use run "task" --profile <profile-id> --no-wait
Monitoring Subagents
Task status is designed for token efficiency. Default output is minimal - only expand when needed:
| Mode | Flag | Tokens | Use When |
|---|
| Default | (none) | Low | Polling progress |
| Compact | -c | Medium | Need full reasoning |
| Verbose | -v | High | Debugging actions |
Recommended workflow:
browser-use run "task" --no-wait
browser-use task status abc-123
browser-use task status abc-123 -c
browser-use task status abc-123 -v
For long tasks (50+ steps):
browser-use task status <id> -c --last 5
browser-use task status <id> -c --reverse
browser-use task status <id> -v --step 10
Live view: Watch an agent work in real-time:
browser-use session get <session-id>
Detect stuck tasks: If cost/duration stops increasing, the task may be stuck:
browser-use task status <task-id>
Logs: Only available after task completes:
browser-use task logs <task-id>
Cleanup
Always clean up sessions after parallel work:
browser-use session stop --all
browser-use session stop <session-id>
Troubleshooting
Session reuse fails after task stop:
If you stop a task and try to reuse its session, the new task may get stuck at "created" status. Solution: create a new agent instead.
browser-use task stop <task-id>
browser-use run "new task" --session-id <same-session>
browser-use run "new task" --profile <profile-id>
Task stuck at "started":
- Check cost with
task status - if not increasing, task is stuck
- View live URL with
session get to see what's happening
- Stop the task and create a new agent
Sessions persist after tasks complete:
Tasks finishing doesn't auto-stop sessions. Clean up manually:
browser-use session list --status active
browser-use session stop --all
Session Management
browser-use sessions
browser-use close
browser-use close --all
Global Options
| Option | Description |
|---|
--session NAME | Named session (default: "default") |
--browser MODE | Browser mode (only if multiple modes installed) |
--profile ID | Cloud profile ID for persistent cookies |
--json | Output as JSON |
--api-key KEY | Override API key |
Common Patterns
Test a Local Dev Server with Cloud Browser
npm run dev &
browser-use tunnel 3000
browser-use open https://abc.trycloudflare.com
browser-use state
browser-use screenshot
Form Submission
browser-use open https://example.com/contact
browser-use state
browser-use input 0 "John Doe"
browser-use input 1 "john@example.com"
browser-use input 2 "Hello, this is a test message."
browser-use click 3
browser-use state
Screenshot Loop for Visual Verification
browser-use open https://example.com
for i in 1 2 3 4 5; do
browser-use scroll down
browser-use screenshot "page_$i.png"
done
Tips
- Install with
--remote-only for sandboxed environments — no --browser flag needed
- Always run
state first to see available elements and their indices
- Sessions persist across commands — the browser stays open until you close it
- Tunnels are independent — they don't require or create a browser session, and persist across
browser-use close
- Use
--json for programmatic parsing
tunnel is idempotent — calling it again for the same port returns the existing URL
- Close when done —
browser-use close closes the browser; browser-use tunnel stop --all stops tunnels
Troubleshooting
"Browser mode 'chromium' not installed"?
- You installed with
--remote-only which doesn't include local modes
- This is expected behavior for sandboxed agents
- If you need local browser, reinstall with
--full
Cloud browser won't start?
Tunnel not working?
- Verify cloudflared is installed:
which cloudflared
- If missing, install manually (see Setup section) or re-run
install.sh --remote-only
browser-use tunnel list to check active tunnels
browser-use tunnel stop <port> and retry
Element not found?
- Run
browser-use state to see current elements
browser-use scroll down then browser-use state — element might be below fold
- Page may have changed — re-run
state to get fresh indices
Cleanup
Close the browser when done:
browser-use close
browser-use tunnel stop --all
Browser sessions and tunnels are managed separately, so close each as needed.