$npx -y skills add szsip239/teamclaw --skill agent-browserA fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.
| 1 | # Browser Automation with agent-browser |
| 2 | |
| 3 | ## Installation |
| 4 | |
| 5 | ### npm recommended |
| 6 | |
| 7 | ```bash |
| 8 | npm install -g agent-browser |
| 9 | agent-browser install |
| 10 | agent-browser install --with-deps |
| 11 | ``` |
| 12 | |
| 13 | ### From Source |
| 14 | |
| 15 | ```bash |
| 16 | git clone https://github.com/vercel-labs/agent-browser |
| 17 | cd agent-browser |
| 18 | pnpm install |
| 19 | pnpm build |
| 20 | agent-browser install |
| 21 | ``` |
| 22 | |
| 23 | ## Quick start |
| 24 | |
| 25 | ```bash |
| 26 | agent-browser open <url> # Navigate to page |
| 27 | agent-browser snapshot -i # Get interactive elements with refs |
| 28 | agent-browser click @e1 # Click element by ref |
| 29 | agent-browser fill @e2 "text" # Fill input by ref |
| 30 | agent-browser close # Close browser |
| 31 | ``` |
| 32 | |
| 33 | ## Core workflow |
| 34 | |
| 35 | 1. Navigate: `agent-browser open <url>` |
| 36 | 2. Snapshot: `agent-browser snapshot -i` (returns elements with refs like `@e1`, `@e2`) |
| 37 | 3. Interact using refs from the snapshot |
| 38 | 4. Re-snapshot after navigation or significant DOM changes |
| 39 | |
| 40 | ## Commands |
| 41 | |
| 42 | ### Navigation |
| 43 | |
| 44 | ```bash |
| 45 | agent-browser open <url> # Navigate to URL |
| 46 | agent-browser back # Go back |
| 47 | agent-browser forward # Go forward |
| 48 | agent-browser reload # Reload page |
| 49 | agent-browser close # Close browser |
| 50 | ``` |
| 51 | |
| 52 | ### Snapshot (page analysis) |
| 53 | |
| 54 | ```bash |
| 55 | agent-browser snapshot # Full accessibility tree |
| 56 | agent-browser snapshot -i # Interactive elements only (recommended) |
| 57 | agent-browser snapshot -c # Compact output |
| 58 | agent-browser snapshot -d 3 # Limit depth to 3 |
| 59 | agent-browser snapshot -s "#main" # Scope to CSS selector |
| 60 | ``` |
| 61 | |
| 62 | ### Interactions (use @refs from snapshot) |
| 63 | |
| 64 | ```bash |
| 65 | agent-browser click @e1 # Click |
| 66 | agent-browser dblclick @e1 # Double-click |
| 67 | agent-browser focus @e1 # Focus element |
| 68 | agent-browser fill @e2 "text" # Clear and type |
| 69 | agent-browser type @e2 "text" # Type without clearing |
| 70 | agent-browser press Enter # Press key |
| 71 | agent-browser press Control+a # Key combination |
| 72 | agent-browser keydown Shift # Hold key down |
| 73 | agent-browser keyup Shift # Release key |
| 74 | agent-browser hover @e1 # Hover |
| 75 | agent-browser check @e1 # Check checkbox |
| 76 | agent-browser uncheck @e1 # Uncheck checkbox |
| 77 | agent-browser select @e1 "value" # Select dropdown |
| 78 | agent-browser scroll down 500 # Scroll page |
| 79 | agent-browser scrollintoview @e1 # Scroll element into view |
| 80 | agent-browser drag @e1 @e2 # Drag and drop |
| 81 | agent-browser upload @e1 file.pdf # Upload files |
| 82 | ``` |
| 83 | |
| 84 | ### Get information |
| 85 | |
| 86 | ```bash |
| 87 | agent-browser get text @e1 # Get element text |
| 88 | agent-browser get html @e1 # Get innerHTML |
| 89 | agent-browser get value @e1 # Get input value |
| 90 | agent-browser get attr @e1 href # Get attribute |
| 91 | agent-browser get title # Get page title |
| 92 | agent-browser get url # Get current URL |
| 93 | agent-browser get count ".item" # Count matching elements |
| 94 | agent-browser get box @e1 # Get bounding box |
| 95 | ``` |
| 96 | |
| 97 | ### Check state |
| 98 | |
| 99 | ```bash |
| 100 | agent-browser is visible @e1 # Check if visible |
| 101 | agent-browser is enabled @e1 # Check if enabled |
| 102 | agent-browser is checked @e1 # Check if checked |
| 103 | ``` |
| 104 | |
| 105 | ### Screenshots & PDF |
| 106 | |
| 107 | ```bash |
| 108 | agent-browser screenshot # Screenshot to stdout |
| 109 | agent-browser screenshot path.png # Save to file |
| 110 | agent-browser screenshot --full # Full page |
| 111 | agent-browser pdf output.pdf # Save as PDF |
| 112 | ``` |
| 113 | |
| 114 | ### Video recording |
| 115 | |
| 116 | ```bash |
| 117 | agent-browser record start ./demo.webm # Start recording (uses current URL + state) |
| 118 | agent-browser click @e1 # Perform actions |
| 119 | agent-browser record stop # Stop and save video |
| 120 | agent-browser record restart ./take2.webm # Stop current + start new recording |
| 121 | ``` |
| 122 | |
| 123 | Recording creates a fresh context but preserves cookies/storage from your session. If no URL is provided, it automatically returns to your current page. For smooth demos, explore first, then start recording. |
| 124 | |
| 125 | ### Wait |
| 126 | |
| 127 | ```bash |
| 128 | agent-browser wait @e1 # Wait for element |
| 129 | agent-browser wait 2000 # Wait milliseconds |
| 130 | agent-browser wait --text "Success" # Wait for text |
| 131 | agent-browser wait --url "/dashboard" # Wait for URL pattern |
| 132 | agent-browser wait --load networkidle # Wait for network idle |
| 133 | agent-browser wait --fn "window.ready" # Wait for JS condition |
| 134 | ``` |
| 135 | |
| 136 | ### Mouse control |
| 137 | |
| 138 | ```bash |
| 139 | agent-browser mouse move 100 200 # Move mouse |
| 140 | agent-browser mouse down left # Press button |
| 141 | agent-browser mouse up left # Release button |
| 142 | agent-browser mouse wheel 100 # Scroll wheel |
| 143 | ``` |
| 144 | |
| 145 | ### Semantic locators (alternative to refs) |
| 146 | |
| 147 | ```bash |
| 148 | agent-browser find role button click -- |