t1k:web:testing:agent-browser
| Field | Value |
|---|---|
| Module | testing |
| Version | 1.7.0 |
| Effort | high |
| Tools | — |
Keywords: agent-browser, automation, browser, playwright, testing
How to invoke
Section titled “How to invoke”/t1k:web:testing:agent-browser[url or task]agent-browser Skill
Section titled “agent-browser Skill”Browser automation CLI designed for AI agents. Uses “snapshot + refs” paradigm for 93% less context than Playwright MCP.
Quick Start
Section titled “Quick Start”# Install globallynpm install -g agent-browser
# Download Chromium (one-time)agent-browser install
# Linux: include system depsagent-browser install --with-deps
# Verifyagent-browser --versionCore Workflow
Section titled “Core Workflow”The 4-step pattern for all browser automation:
# 1. Navigateagent-browser open https://example.com
# 2. Snapshot (get interactive elements with refs)agent-browser snapshot -i# Output: button "Sign In" @e1, textbox "Email" @e2, ...
# 3. Interact using refsagent-browser click @e1
# 4. Re-snapshot after page changesagent-browser snapshot -iWhen to Use (vs chrome-devtools)
Section titled “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
Section titled “Command Reference”Full command reference (navigate, click, type, screenshot, wait, etc.): see references/command-reference.md.
Global Options
Section titled “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
Section titled “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
Section titled “Common Patterns”Full common patterns (form submission, auth flows, SPAs): see references/common-patterns.md.
Cloud Browsers (Browserbase)
Section titled “Cloud Browsers (Browserbase)”For CI/CD or environments without local browser:
# Set credentialsexport BROWSERBASE_API_KEY="your-api-key"export BROWSERBASE_PROJECT_ID="your-project-id"
# Use cloud browseragent-browser -p browserbase open https://example.comSee references/browserbase-cloud-setup.md for detailed setup.
Troubleshooting
Section titled “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
Section titled “Resources”- GitHub Repository
- Official Documentation
- Browserbase Docs
- Comparison: agent-browser vs chrome-devtools
Gotchas
Section titled “Gotchas”- BROWSERBASE_API_KEY exported to env IS a credential leak — wrap in per-instance closure, rotate quarterly.
- Headless browser sessions have a default timeout — long-running automation needs explicit keep-alive.
- CDP (Chrome DevTools Protocol) version drift between local and remote — pin Chrome major in both.