Quick Start
Basic workflow
agent-browser open example.com
agent-browser snapshot # Get accessibility tree with refs
agent-browser click @e2 # Click by ref from snapshot
agent-browser fill @e3 "[email protected]" # Fill by ref
agent-browser get text @e1 # Get text by ref
agent-browser screenshot # Save to a temporary directory
agent-browser screenshot page.png # Save to a specific path
agent-browser closeTraditional selectors
CSS selectors and semantic locators also supported:
agent-browser click "#submit"
agent-browser fill "#email" "[email protected]"
agent-browser find role button click --name "Submit"AI workflow
Optimal workflow for AI agents:
# 1. Navigate and get snapshot
agent-browser open example.com
agent-browser snapshot -i --json # AI parses tree and refs
# 2. AI identifies target refs from snapshot
# 3. Execute actions using refs
agent-browser click @e2
agent-browser fill @e3 "input text"
# 4. Get new snapshot if page changed
agent-browser snapshot -i --jsonHeaded mode
Show browser window for debugging:
agent-browser open example.com --headedJSON output
Use --json for machine-readable output:
agent-browser snapshot --json
agent-browser get text @e1 --json
agent-browser is visible @e2 --json