Complete options reference for agent-browser.
Use named session for state management.
Example:
agent-browser open https://example.com --session my-session
Environment Variable: AGENT_BROWSER_SESSION
Custom HTTP headers (JSON format).
Example:
agent-browser open https://example.com --headers '{"User-Agent": "MyBot"}'
Environment Variable: AGENT_BROWSER_HEADERS
Custom browser executable path.
Example:
agent-browser open https://example.com --executable-path /path/to/chromium
Environment Variable: AGENT_BROWSER_EXECUTABLE_PATH
Run in headed mode (visible browser).
Example:
agent-browser open https://example.com --headed
Connect via Chrome DevTools Protocol.
Example:
agent-browser open https://example.com --cdp 9222
JSON output format.
Example:
agent-browser snapshot --json
Enable debug output.
Example:
agent-browser open https://example.com --debug
Interactive snapshot mode.
Example:
agent-browser snapshot -i
Compact snapshot format.
Example:
agent-browser snapshot -c
Limit snapshot depth.
Example:
agent-browser snapshot -d 2
Filter by selector.
Example:
agent-browser snapshot -s "main"
Full snapshot with all details.
Example:
agent-browser snapshot --full
Filter by accessible name.
Example:
agent-browser snapshot -n "Submit"
Exact name match.
Example:
agent-browser snapshot -n "Submit" --exact
Mouse button for click (left, right, middle).
Example:
agent-browser click @e1 --button right
Scroll to element.
Example:
agent-browser scroll --to @e1
Close all pages.
Example:
agent-browser close --all
PDF paper format.
Example:
agent-browser pdf output.pdf --format A4
Print background in PDF.
Example:
agent-browser pdf output.pdf --print-background
AGENT_BROWSER_SESSION: Default session nameAGENT_BROWSER_HEADERS: Default headers (JSON)AGENT_BROWSER_EXECUTABLE_PATH: Default executable path--json for agent mode--session for state management