Browser-Use CLI
Fast, persistent browser automation from the command line.
Installation
Quick Start
Browser Modes
All Commands
Navigation
| Command |
Description |
browser-use open <url> |
Navigate to URL |
browser-use back |
Go back in history |
browser-use scroll down |
Scroll down |
browser-use scroll up |
Scroll up |
Inspection
| Command |
Description |
browser-use state |
Get URL, title, and clickable elements |
browser-use screenshot [path] |
Take screenshot (base64 if no path) |
browser-use screenshot --full path.png |
Full page screenshot |
Interaction
| Command |
Description |
browser-use click <index> |
Click element by index |
browser-use type "text" |
Type into focused element |
browser-use input <index> "text" |
Click element, then type |
browser-use keys "Enter" |
Send keyboard keys |
browser-use keys "Control+a" |
Send key combination |
browser-use select <index> "value" |
Select dropdown option |
Tabs
| Command |
Description |
browser-use switch <tab> |
Switch to tab by index |
browser-use close-tab |
Close current tab |
browser-use close-tab <tab> |
Close specific tab |
JavaScript & Data
| Command |
Description |
browser-use eval "js code" |
Execute JavaScript |
browser-use extract "query" |
Extract data with LLM |
Python (Persistent Session)
Session Management
| Command |
Description |
browser-use sessions |
List active sessions |
browser-use close |
Close browser session |
browser-use close --all |
Close all sessions |
browser-use server status |
Check if server is running |
browser-use server stop |
Stop server |
Global Options
| Option |
Description |
--session NAME |
Use named session (default: "default") |
--browser MODE |
Browser mode: chromium, real, remote |
--headed |
Show browser window |
--profile NAME |
Chrome profile (real mode) |
--json |
Output as JSON |
--api-key KEY |
Override API key |
Session behavior: All commands without --session use the same "default" session. The browser stays open and is reused across commands. Use --session NAME to run multiple browsers in parallel.
Examples
Fill a Form
Multi-Session Workflow
Python Automation
Claude Code Skill
For Claude Code, a skill provides richer context for browser automation:
How It Works
The CLI uses a session server architecture:
- First command starts a background server (browser stays open)
- Subsequent commands communicate via Unix socket
- Browser persists across commands for fast interaction
- Server auto-starts when needed, stops with
browser-use server stop
This gives you ~50ms command latency instead of waiting for browser startup each time.