| name | vc-agent-browser |
| description | AI-optimized browser automation CLI with context-efficient snapshots. Use for long autonomous sessions, self-verifying workflows, video recording, and cloud browser testing (Browserbase). |
| license | Apache-2.0 |
| argument-hint | [url or task] |
| trigger_keywords | browser, screenshot, scrape, automation, web automation, agent-browser, browserbase, cloud browser, headless, playwright, snapshot |
| layer | helper |
| metadata | {"author":"vibecode-pro-max-kit","version":"1.0.0"} |
agent-browser Skill
Browser automation CLI designed for AI agents. Uses "snapshot + refs" paradigm for 93% less context than Playwright MCP.
Quick Start
npm install -g agent-browser
agent-browser install
agent-browser install --with-deps
agent-browser --version
Core Workflow
The 4-step pattern for all browser automation:
agent-browser open https://example.com
agent-browser snapshot -i
agent-browser fill @e2 "user@example.com"
agent-browser click @e1
agent-browser snapshot -i
Project-Specific Setup
For project-specific connection patterns, logged-in session reuse through chrome-debug, and when to use agent-browser vs chrome-devtools vs direct non-browser verification, see the project's browser-automation testing notes in the consuming repo, if present. This skill file stays a generic tool reference only and should not redefine the project's broader testing policy.
When to Use (vs chrome-devtools)
| Use agent-browser | Use chrome-devtools |
|---|
| Long autonomous AI sessions | Quick one-off screenshots |
| Context-constrained workflows | Custom Puppeteer scripts needed |
| Video recording for debugging | WebSocket full frame debugging |
| Cloud browsers (Browserbase) | Existing workflow integration |
| Multi-tab handling | Need Sharp auto-compression |
| Self-verifying build loops | Session with auth injection |
Token efficiency: ~280 chars/snapshot vs 8K+ for Playwright MCP.
Command Reference
Navigation
agent-browser open <url>
agent-browser back
agent-browser forward
agent-browser reload
agent-browser close
Analysis (Snapshot)
agent-browser snapshot
agent-browser snapshot -i
agent-browser snapshot -c
agent-browser snapshot -d 3
agent-browser snapshot -s "nav"
Interactions (use @refs from snapshot)
agent-browser click @e1
agent-browser dblclick @e1
agent-browser fill @e2 "text"
agent-browser type @e2 "text"
agent-browser press Enter
agent-browser hover @e1
agent-browser check @e3
agent-browser uncheck @e3
agent-browser select @e4 "opt"
agent-browser scroll @e1
agent-browser scroll down 500
agent-browser drag @e1 @e2
agent-browser upload @e5 file.pdf
Information Retrieval
agent-browser get text @e1
agent-browser get html @e1
agent-browser get value @e2
agent-browser get attr @e1 href
agent-browser get title
agent-browser get url
agent-browser get count "li"
agent-browser get box @e1
State Checks
agent-browser is visible @e1
agent-browser is enabled @e1
agent-browser is checked @e3
Media
agent-browser screenshot
agent-browser screenshot --full
agent-browser screenshot -o ss.png
agent-browser pdf -o page.pdf
agent-browser record start
agent-browser record stop
agent-browser record restart
Wait Conditions
agent-browser wait @e1
agent-browser wait --text "Success"
agent-browser wait --url "/dashboard"
agent-browser wait --load
agent-browser wait --idle
agent-browser wait --fn "() => window.ready"
Browser Configuration
agent-browser viewport 1920 1080
agent-browser device "iPhone 14"
agent-browser geolocation 40.7 -74.0
agent-browser offline true
agent-browser headers '{"X-Custom":"val"}'
agent-browser credentials user pass
agent-browser color-scheme dark
Storage Management
agent-browser cookies
agent-browser cookies set name=val
agent-browser cookies clear
agent-browser storage local
agent-browser storage session
agent-browser state save auth.json
agent-browser state load auth.json
Network Control
agent-browser network route "**/*.jpg" --abort
agent-browser network route "**/api/*" --body '{"data":[]}'
agent-browser network unroute "**/*.jpg"
agent-browser network requests
Semantic Finding
agent-browser find role button
agent-browser find text "Submit"
agent-browser find label "Email"
agent-browser find placeholder "Search"
agent-browser find testid "login-btn"
agent-browser find first "button"
agent-browser find last "li"
agent-browser find nth 2 "li"
Advanced
agent-browser tabs
agent-browser tab new
agent-browser tab 2
agent-browser tab close
agent-browser frame 0
agent-browser dialog accept
agent-browser dialog dismiss
agent-browser eval "document.title"
agent-browser highlight @e1
agent-browser mouse move 100 200
agent-browser mouse down
agent-browser mouse up
Global Options
| Option | Description |
|---|
--session <name> | Named session for parallel testing |
--json | JSON output for parsing |
--headed | Show browser window |
--cdp <port> | Connect via Chrome DevTools Protocol |
-p <provider> | Cloud browser provider |
--proxy <url> | Proxy server |
--headers <json> | Custom HTTP headers |
--executable-path | Custom browser binary |
--extension <path> | Load browser extension |
Environment Variables
| Variable | Description |
|---|
AGENT_BROWSER_SESSION | Default session name |
AGENT_BROWSER_PROVIDER | Cloud provider (e.g., browserbase) |
AGENT_BROWSER_EXECUTABLE_PATH | Browser binary location |
AGENT_BROWSER_EXTENSIONS | Comma-separated extension paths |
AGENT_BROWSER_STREAM_PORT | WebSocket streaming port |
AGENT_BROWSER_HOME | Custom installation directory |
AGENT_BROWSER_PROFILE | Browser profile directory |
BROWSERBASE_API_KEY | Browserbase API key |
BROWSERBASE_PROJECT_ID | Browserbase project ID |
Common Patterns
Form Submission
agent-browser open https://example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait url "/dashboard"
State Persistence (Auth)
agent-browser open https://example.com/login
agent-browser state save auth.json
agent-browser state load auth.json
agent-browser open https://example.com/dashboard
Video Recording (Debugging)
agent-browser open https://example.com
agent-browser record start
agent-browser record stop
Parallel Sessions
agent-browser --session test1 open https://example.com
agent-browser --session test2 open https://example.com
Cloud Browsers (Browserbase)
For CI/CD or environments without local browser:
export BROWSERBASE_API_KEY="your-api-key"
export BROWSERBASE_PROJECT_ID="your-project-id"
agent-browser -p browserbase open https://example.com
See references/browserbase-cloud-setup.md for detailed setup.
Troubleshooting
| Issue | Solution |
|---|
| Command not found | Run npm install -g agent-browser |
| Chromium missing | Run agent-browser install |
| Linux deps missing | Run agent-browser install --with-deps |
| Session stale | Close browser: agent-browser close |
| Element not found | Re-run snapshot -i after page changes |
Resources