agent-browser
Original:🇺🇸 English
Translated
Fast headless browser CLI for AI agents. Supports deterministic element selection via accessibility tree snapshots and refs (@e1, @e2).
10.6kinstalls
Added on
NPX Install
npx skill4agent add supercent-io/skills-template agent-browserTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →agent-browser - Headless Browser for AI Agents
When to use this skill
- Web automation and E2E testing
- Scraping data from modern web apps
- Deterministic element interaction using accessibility tree refs
- Isolated browser sessions for different agent tasks
1. Installation
bash
npx skills add vercel-labs/agent-browser
# or
npm install -g agent-browser
agent-browser install2. Core Workflow (Deterministic Interaction)
AI agents should use the snapshot + ref workflow for best results:
- Navigate:
agent-browser open <url> - Snapshot: (Returns tree with refs like @e1, @e2)
agent-browser snapshot -i - Interact: or
agent-browser click @e1agent-browser fill @e2 "text" - Repeat: Snapshot again if page changes
3. Key Commands
| Command | Description |
|---|---|
| Navigate to a URL |
| Get accessibility tree with refs |
| Click element (by ref or CSS) |
| Clear and fill input |
| Take page screenshot |
| Quit browser session |
4. Advanced Features
- Isolated Sessions: Use to isolate cookies/storage.
--session <name> - Persistent Profiles: Use to persist login sessions.
--profile <path> - Semantic Locators:
find role button click --name "Submit" - JavaScript Execution:
eval "window.scrollTo(0, 100)"
Quick Reference
bash
# Optimal AI Workflow
agent-browser open example.com
agent-browser snapshot -i --json
# (AI parses refs)
agent-browser click @e2