| name | agent-browser |
| description | Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. |
| allowed-tools | Bash(npx agent-browser:*), Bash(agent-browser:*) |
Browser Automation with agent-browser
Core Workflow
Every browser automation follows this pattern:
- Navigate:
agent-browser open <url>
- Snapshot:
agent-browser snapshot -i (get element refs like @e1, @e2)
- Interact: Use refs to click, fill, select
- Re-snapshot: After navigation or DOM changes, get fresh refs
agent-browser open https://example.com/form
agent-browser snapshot -i
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser snapshot -i
Command Chaining
Commands can be chained with && in a single shell invocation. The browser persists between commands via a background daemon.
agent-browser open https://example.com && agent-browser wait --load networkidle && agent-browser snapshot -i
agent-browser fill @e1 "user@example.com" && agent-browser fill @e2 "password123" && agent-browser click @e3
Essential Commands
agent-browser open https://example.com
agent-browser go back
agent-browser reload
agent-browser snapshot -i
agent-browser snapshot -i --all
agent-browser click @e1
agent-browser fill @e2 "Text to type"
agent-browser select @e3 "Option Value"
agent-browser hover @e4
agent-browser press @e1 Enter
agent-browser scroll down
agent-browser diff snapshot
agent-browser wait --load networkidle
agent-browser wait @e1
agent-browser wait 2000
agent-browser close
Advanced Usage and Common Patterns
For information on Mobile Testing, Form Handling, iFrames, Shadow DOM, Security Configuration, Diffing, Timeouts, Ref Lifecycle, Annotated Screenshots (Vision), Locators, and JS evaluation:
See references/ADVANCED.md
Deep-Dive Documentation
Ready-to-Use Templates
./templates/form-automation.sh https://example.com/form
./templates/authenticated-session.sh https://app.example.com/login
./templates/capture-workflow.sh https://example.com ./output