Prerequisites
- Node.js 18+ installed
- Basic command line knowledge
Install and Setup
1
Install Agent Browser
Install globally for best performance:
2
Download Chromium
Agent Browser needs Chromium to run:On Linux, you may need system dependencies:
3
Verify Installation
Test that everything works:You should see the browser launch and navigate to example.com.
Your First Automation
Let’s automate a simple form fill workflow using the snapshot-ref pattern.1
Navigate to a Page
Open a page with a form:The browser will launch (headless by default) and navigate to the URL.
2
Take a Snapshot
Get the accessibility tree with element refs:The Each element gets a unique
-i flag shows only interactive elements (buttons, inputs, links). Output:@e{N} ref that you can use to interact with it.3
Fill the Form
Use refs to fill inputs and click buttons:Refs are deterministic -
@e1 always refers to the same element from the snapshot.4
Get Results
Wait for navigation and check the result:This shows the current URL and the new page structure.
5
Clean Up
Close the browser when done:
Alternative Selector Methods
You can also use traditional selectors alongside refs:Refs are recommended for AI agents because they’re deterministic and don’t require DOM knowledge. CSS selectors are useful when you know the page structure.
Command Chaining
Chain multiple commands for efficiency:JSON Output for AI Agents
Use--json for machine-readable output:
Sessions for Parallel Browsers
Run multiple isolated browser instances:Headed Mode for Debugging
See what the browser is doing:Common Patterns
Wait for Elements
Get Information
Navigate
Screenshots
Annotated Screenshots
For multimodal AI models that can see images:[1] = @e1, [2] = @e2), so you can use the same refs after viewing the annotated screenshot.
Next Steps
Core Concepts
Learn about the Rust CLI + Node.js daemon architecture
All Commands
Browse the complete command reference
Security Features
Auth vault, domain allowlist, action policies
AI Agent Integration
Use with Claude Code, Cursor, and other AI assistants