
agent-browser-automation
Headless browser automation CLI for AI agents using native Rust binary with Chrome DevTools Protocol
- Installs
- 2.1K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/reason-machines/trending-skills --skill agent-browser-automation- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads agent-browser-automation automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
agent-browser
Skill by ara.so — Daily 2026 Skills collection.
agent-browser is a headless browser automation CLI built in Rust, designed for AI agents. It wraps Chrome via the Chrome DevTools Protocol (CDP) and exposes a fast, ergonomic command-line interface for navigation, interaction, accessibility snapshots, screenshots, network interception, and more — with no Node.js or Playwright runtime required.
Installation
Recommended (npm global)
npm install -g agent-browser
agent-browser install # Download Chrome for Testing (first time only)
macOS (Homebrew)
brew install agent-browser
agent-browser install
Rust / Cargo
cargo install agent-browser
agent-browser install
Local project dependency
npm install agent-browser
# Add to package.json scripts or invoke via npx
Linux (with system dependencies)
agent-browser install --with-deps
Quick Start
agent-browser open https://example.com
agent-browser snapshot # Accessibility tree with @refs (best for AI)
agent-browser click @e2 # Click by ref from snapshot
agent-browser fill @e3 "hello@example.com" # Fill by ref
agent-browser get text @e1 # Get text content
agent-browser screenshot page.png
agent-browser close
Core Commands
Navigation
agent-browser open <url> # Navigate (aliases: goto, navigate)
agent-browser get url # Get current URL
agent-browser get title # Get page title
agent-browser close # Close browser (aliases: quit, exit)
Accessibility Snapshot (recommended for AI agents)
agent-browser snapshot # Returns accessibility tree with @ref IDs
agent-browser snapshot -i # Interactive / compact mode
Snapshot output includes @eN refs you can use directly:
@e1 [button] "Submit"
@e2 [textbox] "Email" value=""
@e3 [link] "Sign in"
Then act on them:
agent-browser fill @e2 "user@example.com"
agent-browser click @e1
Interaction
agent-browser click <sel> # Click element
agent-browser dblclick <sel> # Double-click
agent-browser fill <sel> <text> # Clear and fill input
agent-browser type <sel> <text> # Type into element
agent-browser press <key> # Press key (Enter, Tab, Control+a)
agent-browser keyboard type <text> # Type at current focus (real keystrokes)
agent-browser keyboard inserttext <text> # Insert text without key events
agent-browser hover <sel> # Hover element
agent-browser select <sel> <value> # Select dropdown option
agent-browser check <sel> # Check checkbox
agent-browser uncheck <sel> # Uncheck checkbox
agent-browser scroll down 500 # Scroll (up/down/left/right, optional px)
agent-browser scroll down --selector "#feed" # Scroll within element
agent-browser scrollintoview <sel> # Scroll element into view
agent-browser drag <src> <target> # Drag and drop
agent-browser upload <sel> /path/file.pdf # Upload file
Screenshots & PDF
agent-browser screenshot # Save to temp dir, print path
agent-browser screenshot page.png # Save to path
agent-browser screenshot --full page.png # Full-page screenshot
agent-browser screenshot --annotate # Numbered element labels overlay
agent-browser screenshot --screenshot-dir ./shots # Custom output directory
agent-browser screenshot --screenshot-format jpeg --screenshot-quality 80
agent-browser pdf output.pdf # Save page as PDF
Getting Element Info
agent-browser get text <sel> # Text content
agent-browser get html <sel> # innerHTML
agent-browser get value <sel> # Input value
agent-browser get attr <sel> <attr> # Attribute value
agent-browser get count <sel> # Count matching elements
agent-browser get box <sel> # Bounding box
agent-browser get styles <sel> # Computed styles
agent-browser get cdp-url # CDP WebSocket URL
State Checks
agent-browser is visible <sel>
agent-browser is enabled <sel>
agent-browser is checked <sel>
Semantic Locators (find)
agent-browser find role button click --name "Submit"
agent-browser find text "Sign In" click
agent-browser find label "Email" fill "test@example.com"
agent-browser find placeholder "Search..." fill "rust"
agent-browser find testid "login-btn" click
agent-browser find first ".item" click
agent-browser find nth 2 "a" text
agent-browser find role textbox fill "hello" --name "Username"
Actions: click, fill, type, hover, focus, check, uncheck, text
Waiting
agent-browser wait "#modal" # Wait for element visible
agent-browser wait 2000 # Wait N milliseconds
agent-browser wait --text "Welcome back" # Wait for text
agent-browser wait --url "**/dashboard" # Wait for URL pattern
agent-browser wait --load networkidle # Wait for load state
agent-browser wait --fn "window.appReady === true" # Wait for JS condition
agent-browser wait "#spinner" --state hidden # Wait for element to disappear
Load states: load, domcontentloaded, networkidle
JavaScript Eval
agent-browser eval "document.title"
agent-browser eval "JSON.stringify(window.__STATE__)"
agent-browser eval -b "BASE64_ENCODED_JS"
echo "return document.body.innerHTML" | agent-browser eval --stdin
Batch Execution (efficient multi-step)
echo '[
["open", "https://example.com"],
["snapshot", "-i"],
["fill", "@e2", "user@example.com"],
["click", "@e1"],
["screenshot", "result.png"]
]' | agent-browser batch --json
# Stop on first failure
agent-browser batch --bail < commands.json
Tabs & Frames
agent-browser tab # List tabs
agent-browser tab new https://... # New tab with URL
agent-browser tab 2 # Switch to tab 2
agent-browser tab close # Close current tab
agent-browser frame "#my-iframe" # Switch into iframe
agent-browser frame main # Return to main frame
Cookies & Storage
agent-browser cookies
agent-browser cookies set session_id "abc123"
agent-browser cookies clear
agent-browser storage local
agent-browser storage local set theme dark
agent-browser storage local clear
agent-browser storage session set cart '{"items":[]}'
Network
agent-browser network route "**/api/users" --body '{"users":[]}' # Mock response
agent-browser network route "**/ads/**" --abort # Block requests
agent-browser network unroute # Remove all routes
agent-browser network requests --filter api # View requests
agent-browser network har start
agent-browser network har stop recording.har
Browser Settings
agent-browser set viewport 1280 800
agent-browser set viewport 375 812 2 # With device pixel ratio (retina)
agent-browser set device "iPhone 14"
agent-browser set geo 37.7749 -122.4194
agent-browser set offline on
agent-browser set headers '{"X-Custom":"value"}'
agent-browser set credentials admin secret
agent-browser set media dark
Auth State
agent-browser state save ./auth.json # Save cookies + localStorage
agent-browser state load ./auth.json # Restore auth state
agent-browser state list # List saved states
agent-browser state show auth.json # Summary of saved state
Dialogs
agent-browser dialog accept # Accept alert/confirm/prompt
agent-browser dialog accept "My input" # Accept prompt with text
agent-browser dialog dismiss
Clipboard
agent-browser clipboard read
agent-browser clipboard write "Hello, World!"
agent-browser clipboard copy # Ctrl+C current selection
agent-browser clipboard paste # Ctrl+V
Diff & Visual Testing
agent-browser diff snapshot # vs last snapshot
agent-browser diff snapshot --baseline before.txt # vs saved file
agent-browser diff snapshot --selector "#main" --compact
agent-browser diff screenshot --baseline before.png
agent-browser diff screenshot --baseline b.png -o diff.png
agent-browser diff url https://v1.example.com https://v2.example.com
agent-browser diff url https://v1.example.com https://v2.example.com --screenshot
agent-browser diff url https://v1.example.com https://v2.example.com --selector "#content"
Debug & Profiling
agent-browser trace start trace.zip
agent-browser trace stop
agent-browser profiler start
agent-browser profiler stop profile.json
agent-browser console # View console messages
agent-browser errors # View uncaught JS exceptions
agent-browser highlight "#button" # Visually highlight element
agent-browser inspect # Open Chrome DevTools
agent-browser connect 9222 # Connect to existing browser via CDP port
Common Patterns
Login flow and save session
#!/bin/bash
agent-browser open https://app.example.com/login
agent-browser fill "#email" "$LOGIN_EMAIL"
agent-browser fill "#password" "$LOGIN_PASSWORD"
agent-browser click "[type=submit]"
agent-browser wait --url "**/dashboard"
agent-browser state save ./session.json
AI agent loop with snapshot-driven interaction
#!/bin/bash
agent-browser open https://app.example.com
agent-browser state load ./session.json
# Get snapshot, parse @refs, act
SNAPSHOT=$(agent-browser snapshot)
echo "$SNAPSHOT"
# Agent determines @e5 is the search box
agent-browser fill @e5 "quarterly report"
agent-browser press Enter
agent-browser wait --load networkidle
agent-browser snapshot
agent-browser screenshot results.png
Batch commands from a script (JSON)
cat > commands.json << 'EOF'
[
["open", "https://news.ycombinator.com"],
["wait", "--load", "networkidle"],
["get", "title"],
["snapshot"],
["screenshot", "hn.png"]
]
EOF
agent-browser batch --json < commands.json
Scrape with mocked network
agent-browser open https://api-heavy-app.example.com
agent-browser network route "**/api/slow-endpoint" --body '{"data":"mocked"}'
agent-browser snapshot
agent-browser network unroute
Full-page screenshot with annotations
agent-browser open https://example.com
agent-browser wait --load networkidle
agent-browser screenshot --full --annotate annotated.png
Connect to already-running Chrome
# Start Chrome with remote debugging
google-chrome --remote-debugging-port=9222 &
agent-browser connect 9222
agent-browser open https://example.com
agent-browser snapshot
Emulate mobile device
agent-browser set device "iPhone 14"
agent-browser open https://example.com
agent-browser screenshot mobile.png
HAR recording for network analysis
agent-browser open https://example.com
agent-browser network har start
agent-browser click "#load-data"
agent-browser wait --load networkidle
agent-browser network har stop session.har
Selector Reference
| Format | Example | Notes |
|---|---|---|
@ref | @e1, @e12 | From snapshot output — preferred for AI |
| CSS | #id, .class, [attr=val] | Standard CSS selectors |
| Text | "Sign In" | Exact text match |
| XPath | //button[@type='submit'] | Full XPath |
Troubleshooting
Chrome not found
agent-browser install # Downloads Chrome for Testing
agent-browser install --with-deps # Linux: also installs system libs
Element not found / timing issues
agent-browser wait "#my-element" # Wait for visibility first
agent-browser wait --load networkidle # Wait for page to settle
agent-browser wait --fn "!!document.querySelector('#app')"
Selector issues — use snapshot refs instead
# Instead of fragile CSS:
agent-browser click ".btn.btn-primary.submit-form"
# Use snapshot refs:
agent-browser snapshot # Find @e7 = [button] "Submit"
agent-browser click @e7
Debug what's on the page
agent-browser screenshot debug.png # Visual check
agent-browser snapshot # Accessibility tree
agent-browser console # JS console output
agent-browser errors # Uncaught exceptions
agent-browser eval "document.readyState"
Auth issues between sessions
agent-browser state save ./auth.json # After successful login
agent-browser state load ./auth.json # At start of next session
Handling alerts/dialogs
# Set up handler BEFORE the action that triggers dialog
agent-browser dialog accept
agent-browser click "#delete-button"
Performance — use batch for multi-step workflows
# Slow: one process per command
agent-browser open https://example.com
agent-browser fill "#q" "search"
agent-browser click "#submit"
# Fast: single process, multiple commands
echo '[["open","https://example.com"],["fill","#q","search"],["click","#submit"]]' \
| agent-browser batch --json
FAQ
What does the agent-browser-automation skill do?
Headless browser automation CLI for AI agents using native Rust binary with Chrome DevTools Protocol
How do I install agent-browser-automation?
Run npx skills add https://github.com/reason-machines/trending-skills --skill agent-browser-automation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/agent-browser-automation/ (personal) or .claude/skills/agent-browser-automation/ (project).
Which AI agents can use agent-browser-automation?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is agent-browser-automation safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains agent-browser-automation?
It is published by reason-machines in reason-machines/trending-skills. It has 2,111 recorded installs.
More from reason-machines/trending-skills
openclaw-control-center
reason-machines/trending-skills
Local-first, security-first control center for OpenClaw agents — visibility dashboard with readonly defaults, token attribution, collaboration tracing, and safe write operations.
inkos-multi-agent-novel-writing
reason-machines/trending-skills
Multi-agent CLI system for autonomous novel writing, auditing, and revision with human review gates
claude-hud-statusline
reason-machines/trending-skills
A Claude Code plugin that displays a real-time HUD showing context usage, active tools, running agents, and todo progress in your terminal statusline.
understand-anything-knowledge-graph
reason-machines/trending-skills
Turn any codebase into an interactive knowledge graph using Claude Code skills — explore, search, and ask questions about any project visually.
agency-agents-ai-specialists
reason-machines/trending-skills
A collection of specialized AI agent personalities for Claude Code, Cursor, Aider, Windsurf, and other AI coding tools — covering engineering, design, marketing, sales, and more.
ui-ux-pro-max-skill
reason-machines/trending-skills
AI design intelligence skill for building professional UI/UX across multiple platforms with 161 reasoning rules, 67 styles, and automated design system generation
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
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. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。