@ulpi/browse 1.0.6 → 1.3.0

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/README.md CHANGED
@@ -10,7 +10,7 @@ Headless browser CLI for AI coding agents. Persistent Chromium daemon via Playwr
10
10
  npm install -g @ulpi/browse
11
11
  ```
12
12
 
13
- Requires Node.js 18+. Chromium is installed automatically via Playwright on first `npm install`.
13
+ Requires Node.js 18+. Chromium is installed automatically via Playwright on first `npm install`. If [Bun](https://bun.sh) is installed, browse automatically uses it for ~2x faster command execution.
14
14
 
15
15
  ### Project Installation (local dependency)
16
16
 
@@ -143,6 +143,7 @@ browse wait --text "Welcome" # Wait for text to appear in page
143
143
  browse wait --fn "js expr" # Wait for JavaScript condition
144
144
  browse wait --load <state> # Wait for load state (load/domcontentloaded/networkidle)
145
145
  browse wait --network-idle # Wait for network idle
146
+ browse wait --download [path] # Wait for download to complete
146
147
  ```
147
148
 
148
149
  ### Snapshot
@@ -300,8 +301,47 @@ browse record stop # Stop recording
300
301
  browse record status # Check recording status
301
302
  browse record export browse [path] # Export as chain-compatible JSON (replay with browse chain)
302
303
  browse record export replay [path] # Export as Chrome DevTools Recorder (Playwright/Puppeteer)
304
+ browse record export replay --selectors css,aria [path] # Filter selector types in export
303
305
  ```
304
306
 
307
+ ### React DevTools
308
+
309
+ ```bash
310
+ browse react-devtools enable # Enable (downloads hook on first use)
311
+ browse react-devtools tree # Component tree
312
+ browse react-devtools props <sel> # Props/state of component
313
+ browse react-devtools suspense # Suspense boundary status
314
+ browse react-devtools errors # Error boundaries
315
+ browse react-devtools profiler # Render timing
316
+ browse react-devtools hydration # Hydration timing
317
+ browse react-devtools renders # What re-rendered
318
+ browse react-devtools owners <sel> # Parent component chain
319
+ browse react-devtools context <sel> # Context values
320
+ browse react-devtools disable # Disable
321
+ ```
322
+
323
+ ### Handoff (Human Takeover)
324
+
325
+ ```bash
326
+ browse handoff [reason] # Swap to Chrome for CAPTCHA/MFA/OAuth (falls back to Chromium)
327
+ browse handoff --chromium # Force Playwright Chromium instead of Chrome
328
+ browse resume # Swap back to headless, returns fresh snapshot
329
+ ```
330
+
331
+ Handoff defaults to your system Chrome (bypasses Turnstile and bot detection). Falls back to Playwright Chromium if Chrome is not installed. Agent asks permission first via AskUserQuestion, then hands off. Server auto-suggests handoff after 3 consecutive failures.
332
+
333
+ ### Cloud Providers
334
+
335
+ ```bash
336
+ browse provider save browserbase <api-key> # Save API key (encrypted)
337
+ browse provider save browserless <token> # Save token (encrypted)
338
+ browse --provider browserbase goto https://... # Use cloud browser
339
+ browse provider list # List saved providers
340
+ browse provider delete <name> # Remove saved key
341
+ ```
342
+
343
+ API keys are encrypted at rest in `.browse/providers/` — never visible to agents.
344
+
305
345
  ### State & Auth
306
346
 
307
347
  ```bash
@@ -315,6 +355,10 @@ browse auth save <name> <url> <user> --password-stdin # Password from stdin
315
355
  browse auth login <name> # Auto-login with saved credential
316
356
  browse auth list # List saved credentials
317
357
  browse auth delete <name> # Delete credential
358
+
359
+ browse cookie-import --list # List browsers with cookies
360
+ browse cookie-import chrome [--domain .example.com] # Import cookies from Chrome
361
+ browse cookie-import chrome --profile "Profile 1" # Specific browser profile
318
362
  ```
319
363
 
320
364
  ### Multi-Step (Chaining)
@@ -330,6 +374,7 @@ echo '[["goto","https://example.com"],["snapshot","-i"],["text"]]' | browse chai
330
374
  ```bash
331
375
  browse status # Server health report
332
376
  browse instances # List all running browse servers
377
+ browse version # Print CLI version
333
378
  browse doctor # System check (Node, Playwright, Chromium)
334
379
  browse upgrade # Self-update via npm
335
380
  browse stop # Stop server
@@ -503,6 +548,61 @@ Core workflow:
503
548
  Use browse to test the login flow. Run browse --help to see available commands.
504
549
  ```
505
550
 
551
+ ## MCP Server Mode
552
+
553
+ Run browse as an [MCP](https://modelcontextprotocol.io/) server for editors that support the Model Context Protocol.
554
+
555
+ ```bash
556
+ browse --mcp
557
+ ```
558
+
559
+ Use `--json` alongside `--mcp` for structured responses (`{success, data, command}`).
560
+
561
+ > **Note:** Requires `npm install @modelcontextprotocol/sdk` alongside browse.
562
+
563
+ ### Cursor
564
+
565
+ `.cursor/mcp.json`:
566
+
567
+ ```json
568
+ {
569
+ "mcpServers": {
570
+ "browse": {
571
+ "command": "browse",
572
+ "args": ["--mcp"]
573
+ }
574
+ }
575
+ }
576
+ ```
577
+
578
+ ### Claude Desktop
579
+
580
+ `claude_desktop_config.json`:
581
+
582
+ ```json
583
+ {
584
+ "mcpServers": {
585
+ "browse": {
586
+ "command": "browse",
587
+ "args": ["--mcp"]
588
+ }
589
+ }
590
+ }
591
+ ```
592
+
593
+ ### Windsurf
594
+
595
+ ```json
596
+ {
597
+ "mcpServers": {
598
+ "browse": {
599
+ "command": "browse",
600
+ "args": ["--mcp"]
601
+ }
602
+ }
603
+ }
604
+ ```
605
+
506
606
  ## Options
507
607
 
508
608
  | Flag | Description |
@@ -514,6 +614,11 @@ Use browse to test the login flow. Run browse --help to see available commands.
514
614
  | `--allowed-domains <d,d>` | Block navigation/resources outside allowlist |
515
615
  | `--max-output <n>` | Truncate output to N characters |
516
616
  | `--headed` | Show browser window (not headless) |
617
+ | `--chrome` | Launch system Chrome (uses real browser, bypasses bot detection) |
618
+ | `--cdp <port>` | Connect to Chrome on a specific debugging port |
619
+ | `--connect` | Auto-discover and connect to a running Chrome instance |
620
+ | `--provider <name>` | Cloud browser provider (browserless, browserbase) |
621
+ | `--runtime <name>` | Browser runtime: playwright (default), rebrowser (stealth), lightpanda, chrome |
517
622
 
518
623
  ## Environment Variables
519
624
 
@@ -540,7 +645,9 @@ Use browse to test the login flow. Run browse --help to see available commands.
540
645
  | `BROWSE_CONFIRM_ACTIONS` | (none) | Commands requiring confirmation |
541
646
  | `BROWSE_ENCRYPTION_KEY` | auto-generated | 64-char hex AES key for credential vault |
542
647
  | `BROWSE_AUTH_PASSWORD` | (none) | Password for `auth save` (alt to `--password-stdin`) |
543
- | `BROWSE_RUNTIME` | playwright | Browser runtime (playwright, rebrowser, lightpanda) |
648
+ | `BROWSE_RUNTIME` | playwright | Browser runtime (playwright, rebrowser, lightpanda, chrome) |
649
+ | `BROWSE_CHROME` | (none) | Set to `1` to use system Chrome |
650
+ | `BROWSE_CHROME_PATH` | auto-detected | Override Chrome executable path |
544
651
 
545
652
  ## Architecture
546
653