gm-cc 2.0.105 → 2.0.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/cli.js +2 -7
- package/hooks/stop-hook-git.js +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills/agent-browser/SKILL.md +512 -0
- package/skills/code-search/SKILL.md +32 -0
- package/skills/dev/SKILL.md +48 -0
- package/skills/gm/SKILL.md +377 -0
- package/skills/planning/SKILL.md +335 -0
- package/skills/process-management/SKILL.md +207 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "AnEntrypoint"
|
|
5
5
|
},
|
|
6
6
|
"description": "State machine agent with hooks, skills, and automated git enforcement",
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.107",
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "State machine agent with hooks, skills, and automated git enforcement"
|
|
10
10
|
},
|
package/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ console.log(isUpgrade ? 'Upgrading gm-cc...' : 'Installing gm-cc...');
|
|
|
14
14
|
try {
|
|
15
15
|
fs.mkdirSync(destDir, { recursive: true });
|
|
16
16
|
|
|
17
|
-
const filesToCopy = [["agents","agents"],["hooks","hooks"],[".mcp.json",".mcp.json"],["README.md","README.md"]];
|
|
17
|
+
const filesToCopy = [["agents","agents"],["hooks","hooks"],["skills","plugins/gm-cc/skills"],[".mcp.json",".mcp.json"],["README.md","README.md"]];
|
|
18
18
|
|
|
19
19
|
function copyRecursive(src, dst) {
|
|
20
20
|
if (!fs.existsSync(src)) return;
|
|
@@ -28,12 +28,7 @@ try {
|
|
|
28
28
|
|
|
29
29
|
filesToCopy.forEach(([src, dst]) => copyRecursive(path.join(srcDir, src), path.join(destDir, dst)));
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
execSync('bunx skills add AnEntrypoint/plugforge --full-depth --all --global --yes', { stdio: 'inherit' });
|
|
34
|
-
} catch (e) {
|
|
35
|
-
console.warn('Warning: skills install failed (non-fatal):', e.message);
|
|
36
|
-
}
|
|
31
|
+
|
|
37
32
|
|
|
38
33
|
const destPath = process.platform === 'win32' ? destDir.replace(/\\/g, '/') : destDir;
|
|
39
34
|
console.log(`✓ gm-cc ${isUpgrade ? 'upgraded' : 'installed'} to ${destPath}`);
|
package/hooks/stop-hook-git.js
CHANGED
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-browser
|
|
3
|
+
description: Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
|
|
4
|
+
allowed-tools: Bash(agent-browser:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Browser Automation with agent-browser
|
|
8
|
+
|
|
9
|
+
## Core Workflow
|
|
10
|
+
|
|
11
|
+
Every browser automation follows this pattern:
|
|
12
|
+
|
|
13
|
+
1. **Navigate**: `agent-browser open <url>`
|
|
14
|
+
2. **Snapshot**: `agent-browser snapshot -i` (get element refs like `@e1`, `@e2`)
|
|
15
|
+
3. **Interact**: Use refs to click, fill, select
|
|
16
|
+
4. **Re-snapshot**: After navigation or DOM changes, get fresh refs
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
agent-browser open https://example.com/form
|
|
20
|
+
agent-browser snapshot -i
|
|
21
|
+
# Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Submit"
|
|
22
|
+
|
|
23
|
+
agent-browser fill @e1 "user@example.com"
|
|
24
|
+
agent-browser fill @e2 "password123"
|
|
25
|
+
agent-browser click @e3
|
|
26
|
+
agent-browser wait --load networkidle
|
|
27
|
+
agent-browser snapshot -i # Check result
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Essential Commands
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Navigation
|
|
34
|
+
agent-browser open <url> # Navigate (aliases: goto, navigate)
|
|
35
|
+
agent-browser close # Close browser
|
|
36
|
+
|
|
37
|
+
# Snapshot
|
|
38
|
+
agent-browser snapshot -i # Interactive elements with refs (recommended)
|
|
39
|
+
agent-browser snapshot -i -C # Include cursor-interactive elements (divs with onclick, cursor:pointer)
|
|
40
|
+
agent-browser snapshot -s "#selector" # Scope to CSS selector
|
|
41
|
+
|
|
42
|
+
# Interaction (use @refs from snapshot)
|
|
43
|
+
agent-browser click @e1 # Click element
|
|
44
|
+
agent-browser fill @e2 "text" # Clear and type text
|
|
45
|
+
agent-browser type @e2 "text" # Type without clearing
|
|
46
|
+
agent-browser select @e1 "option" # Select dropdown option
|
|
47
|
+
agent-browser check @e1 # Check checkbox
|
|
48
|
+
agent-browser press Enter # Press key
|
|
49
|
+
agent-browser scroll down 500 # Scroll page
|
|
50
|
+
|
|
51
|
+
# Get information
|
|
52
|
+
agent-browser get text @e1 # Get element text
|
|
53
|
+
agent-browser get url # Get current URL
|
|
54
|
+
agent-browser get title # Get page title
|
|
55
|
+
|
|
56
|
+
# Wait
|
|
57
|
+
agent-browser wait @e1 # Wait for element
|
|
58
|
+
agent-browser wait --load networkidle # Wait for network idle
|
|
59
|
+
agent-browser wait --url "**/page" # Wait for URL pattern
|
|
60
|
+
agent-browser wait 2000 # Wait milliseconds
|
|
61
|
+
|
|
62
|
+
# Capture
|
|
63
|
+
agent-browser screenshot # Screenshot to temp dir
|
|
64
|
+
agent-browser screenshot --full # Full page screenshot
|
|
65
|
+
agent-browser pdf output.pdf # Save as PDF
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Common Patterns
|
|
69
|
+
|
|
70
|
+
### Form Submission
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
agent-browser open https://example.com/signup
|
|
74
|
+
agent-browser snapshot -i
|
|
75
|
+
agent-browser fill @e1 "Jane Doe"
|
|
76
|
+
agent-browser fill @e2 "jane@example.com"
|
|
77
|
+
agent-browser select @e3 "California"
|
|
78
|
+
agent-browser check @e4
|
|
79
|
+
agent-browser click @e5
|
|
80
|
+
agent-browser wait --load networkidle
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Authentication with State Persistence
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Login once and save state
|
|
87
|
+
agent-browser open https://app.example.com/login
|
|
88
|
+
agent-browser snapshot -i
|
|
89
|
+
agent-browser fill @e1 "$USERNAME"
|
|
90
|
+
agent-browser fill @e2 "$PASSWORD"
|
|
91
|
+
agent-browser click @e3
|
|
92
|
+
agent-browser wait --url "**/dashboard"
|
|
93
|
+
agent-browser state save auth.json
|
|
94
|
+
|
|
95
|
+
# Reuse in future sessions
|
|
96
|
+
agent-browser state load auth.json
|
|
97
|
+
agent-browser open https://app.example.com/dashboard
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Data Extraction
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
agent-browser open https://example.com/products
|
|
104
|
+
agent-browser snapshot -i
|
|
105
|
+
agent-browser get text @e5 # Get specific element text
|
|
106
|
+
agent-browser get text body > page.txt # Get all page text
|
|
107
|
+
|
|
108
|
+
# JSON output for parsing
|
|
109
|
+
agent-browser snapshot -i --json
|
|
110
|
+
agent-browser get text @e1 --json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Parallel Sessions
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
agent-browser --session site1 open https://site-a.com
|
|
117
|
+
agent-browser --session site2 open https://site-b.com
|
|
118
|
+
|
|
119
|
+
agent-browser --session site1 snapshot -i
|
|
120
|
+
agent-browser --session site2 snapshot -i
|
|
121
|
+
|
|
122
|
+
agent-browser session list
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Connect to Existing Chrome
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Auto-discover running Chrome with remote debugging enabled
|
|
129
|
+
agent-browser --auto-connect open https://example.com
|
|
130
|
+
agent-browser --auto-connect snapshot
|
|
131
|
+
|
|
132
|
+
# Or with explicit CDP port
|
|
133
|
+
agent-browser --cdp 9222 snapshot
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Visual Browser (Debugging)
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
agent-browser --headed open https://example.com
|
|
140
|
+
agent-browser highlight @e1 # Highlight element
|
|
141
|
+
agent-browser record start demo.webm # Record session
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Local Files (PDFs, HTML)
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Open local files with file:// URLs
|
|
148
|
+
agent-browser --allow-file-access open file:///path/to/document.pdf
|
|
149
|
+
agent-browser --allow-file-access open file:///path/to/page.html
|
|
150
|
+
agent-browser screenshot output.png
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### iOS Simulator (Mobile Safari)
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# List available iOS simulators
|
|
157
|
+
agent-browser device list
|
|
158
|
+
|
|
159
|
+
# Launch Safari on a specific device
|
|
160
|
+
agent-browser -p ios --device "iPhone 16 Pro" open https://example.com
|
|
161
|
+
|
|
162
|
+
# Same workflow as desktop - snapshot, interact, re-snapshot
|
|
163
|
+
agent-browser -p ios snapshot -i
|
|
164
|
+
agent-browser -p ios tap @e1 # Tap (alias for click)
|
|
165
|
+
agent-browser -p ios fill @e2 "text"
|
|
166
|
+
agent-browser -p ios swipe up # Mobile-specific gesture
|
|
167
|
+
|
|
168
|
+
# Take screenshot
|
|
169
|
+
agent-browser -p ios screenshot mobile.png
|
|
170
|
+
|
|
171
|
+
# Close session (shuts down simulator)
|
|
172
|
+
agent-browser -p ios close
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Requirements:** macOS with Xcode, Appium (`npm install -g appium && appium driver install xcuitest`)
|
|
176
|
+
|
|
177
|
+
**Real devices:** Works with physical iOS devices if pre-configured. Use `--device "<UDID>"` where UDID is from `xcrun xctrace list devices`.
|
|
178
|
+
|
|
179
|
+
## Ref Lifecycle (Important)
|
|
180
|
+
|
|
181
|
+
Refs (`@e1`, `@e2`, etc.) are invalidated when the page changes. Always re-snapshot after:
|
|
182
|
+
|
|
183
|
+
- Clicking links or buttons that navigate
|
|
184
|
+
- Form submissions
|
|
185
|
+
- Dynamic content loading (dropdowns, modals)
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
agent-browser click @e5 # Navigates to new page
|
|
189
|
+
agent-browser snapshot -i # MUST re-snapshot
|
|
190
|
+
agent-browser click @e1 # Use new refs
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Semantic Locators (Alternative to Refs)
|
|
194
|
+
|
|
195
|
+
When refs are unavailable or unreliable, use semantic locators:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
agent-browser find text "Sign In" click
|
|
199
|
+
agent-browser find label "Email" fill "user@test.com"
|
|
200
|
+
agent-browser find role button click --name "Submit"
|
|
201
|
+
agent-browser find placeholder "Search" type "query"
|
|
202
|
+
agent-browser find testid "submit-btn" click
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## JavaScript Evaluation (eval)
|
|
206
|
+
|
|
207
|
+
Use `eval` to run JavaScript in the browser context. **Shell quoting can corrupt complex expressions** -- use `--stdin` or `-b` to avoid issues.
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Simple expressions work with regular quoting
|
|
211
|
+
agent-browser eval 'document.title'
|
|
212
|
+
agent-browser eval 'document.querySelectorAll("img").length'
|
|
213
|
+
|
|
214
|
+
# Complex JS: use --stdin with heredoc (RECOMMENDED)
|
|
215
|
+
agent-browser eval --stdin <<'EVALEOF'
|
|
216
|
+
JSON.stringify(
|
|
217
|
+
Array.from(document.querySelectorAll("img"))
|
|
218
|
+
.filter(i => !i.alt)
|
|
219
|
+
.map(i => ({ src: i.src.split("/").pop(), width: i.width }))
|
|
220
|
+
)
|
|
221
|
+
EVALEOF
|
|
222
|
+
|
|
223
|
+
# Alternative: base64 encoding (avoids all shell escaping issues)
|
|
224
|
+
agent-browser eval -b "$(echo -n 'Array.from(document.querySelectorAll("a")).map(a => a.href)' | base64)"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Why this matters:** When the shell processes your command, inner double quotes, `!` characters (history expansion), backticks, and `$()` can all corrupt the JavaScript before it reaches agent-browser. The `--stdin` and `-b` flags bypass shell interpretation entirely.
|
|
228
|
+
|
|
229
|
+
**Rules of thumb:**
|
|
230
|
+
- Single-line, no nested quotes -> regular `eval 'expression'` with single quotes is fine
|
|
231
|
+
- Nested quotes, arrow functions, template literals, or multiline -> use `eval --stdin <<'EVALEOF'`
|
|
232
|
+
- Programmatic/generated scripts -> use `eval -b` with base64
|
|
233
|
+
|
|
234
|
+
## Complete Command Reference
|
|
235
|
+
|
|
236
|
+
### Core Navigation & Lifecycle
|
|
237
|
+
```bash
|
|
238
|
+
agent-browser open <url> # Navigate (aliases: goto, navigate)
|
|
239
|
+
agent-browser close # Close browser (aliases: quit, exit)
|
|
240
|
+
agent-browser back # Go back
|
|
241
|
+
agent-browser forward # Go forward
|
|
242
|
+
agent-browser reload # Reload page
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Snapshots & Element References
|
|
246
|
+
```bash
|
|
247
|
+
agent-browser snapshot # Accessibility tree with semantic refs
|
|
248
|
+
agent-browser snapshot -i # Interactive elements with @e refs
|
|
249
|
+
agent-browser snapshot -i -C # Include cursor-interactive divs (onclick, pointer)
|
|
250
|
+
agent-browser snapshot -s "#sel" # Scope snapshot to CSS selector
|
|
251
|
+
agent-browser snapshot --json # JSON output for parsing
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Interaction - Click, Fill, Type, Select
|
|
255
|
+
```bash
|
|
256
|
+
agent-browser click <sel> # Click element
|
|
257
|
+
agent-browser click <sel> --new-tab # Open link in new tab
|
|
258
|
+
agent-browser dblclick <sel> # Double-click
|
|
259
|
+
agent-browser focus <sel> # Focus element
|
|
260
|
+
agent-browser type <sel> <text> # Type into element (append)
|
|
261
|
+
agent-browser fill <sel> <text> # Clear and fill
|
|
262
|
+
agent-browser select <sel> <val> # Select dropdown option
|
|
263
|
+
agent-browser check <sel> # Check checkbox
|
|
264
|
+
agent-browser uncheck <sel> # Uncheck checkbox
|
|
265
|
+
agent-browser press <key> # Press key (Enter, Tab, Control+a, etc.) (alias: key)
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Keyboard & Text Input
|
|
269
|
+
```bash
|
|
270
|
+
agent-browser keyboard type <text> # Type with real keystrokes (no selector, uses focus)
|
|
271
|
+
agent-browser keyboard inserttext <text> # Insert text without triggering key events
|
|
272
|
+
agent-browser keydown <key> # Hold key down
|
|
273
|
+
agent-browser keyup <key> # Release key
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Mouse & Drag
|
|
277
|
+
```bash
|
|
278
|
+
agent-browser hover <sel> # Hover element
|
|
279
|
+
agent-browser drag <src> <tgt> # Drag and drop
|
|
280
|
+
agent-browser mouse move <x> <y> # Move mouse to coordinates
|
|
281
|
+
agent-browser mouse down [button] # Press mouse button (left/right/middle)
|
|
282
|
+
agent-browser mouse up [button] # Release mouse button
|
|
283
|
+
agent-browser mouse wheel <dy> [dx] # Scroll wheel
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Scrolling & Viewport
|
|
287
|
+
```bash
|
|
288
|
+
agent-browser scroll <dir> [px] # Scroll (up/down/left/right, optional px)
|
|
289
|
+
agent-browser scrollintoview <sel> # Scroll element into view (alias: scrollinto)
|
|
290
|
+
agent-browser set viewport <w> <h> # Set viewport size (e.g., 1920 1080)
|
|
291
|
+
agent-browser set device <name> # Emulate device (e.g., "iPhone 14")
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Get Information
|
|
295
|
+
```bash
|
|
296
|
+
agent-browser get text <sel> # Get text content
|
|
297
|
+
agent-browser get html <sel> # Get innerHTML
|
|
298
|
+
agent-browser get value <sel> # Get input value
|
|
299
|
+
agent-browser get attr <sel> <attr> # Get attribute value
|
|
300
|
+
agent-browser get title # Get page title
|
|
301
|
+
agent-browser get url # Get current URL
|
|
302
|
+
agent-browser get count <sel> # Count matching elements
|
|
303
|
+
agent-browser get box <sel> # Get bounding box {x, y, width, height}
|
|
304
|
+
agent-browser get styles <sel> # Get computed CSS styles
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Check State
|
|
308
|
+
```bash
|
|
309
|
+
agent-browser is visible <sel> # Check if visible
|
|
310
|
+
agent-browser is enabled <sel> # Check if enabled (not disabled)
|
|
311
|
+
agent-browser is checked <sel> # Check if checked (checkbox/radio)
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### File Operations
|
|
315
|
+
```bash
|
|
316
|
+
agent-browser upload <sel> <files> # Upload files to file input
|
|
317
|
+
agent-browser screenshot [path] # Screenshot to temp or custom path
|
|
318
|
+
agent-browser screenshot --full # Full page screenshot
|
|
319
|
+
agent-browser screenshot --annotate # Annotated with numbered element labels
|
|
320
|
+
agent-browser pdf <path> # Save as PDF
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Semantic Locators (Alternative to Selectors)
|
|
324
|
+
```bash
|
|
325
|
+
agent-browser find role <role> <action> [value] # By ARIA role
|
|
326
|
+
agent-browser find text <text> <action> # By text content
|
|
327
|
+
agent-browser find label <label> <action> [value] # By form label
|
|
328
|
+
agent-browser find placeholder <ph> <action> [value] # By placeholder text
|
|
329
|
+
agent-browser find alt <text> <action> # By alt text
|
|
330
|
+
agent-browser find title <text> <action> # By title attribute
|
|
331
|
+
agent-browser find testid <id> <action> [value] # By data-testid
|
|
332
|
+
agent-browser find first <sel> <action> [value] # First matching element
|
|
333
|
+
agent-browser find last <sel> <action> [value] # Last matching element
|
|
334
|
+
agent-browser find nth <n> <sel> <action> [value] # Nth matching element
|
|
335
|
+
|
|
336
|
+
# Role examples: button, link, textbox, combobox, checkbox, radio, heading, list, etc.
|
|
337
|
+
# Actions: click, fill, type, hover, focus, check, uncheck, text
|
|
338
|
+
# Options: --name <name> (filter by accessible name), --exact (exact text match)
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Waiting
|
|
342
|
+
```bash
|
|
343
|
+
agent-browser wait <selector> # Wait for element to be visible
|
|
344
|
+
agent-browser wait <ms> # Wait for time in milliseconds
|
|
345
|
+
agent-browser wait --text "Welcome" # Wait for text to appear
|
|
346
|
+
agent-browser wait --url "**/dash" # Wait for URL pattern
|
|
347
|
+
agent-browser wait --load networkidle # Wait for load state (load, domcontentloaded, networkidle)
|
|
348
|
+
agent-browser wait --fn "window.ready === true" # Wait for JS condition
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### JavaScript Evaluation
|
|
352
|
+
```bash
|
|
353
|
+
agent-browser eval <js> # Run JavaScript in browser
|
|
354
|
+
agent-browser eval -b "<base64>" # Base64-encoded JS (avoid shell escaping)
|
|
355
|
+
agent-browser eval --stdin <<'EOF' # JS from stdin (heredoc, recommended for complex code)
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### Browser Environment
|
|
359
|
+
```bash
|
|
360
|
+
agent-browser set geo <lat> <lng> # Set geolocation
|
|
361
|
+
agent-browser set offline [on|off] # Toggle offline mode
|
|
362
|
+
agent-browser set headers <json> # Set HTTP headers
|
|
363
|
+
agent-browser set credentials <u> <p> # HTTP basic auth
|
|
364
|
+
agent-browser set media [dark|light] # Emulate color scheme (prefers-color-scheme)
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Cookies & Storage
|
|
368
|
+
```bash
|
|
369
|
+
agent-browser cookies # Get all cookies
|
|
370
|
+
agent-browser cookies set <name> <val> # Set cookie
|
|
371
|
+
agent-browser cookies clear # Clear cookies
|
|
372
|
+
agent-browser storage local # Get all localStorage
|
|
373
|
+
agent-browser storage local <key> # Get specific key
|
|
374
|
+
agent-browser storage local set <k> <v> # Set value
|
|
375
|
+
agent-browser storage local clear # Clear all localStorage
|
|
376
|
+
agent-browser storage session # Same for sessionStorage
|
|
377
|
+
agent-browser storage session <key> # Get sessionStorage key
|
|
378
|
+
agent-browser storage session set <k> <v> # Set sessionStorage
|
|
379
|
+
agent-browser storage session clear # Clear sessionStorage
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Network & Interception
|
|
383
|
+
```bash
|
|
384
|
+
agent-browser network route <url> # Intercept requests
|
|
385
|
+
agent-browser network route <url> --abort # Block requests
|
|
386
|
+
agent-browser network route <url> --body <json> # Mock response with JSON
|
|
387
|
+
agent-browser network unroute [url] # Remove routes
|
|
388
|
+
agent-browser network requests # View tracked requests
|
|
389
|
+
agent-browser network requests --filter api # Filter by keyword
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Tabs & Windows
|
|
393
|
+
```bash
|
|
394
|
+
agent-browser tab # List active tabs
|
|
395
|
+
agent-browser tab new [url] # Open new tab (optionally with URL)
|
|
396
|
+
agent-browser tab <n> # Switch to tab n
|
|
397
|
+
agent-browser tab close [n] # Close tab (current or specific)
|
|
398
|
+
agent-browser window new # Open new window
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Frames
|
|
402
|
+
```bash
|
|
403
|
+
agent-browser frame <sel> # Switch to iframe by selector
|
|
404
|
+
agent-browser frame main # Switch back to main frame
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Dialogs
|
|
408
|
+
```bash
|
|
409
|
+
agent-browser dialog accept [text] # Accept alert/confirm (with optional prompt text)
|
|
410
|
+
agent-browser dialog dismiss # Dismiss dialog
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### State Persistence (Auth, Sessions)
|
|
414
|
+
```bash
|
|
415
|
+
agent-browser state save <path> # Save authenticated session
|
|
416
|
+
agent-browser state load <path> # Load session state
|
|
417
|
+
agent-browser state list # List saved state files
|
|
418
|
+
agent-browser state show <file> # Show state summary
|
|
419
|
+
agent-browser state rename <old> <new> # Rename state
|
|
420
|
+
agent-browser state clear [name] # Clear specific session
|
|
421
|
+
agent-browser state clear --all # Clear all states
|
|
422
|
+
agent-browser state clean --older-than <days> # Delete old states
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Debugging & Analysis
|
|
426
|
+
```bash
|
|
427
|
+
agent-browser highlight <sel> # Highlight element visually
|
|
428
|
+
agent-browser console # View console messages (log, error, warn)
|
|
429
|
+
agent-browser console --clear # Clear console
|
|
430
|
+
agent-browser errors # View JavaScript errors
|
|
431
|
+
agent-browser errors --clear # Clear errors
|
|
432
|
+
agent-browser trace start [path] # Start DevTools trace
|
|
433
|
+
agent-browser trace stop [path] # Stop and save trace
|
|
434
|
+
agent-browser profiler start # Start Chrome DevTools profiler
|
|
435
|
+
agent-browser profiler stop [path] # Stop and save .json profile
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### Visual Debugging
|
|
439
|
+
```bash
|
|
440
|
+
agent-browser --headed open <url> # Headless=false, show visual browser
|
|
441
|
+
agent-browser record start <file.webm> # Record session
|
|
442
|
+
agent-browser record stop # Stop recording
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### Comparisons & Diffs
|
|
446
|
+
```bash
|
|
447
|
+
agent-browser diff snapshot # Compare current vs last snapshot
|
|
448
|
+
agent-browser diff snapshot --baseline before.txt # Compare current vs saved snapshot
|
|
449
|
+
agent-browser diff snapshot --selector "#main" --compact # Scoped diff
|
|
450
|
+
agent-browser diff screenshot --baseline before.png # Visual pixel diff
|
|
451
|
+
agent-browser diff screenshot --baseline b.png -o d.png # Save diff to custom path
|
|
452
|
+
agent-browser diff screenshot --baseline b.png -t 0.2 # Color threshold 0-1
|
|
453
|
+
agent-browser diff url https://v1.com https://v2.com # Compare two URLs
|
|
454
|
+
agent-browser diff url https://v1.com https://v2.com --screenshot # With visual diff
|
|
455
|
+
agent-browser diff url https://v1.com https://v2.com --selector "#main" # Scoped
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Sessions & Parallelism
|
|
459
|
+
```bash
|
|
460
|
+
agent-browser --session <name> <cmd> # Run in named session (isolated instance)
|
|
461
|
+
agent-browser session list # List active sessions
|
|
462
|
+
agent-browser session show # Show current session
|
|
463
|
+
# Example: agent-browser --session agent1 open site.com
|
|
464
|
+
# agent-browser --session agent2 open other.com
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Browser Connection
|
|
468
|
+
```bash
|
|
469
|
+
agent-browser connect <port> # Connect via Chrome DevTools Protocol
|
|
470
|
+
agent-browser --auto-connect open <url> # Auto-discover running Chrome
|
|
471
|
+
agent-browser --cdp 9222 <cmd> # Explicit CDP port
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### Setup & Installation
|
|
475
|
+
```bash
|
|
476
|
+
agent-browser install # Download Chromium browser
|
|
477
|
+
agent-browser install --with-deps # Also install system dependencies (Linux)
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### Advanced: Local Files & Protocols
|
|
481
|
+
```bash
|
|
482
|
+
agent-browser --allow-file-access open file:///path/to/file.pdf
|
|
483
|
+
agent-browser --allow-file-access open file:///path/to/page.html
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### Advanced: iOS/Mobile Testing
|
|
487
|
+
```bash
|
|
488
|
+
agent-browser device list # List available iOS simulators
|
|
489
|
+
agent-browser -p ios --device "iPhone 16 Pro" open <url> # Launch on device
|
|
490
|
+
agent-browser -p ios snapshot -i # Snapshot on iOS
|
|
491
|
+
agent-browser -p ios tap @e1 # Tap (alias for click)
|
|
492
|
+
agent-browser -p ios swipe up # Mobile gestures
|
|
493
|
+
agent-browser -p ios screenshot mobile.png
|
|
494
|
+
agent-browser -p ios close # Close simulator
|
|
495
|
+
# Requires: macOS, Xcode, Appium (npm install -g appium && appium driver install xcuitest)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
## Key Patterns for Agents
|
|
499
|
+
|
|
500
|
+
**Always use agent-browser instead of puppeteer, playwright, or playwright-core** — it has the same capabilities with simpler syntax and better integration with AI agents.
|
|
501
|
+
|
|
502
|
+
**Multi-step workflows**:
|
|
503
|
+
1. `agent-browser open <url>`
|
|
504
|
+
2. `agent-browser snapshot -i` (get refs)
|
|
505
|
+
3. `agent-browser fill @e1 "value"`
|
|
506
|
+
4. `agent-browser click @e2`
|
|
507
|
+
5. `agent-browser wait --load networkidle` (after navigation)
|
|
508
|
+
6. `agent-browser snapshot -i` (re-snapshot for new refs)
|
|
509
|
+
|
|
510
|
+
**Debugging complex interactions**: Use `agent-browser --headed open <url>` to see visual browser, then `agent-browser highlight @e1` to verify element targeting.
|
|
511
|
+
|
|
512
|
+
**Ground truth verification**: Combine `agent-browser eval` for JavaScript inspection with `agent-browser screenshot` for visual confirmation.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-search
|
|
3
|
+
description: Semantic code search across the codebase. Use for all code exploration, finding implementations, locating files, and answering codebase questions. Replaces mcp__plugin_gm_code-search__search and codebasesearch MCP tool.
|
|
4
|
+
allowed-tools: Bash(bun x codebasesearch*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Semantic Code Search
|
|
8
|
+
|
|
9
|
+
Only use bun x codebasesearch for searching code, or execute some custom code if you need more than that, never use other cli tools to search the codebase. Search the codebase using natural language. Do multiple searches when looking for files, starting with fewer words and adding more if you need to refine the search. 102 file types are covered, returns results with file paths and line numbers.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bun x codebasesearch "your natural language query"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Examples
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun x codebasesearch "where is authentication handled"
|
|
21
|
+
bun x codebasesearch "database connection setup"
|
|
22
|
+
bun x codebasesearch "how are errors logged"
|
|
23
|
+
bun x codebasesearch "function that parses config files"
|
|
24
|
+
bun x codebasesearch "where is the rate limiter"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
- Always use this first before reading files — it returns file paths and line numbers
|
|
30
|
+
- Natural language queries work best; be descriptive
|
|
31
|
+
- No persistent files created; results stream to stdout only
|
|
32
|
+
- Use the returned file paths + line numbers to go directly to relevant code
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev
|
|
3
|
+
description: Execute code and shell commands. Use for all code execution, file operations, running scripts, testing hypotheses, and any task that requires running code. Replaces plugin:gm:dev and mcp-glootie.
|
|
4
|
+
allowed-tools: Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Execution with dev
|
|
8
|
+
|
|
9
|
+
Execute code directly using the Bash tool. No wrapper, no persistent files, no cleanup needed beyond what the code itself creates.
|
|
10
|
+
|
|
11
|
+
## Run code inline
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# JavaScript / TypeScript
|
|
15
|
+
bun -e "const fs = require('fs'); console.log(fs.readdirSync('.'))"
|
|
16
|
+
bun -e "import { readFileSync } from 'fs'; console.log(readFileSync('package.json', 'utf-8'))"
|
|
17
|
+
|
|
18
|
+
# Run a file
|
|
19
|
+
bun run script.ts
|
|
20
|
+
node script.js
|
|
21
|
+
|
|
22
|
+
# Python
|
|
23
|
+
python -c "import json; print(json.dumps({'ok': True}))"
|
|
24
|
+
|
|
25
|
+
# Shell
|
|
26
|
+
bash -c "ls -la && cat package.json"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## File operations (inline, no temp files)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Read
|
|
33
|
+
bun -e "console.log(require('fs').readFileSync('path/to/file', 'utf-8'))"
|
|
34
|
+
|
|
35
|
+
# Write
|
|
36
|
+
bun -e "require('fs').writeFileSync('out.json', JSON.stringify({x:1}, null, 2))"
|
|
37
|
+
|
|
38
|
+
# Stat / exists
|
|
39
|
+
bun -e "const fs=require('fs'); console.log(fs.existsSync('file.txt'), fs.statSync?.('.')?.size)"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Rules
|
|
43
|
+
|
|
44
|
+
- Each run under 15 seconds
|
|
45
|
+
- Pack every related hypothesis into one run — never one idea per run
|
|
46
|
+
- No persistent temp files; if a temp file is needed, delete it in the same command
|
|
47
|
+
- No spawn/exec/fork inside executed code
|
|
48
|
+
- Use `bun` over `node` when available
|