Skip to content

Commit c046de2

Browse files
authored
docs: update agent-browser skill documentation (#164)
1 parent 55f4eaa commit c046de2

1 file changed

Lines changed: 101 additions & 35 deletions

File tree

skills/agent-browser/SKILL.md

Lines changed: 101 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,20 @@ agent-browser close # Close browser
2626
## Commands
2727

2828
### Navigation
29+
2930
```bash
30-
agent-browser open <url> # Navigate to URL
31+
agent-browser open <url> # Navigate to URL (aliases: goto, navigate)
32+
# Supports: https://, http://, file://, about:, data://
33+
# Auto-prepends https:// if no protocol given
3134
agent-browser back # Go back
3235
agent-browser forward # Go forward
3336
agent-browser reload # Reload page
34-
agent-browser close # Close browser
37+
agent-browser close # Close browser (aliases: quit, exit)
38+
agent-browser connect 9222 # Connect to browser via CDP port
3539
```
3640

3741
### Snapshot (page analysis)
42+
3843
```bash
3944
agent-browser snapshot # Full accessibility tree
4045
agent-browser snapshot -i # Interactive elements only (recommended)
@@ -44,27 +49,30 @@ agent-browser snapshot -s "#main" # Scope to CSS selector
4449
```
4550

4651
### Interactions (use @refs from snapshot)
52+
4753
```bash
4854
agent-browser click @e1 # Click
4955
agent-browser dblclick @e1 # Double-click
5056
agent-browser focus @e1 # Focus element
5157
agent-browser fill @e2 "text" # Clear and type
5258
agent-browser type @e2 "text" # Type without clearing
53-
agent-browser press Enter # Press key
59+
agent-browser press Enter # Press key (alias: key)
5460
agent-browser press Control+a # Key combination
5561
agent-browser keydown Shift # Hold key down
5662
agent-browser keyup Shift # Release key
5763
agent-browser hover @e1 # Hover
5864
agent-browser check @e1 # Check checkbox
5965
agent-browser uncheck @e1 # Uncheck checkbox
60-
agent-browser select @e1 "value" # Select dropdown
61-
agent-browser scroll down 500 # Scroll page
62-
agent-browser scrollintoview @e1 # Scroll element into view
66+
agent-browser select @e1 "value" # Select dropdown option
67+
agent-browser select @e1 "a" "b" # Select multiple options
68+
agent-browser scroll down 500 # Scroll page (default: down 300px)
69+
agent-browser scrollintoview @e1 # Scroll element into view (alias: scrollinto)
6370
agent-browser drag @e1 @e2 # Drag and drop
6471
agent-browser upload @e1 file.pdf # Upload files
6572
```
6673
6774
### Get information
75+
6876
```bash
6977
agent-browser get text @e1 # Get element text
7078
agent-browser get html @e1 # Get innerHTML
@@ -74,16 +82,19 @@ agent-browser get title # Get page title
7482
agent-browser get url # Get current URL
7583
agent-browser get count ".item" # Count matching elements
7684
agent-browser get box @e1 # Get bounding box
85+
agent-browser get styles @e1 # Get computed styles (font, color, bg, etc.)
7786
```
7887
7988
### Check state
89+
8090
```bash
8191
agent-browser is visible @e1 # Check if visible
8292
agent-browser is enabled @e1 # Check if enabled
8393
agent-browser is checked @e1 # Check if checked
8494
```
8595
8696
### Screenshots & PDF
97+
8798
```bash
8899
agent-browser screenshot # Screenshot to stdout
89100
agent-browser screenshot path.png # Save to file
@@ -92,25 +103,30 @@ agent-browser pdf output.pdf # Save as PDF
92103
```
93104
94105
### Video recording
106+
95107
```bash
96108
agent-browser record start ./demo.webm # Start recording (uses current URL + state)
97109
agent-browser click @e1 # Perform actions
98110
agent-browser record stop # Stop and save video
99111
agent-browser record restart ./take2.webm # Stop current + start new recording
100112
```
101-
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.
113+
114+
Recording creates a fresh context but preserves cookies/storage from your session. If no URL is provided, it
115+
automatically returns to your current page. For smooth demos, explore first, then start recording.
102116
103117
### Wait
118+
104119
```bash
105120
agent-browser wait @e1 # Wait for element
106121
agent-browser wait 2000 # Wait milliseconds
107-
agent-browser wait --text "Success" # Wait for text
108-
agent-browser wait --url "**/dashboard" # Wait for URL pattern
109-
agent-browser wait --load networkidle # Wait for network idle
110-
agent-browser wait --fn "window.ready" # Wait for JS condition
122+
agent-browser wait --text "Success" # Wait for text (or -t)
123+
agent-browser wait --url "**/dashboard" # Wait for URL pattern (or -u)
124+
agent-browser wait --load networkidle # Wait for network idle (or -l)
125+
agent-browser wait --fn "window.ready" # Wait for JS condition (or -f)
111126
```
112127
113128
### Mouse control
129+
114130
```bash
115131
agent-browser mouse move 100 200 # Move mouse
116132
agent-browser mouse down left # Press button
@@ -119,26 +135,36 @@ agent-browser mouse wheel 100 # Scroll wheel
119135
```
120136
121137
### Semantic locators (alternative to refs)
138+
122139
```bash
123140
agent-browser find role button click --name "Submit"
124141
agent-browser find text "Sign In" click
142+
agent-browser find text "Sign In" click --exact # Exact match only
125143
agent-browser find label "Email" fill "user@test.com"
144+
agent-browser find placeholder "Search" type "query"
145+
agent-browser find alt "Logo" click
146+
agent-browser find title "Close" click
147+
agent-browser find testid "submit-btn" click
126148
agent-browser find first ".item" click
127-
agent-browser find nth 2 "a" text
149+
agent-browser find last ".item" click
150+
agent-browser find nth 2 "a" hover
128151
```
129152
130153
### Browser settings
154+
131155
```bash
132-
agent-browser set viewport 1920 1080 # Set viewport size
133-
agent-browser set device "iPhone 14" # Emulate device
134-
agent-browser set geo 37.7749 -122.4194 # Set geolocation
135-
agent-browser set offline on # Toggle offline mode
136-
agent-browser set headers '{"X-Key":"v"}' # Extra HTTP headers
137-
agent-browser set credentials user pass # HTTP basic auth
138-
agent-browser set media dark # Emulate color scheme
156+
agent-browser set viewport 1920 1080 # Set viewport size
157+
agent-browser set device "iPhone 14" # Emulate device
158+
agent-browser set geo 37.7749 -122.4194 # Set geolocation (alias: geolocation)
159+
agent-browser set offline on # Toggle offline mode
160+
agent-browser set headers '{"X-Key":"v"}' # Extra HTTP headers
161+
agent-browser set credentials user pass # HTTP basic auth (alias: auth)
162+
agent-browser set media dark # Emulate color scheme
163+
agent-browser set media light reduced-motion # Light mode + reduced motion
139164
```
140165
141166
### Cookies & Storage
167+
142168
```bash
143169
agent-browser cookies # Get all cookies
144170
agent-browser cookies set name value # Set cookie
@@ -150,6 +176,7 @@ agent-browser storage local clear # Clear all
150176
```
151177
152178
### Network
179+
153180
```bash
154181
agent-browser network route <url> # Intercept requests
155182
agent-browser network route <url> --abort # Block requests
@@ -160,31 +187,71 @@ agent-browser network requests --filter api # Filter requests
160187
```
161188
162189
### Tabs & Windows
190+
163191
```bash
164192
agent-browser tab # List tabs
165193
agent-browser tab new [url] # New tab
166-
agent-browser tab 2 # Switch to tab
167-
agent-browser tab close # Close tab
194+
agent-browser tab 2 # Switch to tab by index
195+
agent-browser tab close # Close current tab
196+
agent-browser tab close 2 # Close tab by index
168197
agent-browser window new # New window
169198
```
170199
171200
### Frames
201+
172202
```bash
173203
agent-browser frame "#iframe" # Switch to iframe
174204
agent-browser frame main # Back to main frame
175205
```
176206
177207
### Dialogs
208+
178209
```bash
179210
agent-browser dialog accept [text] # Accept dialog
180211
agent-browser dialog dismiss # Dismiss dialog
181212
```
182213
183214
### JavaScript
215+
184216
```bash
185217
agent-browser eval "document.title" # Run JavaScript
186218
```
187219
220+
## Global options
221+
222+
```bash
223+
agent-browser --session <name> ... # Isolated browser session
224+
agent-browser --json ... # JSON output for parsing
225+
agent-browser --headed ... # Show browser window (not headless)
226+
agent-browser --full ... # Full page screenshot (-f)
227+
agent-browser --cdp <port> ... # Connect via Chrome DevTools Protocol
228+
agent-browser --proxy <url> ... # Use proxy server
229+
agent-browser --headers <json> ... # HTTP headers scoped to URL's origin
230+
agent-browser --executable-path <p> # Custom browser executable
231+
agent-browser --extension <path> ... # Load browser extension (repeatable)
232+
agent-browser --help # Show help (-h)
233+
agent-browser --version # Show version (-V)
234+
agent-browser <command> --help # Show detailed help for a command
235+
```
236+
237+
### Proxy support
238+
239+
```bash
240+
agent-browser --proxy http://proxy.com:8080 open example.com
241+
agent-browser --proxy http://user:pass@proxy.com:8080 open example.com
242+
agent-browser --proxy socks5://proxy.com:1080 open example.com
243+
```
244+
245+
## Environment variables
246+
247+
```bash
248+
AGENT_BROWSER_SESSION="mysession" # Default session name
249+
AGENT_BROWSER_EXECUTABLE_PATH="/path/chrome" # Custom browser path
250+
AGENT_BROWSER_EXTENSIONS="/ext1,/ext2" # Comma-separated extension paths
251+
AGENT_BROWSER_STREAM_PORT="9223" # WebSocket streaming port
252+
AGENT_BROWSER_HOME="/path/to/agent-browser" # Custom install location (for daemon.js)
253+
```
254+
188255
## Example: Form submission
189256
190257
```bash
@@ -227,6 +294,7 @@ agent-browser session list
227294
## JSON output (for parsing)
228295
229296
Add `--json` for machine-readable output:
297+
230298
```bash
231299
agent-browser snapshot -i --json
232300
agent-browser get text @e1 --json
@@ -235,18 +303,16 @@ agent-browser get text @e1 --json
235303
## Debugging
236304
237305
```bash
238-
agent-browser open example.com --headed # Show browser window
239-
agent-browser console # View console messages
240-
agent-browser errors # View page errors
241-
agent-browser record start ./debug.webm # Record from current page
242-
agent-browser record stop # Save recording
243-
agent-browser open example.com --headed # Show browser window
244-
agent-browser --cdp 9222 snapshot # Connect via CDP
245-
agent-browser console # View console messages
246-
agent-browser console --clear # Clear console
247-
agent-browser errors # View page errors
248-
agent-browser errors --clear # Clear errors
249-
agent-browser highlight @e1 # Highlight element
250-
agent-browser trace start # Start recording trace
251-
agent-browser trace stop trace.zip # Stop and save trace
306+
agent-browser --headed open example.com # Show browser window
307+
agent-browser --cdp 9222 snapshot # Connect via CDP port
308+
agent-browser connect 9222 # Alternative: connect command
309+
agent-browser console # View console messages
310+
agent-browser console --clear # Clear console
311+
agent-browser errors # View page errors
312+
agent-browser errors --clear # Clear errors
313+
agent-browser highlight @e1 # Highlight element
314+
agent-browser trace start # Start recording trace
315+
agent-browser trace stop trace.zip # Stop and save trace
316+
agent-browser record start ./debug.webm # Record video from current page
317+
agent-browser record stop # Save recording
252318
```

0 commit comments

Comments
 (0)