# agent-browser — AI Agent Browser Automation CLI (2026) > agent-browser is a Rust CLI for AI agent browser automation; verified 32,919★ with snapshot refs, click/fill commands, and Chrome-for-Testing install. ## Install Copy the content below into your project: ## Quick Use ```bash npm install -g agent-browser agent-browser install agent-browser open https://example.com agent-browser snapshot agent-browser screenshot page.png ``` ## Intro agent-browser is a Rust CLI for AI agent browser automation; verified 32,919★ with snapshot refs, click/fill commands, and Chrome-for-Testing install. **Best for:** Agent builders who want a fast, scriptable browser CLI without wiring Playwright into every project **Works with:** macOS/Linux/Windows, Chrome (or Chrome for Testing), and CI scripts **Setup time:** 2-5 minutes ## Main - The core ergonomic win is `snapshot` refs (like `@e2`) so agents can click/fill by stable accessibility-derived handles instead of brittle CSS selectors. - Installation stays pragmatic: npm/Homebrew/Cargo paths are documented, and `agent-browser install` can fetch Chrome from the official Chrome-for-Testing channel when needed. - The command surface is intentionally CLI-first (open/click/fill/find/screenshot/pdf/stream), which makes it easy to wrap into scripts, task runners, or agent toolchains. - For traditional automation, it still supports CSS selectors and role-based find commands; you can start with refs and drop to selectors when you need precision. ### FAQ - **Do I need Playwright in my project?**: Not necessarily. The README positions agent-browser as a standalone CLI; you install it and drive Chrome via the CLI commands and refs. - **Why run `agent-browser install`?**: It can download Chrome from the official Chrome for Testing channel (first run) and helps standardize automation environments across machines. - **What should I verify first?**: Open a URL, run `snapshot`, then `click @e...` and take a screenshot so you validate the ref-based interaction loop end-to-end. ## Source & Thanks > Source: https://github.com/vercel-labs/agent-browser > License: Apache-2.0 > GitHub stars: 32921 · forks: 2035 --- ## Quick Use ```bash npm install -g agent-browser agent-browser install agent-browser open https://example.com agent-browser snapshot agent-browser screenshot page.png ``` ## Intro agent-browser 是 Rust 原生的 AI 代理浏览器自动化 CLI;已核验 32,919★,支持 snapshot 引用、click/fill 命令与 Chrome-for-Testing 安装。 **Best for:** 希望用高性能 CLI 做浏览器自动化、且不想在每个项目里集成 Playwright 的 agent 构建者 **Works with:** macOS/Linux/Windows、Chrome(或 Chrome for Testing)与 CI 脚本 **Setup time:** 2-5 minutes ## Main - `snapshot` 输出带引用(如 `@e2`),让 agent 能基于可访问性树做 click/fill,避免依赖脆弱的 CSS 选择器,这是它最“agent-friendly”的点。 - 安装路径足够务实:npm/Homebrew/Cargo 都有说明,并且 `agent-browser install` 可按需从官方 Chrome-for-Testing 渠道拉取浏览器。 - 它把能力做成 CLI 命令面(open/click/fill/find/screenshot/pdf/stream),更适合作为脚本/任务编排/agent 工具链的一环。 - 需要更精细控制时仍支持传统选择器与基于 role 的查找,你可以先用引用跑通,再在关键步骤切换到 selector。 ### FAQ - **一定要在项目里装 Playwright 吗?**:不一定。README 把它定位成独立 CLI:安装后通过命令与引用驱动浏览器即可,无需把 Playwright 作为每个项目的依赖。 - **为什么要先跑 `agent-browser install`?**:它会在首次使用时按需下载 Chrome for Testing,并帮助在不同机器/CI 上统一可复现的自动化环境。 - **第一步怎么验证最靠谱?**:先 open 一个 URL,再 `snapshot`,然后用 `click @e...` 走通一次交互并截图,确认引用式控制闭环。 ## Source & Thanks > Source: https://github.com/vercel-labs/agent-browser > License: Apache-2.0 > GitHub stars: 32921 · forks: 2035 --- Source: https://tokrepo.com/en/workflows/agent-browser-ai-agent-browser-automation-cli-2026 Author: Script Depot