{"id":18095,"library":"agent-browser","title":"agent-browser","description":"agent-browser is a browser automation CLI optimized for AI agents, built in Rust for speed. The current stable version is 0.26.0, with frequent releases (weekly/biweekly). It differentiates from Puppeteer/Playwright by being a native CLI with zero runtime dependencies (no Node.js required for the daemon), supporting headless Chrome via CDP, AI chat commands, and observability dashboard. It offers both accessibility-ref-based and traditional CSS selector interactions, and includes a daemon for persistent sessions.","status":"active","version":"0.26.0","language":"javascript","source_language":"en","source_url":"https://github.com/vercel-labs/agent-browser","tags":["javascript","browser","automation","headless","chrome","cdp","cli","agent"],"install":[{"cmd":"npm install agent-browser","lang":"bash","label":"npm"},{"cmd":"yarn add agent-browser","lang":"bash","label":"yarn"},{"cmd":"pnpm add agent-browser","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Downloads Chrome for Testing during install, required for automation","package":"chrome-for-testing","optional":true}],"imports":[{"note":"agent-browser is a CLI tool, not a library. Use as global command or via npx.","wrong":"const agentBrowser = require('agent-browser')","symbol":"agent-browser (CLI)","correct":"npm install -g agent-browser or npx agent-browser"},{"note":"Package name is 'agent-browser', scoped packages are not correct.","wrong":"npm install @vercel/agent-browser","symbol":"agent-browser (npm package)","correct":"npm install agent-browser"},{"note":"Homebrew formula is just 'agent-browser'.","wrong":"brew install vercel/agent-browser","symbol":"Homebrew install","correct":"brew install agent-browser"}],"quickstart":{"code":"npm install -g agent-browser\nagent-browser install\nagent-browser open example.com\nagent-browser snapshot\nagent-browser click @e2\nagent-browser fill @e3 \"test@example.com\"\nagent-browser get text @e1\nagent-browser screenshot page.png\nagent-browser close\n","lang":"typescript","description":"Shows global install, Chrome download, navigating to a URL, taking a snapshot, clicking a ref, filling a form, getting text, taking a screenshot, and closing the browser."},"warnings":[{"fix":"Use execSync or spawn from child_process module to run commands.","message":"agent-browser is a CLI tool, not a Node.js library. Do not import it via require/import in JavaScript/TypeScript code. Use child_process.exec or similar to invoke the CLI.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Set AI_GATEWAY_API_KEY or use --key flag with the command.","message":"From v0.25.0, the 'chat' command requires AI_GATEWAY_API_KEY environment variable. Missing it will cause an error.","severity":"breaking","affected_versions":">=0.25.0"},{"fix":"Use --no-install or configure to use existing browser via CHROME_PATH environment variable.","message":"The 'install' command downloads Chrome from Chrome for Testing. If you already have Chrome, Brave, etc., it may still download its own executable (~200MB).","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure scripts using --provider are updated to specify the provider name.","message":"In v0.24.0, the 'provider' flag was added for cloud browser providers (e.g., AWS Bedrock AgentCore). Using '--provider' without specifying a valid provider may break existing scripts.","severity":"breaking","affected_versions":">=0.24.0"},{"fix":"Run 'agent-browser stop' or kill the daemon process manually.","message":"The daemon process may persist after your session ends. Use 'agent-browser stop' to kill it, otherwise it may occupy the port.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade to v0.23.4 or later.","message":"In v0.23.4, a fix was applied to prevent daemon hang on Linux due to SIGCHLD race condition. Users on older versions may experience hangs.","severity":"breaking","affected_versions":"<0.23.4"},{"fix":"Simply use 'agent-browser dashboard' without prior install.","message":"The 'dashboard install' command is deprecated as of v0.25.1. The dashboard is now embedded in the CLI binary.","severity":"deprecated","affected_versions":">=0.25.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install -g agent-browser' and ensure npm global bin directory is in PATH.","cause":"The CLI is not installed globally or not in PATH.","error":"agent-browser: command not found"},{"fix":"Run 'agent-browser install' or set the CHROME_PATH environment variable to an existing Chrome/Chromium executable.","cause":"No Chrome installation detected and not yet downloaded via agent-browser.","error":"Error: Could not find Chrome. Run 'agent-browser install' to download Chrome."},{"fix":"Set the AI_GATEWAY_API_KEY environment variable or use --key with the command.","cause":"AI chat command requires an API key for the AI Gateway.","error":"Error: AI_GATEWAY_API_KEY is not set"},{"fix":"Run 'agent-browser daemon' to start the daemon, or use 'agent-browser open' to start automatically.","cause":"agent-browser requires a daemon process to manage browser sessions. It may not be started or has crashed.","error":"Error: Failed to connect to daemon. Is the daemon running?"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}