chrome-cdp-cli 2.0.1 → 2.0.2

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.
Files changed (2) hide show
  1. package/README.md +38 -15
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -35,6 +35,7 @@ A command-line tool for browser automation via Chrome DevTools Protocol (CDP). D
35
35
  - 📊 **Console Monitoring**: Real-time console message capture with filtering and storage
36
36
  - 🌐 **Network Monitoring**: Real-time network request/response monitoring with comprehensive filtering
37
37
  - 🖱️ **Element Interaction**: Complete native interaction commands (click, hover, fill, drag, press_key, upload_file, wait_for, handle_dialog)
38
+ - 🔄 **Proxy Management**: Restart proxy server to refresh stale console and network logs
38
39
  - 🔧 **CLI Interface**: Full command-line interface with argument parsing and routing
39
40
  - 🛠️ **IDE Integration**: Install Cursor commands and Claude skills with directory validation and --force option
40
41
  - 📦 **Build System**: Complete TypeScript build pipeline with testing framework
@@ -88,6 +89,7 @@ This tool integrates seamlessly with modern AI-powered development environments.
88
89
  - 📊 **Monitoring**: Monitor console messages and network requests in real-time
89
90
  - 🖱️ **Element Interaction**: Complete native interaction commands (click, hover, fill, drag, press_key, upload_file, wait_for, handle_dialog)
90
91
  - 📝 **Form Automation**: Single field and batch form filling with comprehensive options
92
+ - 🔄 **Proxy Management**: Restart proxy server to refresh stale logs
91
93
  - 🔧 **Flexible Output**: Support for JSON and human-readable text output formats
92
94
  - 🚧 **Eval Workarounds**: Many advanced features available through JavaScript execution
93
95
 
@@ -170,8 +172,8 @@ chrome-cdp-cli eval "window.location.href = 'https://example.com'"
170
172
  # Take a screenshot
171
173
  chrome-cdp-cli screenshot --filename screenshot.png
172
174
 
173
- # Capture DOM snapshot
174
- chrome-cdp-cli snapshot --filename dom-snapshot.json
175
+ # Capture DOM snapshot (default: text format)
176
+ chrome-cdp-cli snapshot --filename dom-snapshot.txt
175
177
 
176
178
  # Element interactions
177
179
  chrome-cdp-cli click "#submit-button"
@@ -190,8 +192,11 @@ chrome-cdp-cli handle_dialog accept
190
192
  chrome-cdp-cli fill_form --fields '[{"selector":"#username","value":"john"},{"selector":"#password","value":"secret"}]'
191
193
 
192
194
  # Monitor console and network
193
- chrome-cdp-cli get_console_message
194
- chrome-cdp-cli get_network_request
195
+ chrome-cdp-cli console --latest
196
+ chrome-cdp-cli network --latest
197
+
198
+ # Restart proxy server when logs are stale
199
+ chrome-cdp-cli restart
195
200
 
196
201
  # Install IDE integrations
197
202
  chrome-cdp-cli install_cursor_command
@@ -262,8 +267,8 @@ chrome-cdp-cli screenshot --filename screenshot.png
262
267
  # Full page screenshot
263
268
  chrome-cdp-cli screenshot --full-page --filename fullpage.png
264
269
 
265
- # DOM snapshot with complete layout information
266
- chrome-cdp-cli snapshot --filename dom-snapshot.json
270
+ # DOM snapshot with complete layout information (default: text format)
271
+ chrome-cdp-cli snapshot --filename dom-snapshot.txt
267
272
 
268
273
  # Custom dimensions
269
274
  chrome-cdp-cli screenshot --width 1920 --height 1080 --filename custom.png
@@ -376,13 +381,19 @@ chrome-cdp-cli handle_dialog accept --timeout 10000 # Wait for dialog to appear
376
381
  #### Console Monitoring
377
382
  ```bash
378
383
  # Get latest console message
379
- chrome-cdp-cli get_console_message
384
+ chrome-cdp-cli console --latest
380
385
 
381
386
  # List all console messages
382
- chrome-cdp-cli list_console_messages
387
+ chrome-cdp-cli console
383
388
 
384
389
  # Filter console messages by type
385
- chrome-cdp-cli list_console_messages --filter '{"types":["error","warn"]}'
390
+ chrome-cdp-cli console --types error,warn
391
+
392
+ # Filter by text pattern
393
+ chrome-cdp-cli console --textPattern "error|warning"
394
+
395
+ # Limit number of messages
396
+ chrome-cdp-cli console --maxMessages 10
386
397
  ```
387
398
 
388
399
  **Note**: Console monitoring only captures messages generated *after* monitoring starts. For historical messages or immediate console operations, use the eval-first approach:
@@ -400,13 +411,22 @@ See [Console Monitoring Documentation](docs/CONSOLE_MONITORING.md) for detailed
400
411
  #### Network Monitoring
401
412
  ```bash
402
413
  # Get latest network request
403
- chrome-cdp-cli get_network_request
414
+ chrome-cdp-cli network --latest
404
415
 
405
416
  # List all network requests
406
- chrome-cdp-cli list_network_requests
417
+ chrome-cdp-cli network
407
418
 
408
419
  # Filter network requests by method
409
- chrome-cdp-cli list_network_requests --filter '{"methods":["POST"],"statusCodes":[200,201]}'
420
+ chrome-cdp-cli network --filter '{"methods":["POST"],"statusCodes":[200,201]}'
421
+ ```
422
+
423
+ #### Proxy Management
424
+ ```bash
425
+ # Restart proxy server when console or network logs become stale
426
+ chrome-cdp-cli restart
427
+
428
+ # Force restart even if proxy is healthy
429
+ chrome-cdp-cli restart --force
410
430
  ```
411
431
 
412
432
  #### IDE Integration
@@ -884,11 +904,14 @@ chrome-cdp-cli eval --file script.js
884
904
 
885
905
  # Visual capture
886
906
  chrome-cdp-cli screenshot --filename page.png
887
- chrome-cdp-cli snapshot --filename dom.json
907
+ chrome-cdp-cli snapshot --filename dom.txt
888
908
 
889
909
  # Monitoring
890
- chrome-cdp-cli get_console_message
891
- chrome-cdp-cli list_network_requests
910
+ chrome-cdp-cli console --latest
911
+ chrome-cdp-cli network
912
+
913
+ # Proxy management
914
+ chrome-cdp-cli restart
892
915
  ```
893
916
 
894
917
  For detailed documentation, see the [Form Filling Guide](docs/FORM_FILLING.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chrome-cdp-cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Browser automation CLI via Chrome DevTools Protocol. Designed for developers and AI assistants - combines dedicated commands for common tasks with flexible JavaScript execution for complex scenarios. Features: element interaction, screenshots, DOM snapshots, console/network monitoring. Built-in IDE integration for Cursor and Claude.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",