$npx -y skills add vercel-labs/open-agents --skill agent-browserAutomates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
| 1 | # Browser Automation with agent-browser |
| 2 | |
| 3 | ## Quick start |
| 4 | |
| 5 | ```bash |
| 6 | agent-browser open <url> # Navigate to page |
| 7 | agent-browser snapshot -i # Get interactive elements with refs |
| 8 | agent-browser click @e1 # Click element by ref |
| 9 | agent-browser fill @e2 "text" # Fill input by ref |
| 10 | agent-browser close # Close browser |
| 11 | ``` |
| 12 | |
| 13 | ## Core workflow |
| 14 | |
| 15 | 1. Navigate: `agent-browser open <url>` |
| 16 | 2. Snapshot: `agent-browser snapshot -i` (returns elements with refs like `@e1`, `@e2`) |
| 17 | 3. Interact using refs from the snapshot |
| 18 | 4. Re-snapshot after navigation or significant DOM changes |
| 19 | |
| 20 | ## Commands |
| 21 | |
| 22 | ### Navigation |
| 23 | |
| 24 | ```bash |
| 25 | agent-browser open <url> # Navigate to URL (aliases: goto, navigate) |
| 26 | # Supports: https://, http://, file://, about:, data:// |
| 27 | # Auto-prepends https:// if no protocol given |
| 28 | agent-browser back # Go back |
| 29 | agent-browser forward # Go forward |
| 30 | agent-browser reload # Reload page |
| 31 | agent-browser close # Close browser (aliases: quit, exit) |
| 32 | agent-browser connect 9222 # Connect to browser via CDP port |
| 33 | ``` |
| 34 | |
| 35 | ### Snapshot (page analysis) |
| 36 | |
| 37 | ```bash |
| 38 | agent-browser snapshot # Full accessibility tree |
| 39 | agent-browser snapshot -i # Interactive elements only (recommended) |
| 40 | agent-browser snapshot -c # Compact output |
| 41 | agent-browser snapshot -d 3 # Limit depth to 3 |
| 42 | agent-browser snapshot -s "#main" # Scope to CSS selector |
| 43 | ``` |
| 44 | |
| 45 | ### Interactions (use @refs from snapshot) |
| 46 | |
| 47 | ```bash |
| 48 | agent-browser click @e1 # Click |
| 49 | agent-browser dblclick @e1 # Double-click |
| 50 | agent-browser focus @e1 # Focus element |
| 51 | agent-browser fill @e2 "text" # Clear and type |
| 52 | agent-browser type @e2 "text" # Type without clearing |
| 53 | agent-browser press Enter # Press key (alias: key) |
| 54 | agent-browser press Control+a # Key combination |
| 55 | agent-browser keydown Shift # Hold key down |
| 56 | agent-browser keyup Shift # Release key |
| 57 | agent-browser hover @e1 # Hover |
| 58 | agent-browser check @e1 # Check checkbox |
| 59 | agent-browser uncheck @e1 # Uncheck checkbox |
| 60 | agent-browser select @e1 "value" # Select dropdown option |
| 61 | agent-browser select @e1 "a" "b" # Select multiple options |
| 62 | agent-browser scroll down 500 # Scroll page (default: down 300px) |
| 63 | agent-browser scrollintoview @e1 # Scroll element into view (alias: scrollinto) |
| 64 | agent-browser drag @e1 @e2 # Drag and drop |
| 65 | agent-browser upload @e1 file.pdf # Upload files |
| 66 | ``` |
| 67 | |
| 68 | ### Get information |
| 69 | |
| 70 | ```bash |
| 71 | agent-browser get text @e1 # Get element text |
| 72 | agent-browser get html @e1 # Get innerHTML |
| 73 | agent-browser get value @e1 # Get input value |
| 74 | agent-browser get attr @e1 href # Get attribute |
| 75 | agent-browser get title # Get page title |
| 76 | agent-browser get url # Get current URL |
| 77 | agent-browser get count ".item" # Count matching elements |
| 78 | agent-browser get box @e1 # Get bounding box |
| 79 | agent-browser get styles @e1 # Get computed styles (font, color, bg, etc.) |
| 80 | ``` |
| 81 | |
| 82 | ### Check state |
| 83 | |
| 84 | ```bash |
| 85 | agent-browser is visible @e1 # Check if visible |
| 86 | agent-browser is enabled @e1 # Check if enabled |
| 87 | agent-browser is checked @e1 # Check if checked |
| 88 | ``` |
| 89 | |
| 90 | ### Screenshots & PDF |
| 91 | |
| 92 | ```bash |
| 93 | agent-browser screenshot # Save to a temporary directory |
| 94 | agent-browser screenshot path.png # Save to a specific path |
| 95 | agent-browser screenshot --full # Full page |
| 96 | agent-browser pdf output.pdf # Save as PDF |
| 97 | ``` |
| 98 | |
| 99 | ### Video recording |
| 100 | |
| 101 | ```bash |
| 102 | agent-browser record start ./demo.webm # Start recording (uses current URL + state) |
| 103 | agent-browser click @e1 # Perform actions |
| 104 | agent-browser record stop # Stop and save video |
| 105 | agent-browser record restart ./take2.webm # Stop current + start new recording |
| 106 | ``` |
| 107 | |
| 108 | Recording creates a fresh context but preserves cookies/storage from your session. If no URL is provided, it |
| 109 | automatically returns to your current page. For smooth demos, explore first, then start recording. |
| 110 | |
| 111 | ### Wait |
| 112 | |
| 113 | ```bash |
| 114 | agent-browser wait @e1 # Wait for element |
| 115 | agent-browser wait 2000 # Wait milliseconds |
| 116 | agent-browser wait --text "Success" # Wait for text (or -t) |
| 117 | agent-browser wait --url "**/dashboard" # Wait for URL pattern (or -u) |
| 118 | agent-browser wait --load networkidle # Wait for network idle (or -l) |
| 119 | agent-browser wait --fn "window.ready" # Wait for JS condition (or -f) |
| 120 | ``` |
| 121 | |
| 122 | ### Mouse control |
| 123 | |
| 124 | ```bash |
| 125 | agent-browser mouse move 100 200 # Move mouse |
| 126 | agent-browser mouse down left # Press button |
| 127 | agent-browser mouse up left # Release button |
| 128 | agent-browser mouse whe |