The Browser Use CLI provides direct browser control without writing Python code. Install the package and run commands to navigate, interact, manage cookies, and execute agent tasks.
Installation
Verify the installation:
Commands
Navigation
Navigate to a URL:
Go back or forward:
Refresh the current page:
Interaction
Click an element by selector:
Type text into an input field:
Scroll the page:
Take a screenshot:
Cookies
Export cookies to a file:
Import cookies from a file:
Clear all cookies:
Wait
Wait for an element to appear:
Wait for a specific duration (in milliseconds):
JavaScript
Execute JavaScript in the browser:
Execute JavaScript from a file:
Agent tasks
Run an AI agent to complete a task:
Specify a model:
Use a custom prompt:
Cloud sessions
Connect to a Browser Use Cloud session:
Create a new cloud session:
List active sessions:
Cloud sessions require a BROWSER_USE_API_KEY. Set it in your environment or .env file.
Tunnels
Expose your local browser to the cloud:
Stop an active tunnel:
Check tunnel status:
Profile management
Create a browser profile:
List available profiles:
Use a specific profile:
Delete a profile:
Usage examples
Complete workflow
Navigate, interact, and extract data:
Authentication with cookies
Save and restore login state:
Cloud-based automation
Run tasks in the cloud:
Environment variables