Appearance
Usage
Minimal Example: Open a Page, Read It, Click, Fill, Close
bash
# 1. Open a page
agent-browser open https://example.com
# 2. Get the compact accessibility tree (interactive elements only)
agent-browser snapshot -iSample output from snapshot -i:
- heading "Example Domain" [ref=e1] [level=1]
- link "More information..." [ref=e2]bash
# 3. Click an element by its ref
agent-browser click @e2
# 4. Fill a form field by ref
agent-browser fill @e3 "test@example.com"
# 5. Take a screenshot
agent-browser screenshot page.png
# 6. Close the browser
agent-browser closeKey Commands
| Command | What it does |
|---|---|
agent-browser open <url> | Navigate to a URL |
agent-browser snapshot | Full accessibility tree |
agent-browser snapshot -i | Interactive elements only (compact, token-efficient) |
agent-browser click @eN | Click element by ref |
agent-browser fill @eN "text" | Clear and fill an input |
agent-browser screenshot <file> | Capture page as PNG |
agent-browser close | End the browser session |
Session Persistence
Save and restore auth state (cookies, localStorage) across runs:
bash
# Save session state after login
agent-browser save-session ./session.json
# Restore session on next run
agent-browser open https://app.example.com --session ./session.jsonAdd session.json to .gitignore -- it contains plaintext tokens.
Proxy Support
bash
agent-browser open https://example.com --proxy socks5://user:pass@proxy.host:1080Domain Restriction
bash
agent-browser open https://example.com --allowed-domains example.com,api.example.comJSON Output (for agent pipelines)
bash
agent-browser snapshot -i --jsonReturns structured JSON with refs, roles, names, and bounds -- suitable for piping directly into an LLM prompt.