The Browser Use CLI provides fast, persistent browser automation from the command line. The CLI uses a session server architecture where the browser stays open between commands for instant response times (~50ms).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/browser-use/browser-use/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Setup Commands
install
Installs Chromium browser with system dependencies.- On Linux: Installs with
--with-depsflag for system dependencies - On macOS/Windows: Installs Chromium only (no system dependencies needed)
init
Generates template files to get started quickly.--template, -t- Template name (interactive if not specified)--output, -o- Output file path--force, -f- Overwrite existing files--list, -l- List available templates
setup
Configures browser-use for first-time use.--mode- Setup mode:local,remote, orfull(default:local)--api-key- Browser-Use API key--yes, -y- Skip interactive prompts
doctor
Validates installation and checks dependencies.- Python version
- Browser installation
- API key configuration
- Network connectivity
Navigation Commands
open
Navigate to a URL.back
Go back in browser history.scroll
Scroll the page up or down.direction-upordown(default:down)--amount- Scroll amount in pixels (default:500)
Inspection Commands
state
Get browser state including URL, title, and clickable elements.- Current URL
- Page title
- List of interactive elements with indices
- Element types (button, input, link, etc.)
screenshot
Take a screenshot of the current page.path- Save path (outputs base64 if not provided)--full- Capture full page instead of viewport
Interaction Commands
click
Click an element by its index from the state command.type
Type text into the currently focused element.input
Click an element by index, then type text into it.click 3 + type "john@example.com"
keys
Send keyboard keys or key combinations.select
Select a dropdown option.hover
Hover over an element.dblclick
Double-click an element.rightclick
Right-click an element.Tab Management
switch
Switch to a different tab by index.close-tab
Close a tab.Cookie Management
cookies get
Get all cookies or cookies for a specific URL.cookies set
Set a cookie with options.--domain- Cookie domain--path- Cookie path (default:/)--secure- Mark as secure cookie--http-only- Mark as HTTP-only--same-site- SameSite attribute:Strict,Lax, orNone--expires- Expiration timestamp
cookies clear
Clear cookies.cookies export
Export cookies to a JSON file.cookies import
Import cookies from a JSON file.Wait Commands
wait selector
Wait for a CSS selector to appear or disappear.--timeout- Timeout in milliseconds (default:30000)--state- Element state:attached,detached,visible, orhidden(default:visible)
wait text
Wait for text to appear on the page.Information Retrieval
get title
Get the page title.get html
Get page HTML.get text
Get text content of an element.get value
Get value of an input element.get attributes
Get all attributes of an element.get bbox
Get element bounding box (x, y, width, height).JavaScript & Data Extraction
eval
Execute custom JavaScript code.extract
Extract data using LLM (requires API key).Python Execution
Execute Python code with persistent namespace.browser object is available in the Python namespace for browser interactions.
Agent Tasks
Run AI-powered browser automation tasks.Local Mode
--max-steps- Maximum steps--llm- LLM model (e.g.,gpt-4o,claude-sonnet-4-20250514)
OPENAI_API_KEY, ANTHROPIC_API_KEY, or other LLM provider API key
Remote Mode (Cloud)
--session-id- Reuse existing cloud session--proxy-country- Proxy country code (e.g.,us,uk,gb)--stream- Stream output in real-time--wait- Wait for completion (default: async)--flash- Enable fast mode--keep-alive- Keep session alive after task--thinking- Enable extended reasoning--vision- Enable vision (default)--no-vision- Disable vision--profile- Use cloud profile ID--start-url- Start from specific URL--allowed-domain- Restrict navigation (repeatable)--metadata- Task metadata asKEY=VALUE(repeatable)--secret- Task secrets asKEY=VALUE(repeatable)--skill-id- Enable skill IDs (repeatable)--structured-output- JSON schema for structured output--judge- Enable judge mode--judge-ground-truth- Expected answer for evaluation
BROWSER_USE_API_KEY
Task Management (Remote)
task list
List recent cloud tasks.--limit- Maximum tasks to list (default:10)--status- Filter by status:running,finished,stopped,failed--session- Filter by session ID
task status
Get task status and details.task stop
Stop a running task.task logs
Get task execution logs.Cloud Session Management
session list
List cloud sessions.--limit- Maximum sessions (default:10)--status- Filter by status:active,stopped
session get
Get session details including live URL.session stop
Stop cloud session(s).session create
Create a new cloud session.--profile- Cloud profile ID--proxy-country- Proxy country code--start-url- Initial URL--screen-size- Screen size (e.g.,1920x1080)--keep-alive- Keep session alive--persist-memory- Persist memory between tasks
session share
Create or delete public share URL.Tunnels
Expose local dev servers via Cloudflare tunnels.tunnel start
https://abc.trycloudflare.com
tunnel list
List active tunnels.tunnel stop
Stop tunnel(s).Profile Management
Local Profiles (-b real)
Cloud Profiles (-b remote)
Local Session Management
sessions
List active local sessions.close
Close browser session.server commands
Manage the session server.Global Options
These options work with any command:--session NAME- Use named session (default:default)--browser MODE- Browser mode:chromium,real, orremote--headed- Show browser window (default: headless)--profile NAME- Browser profile (local name or cloud ID)--json- Output as JSON--api-key KEY- Override API key--mcp- Run as MCP server via stdin/stdout
Browser Modes
Chromium (Default)
Headless Chromium browser.Real Browser
Use your actual Chrome browser with existing logins.Remote (Cloud)
Cloud browser with anti-detection features.BROWSER_USE_API_KEY
Persistent Sessions
The CLI uses a session server architecture where the browser stays open between commands:Multiple Sessions
Run multiple browsers in parallel:Examples
Form Filling
Data Extraction
Cloud Agent with Session Reuse
Troubleshooting
Session server won’t start
View server logs
Check installation
How It Works
The CLI uses a background session server:- First command starts a server (browser stays open)
- Commands communicate via Unix socket (TCP on Windows)
- ~50ms latency instead of waiting for browser startup
- Server auto-starts when needed, stops with
browser-use server stop