chrome-cdp-cli 1.2.4 → 1.5.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
@@ -49,6 +49,7 @@ A command-line tool designed specifically for Large Language Models (LLMs) and A
49
49
  - 📸 **Visual Capture**: Take screenshots and capture complete DOM snapshots with layout information
50
50
  - 📊 **Console Monitoring**: Real-time console message capture with filtering and storage
51
51
  - 🌐 **Network Monitoring**: Real-time network request/response monitoring with comprehensive filtering
52
+ - 🖱️ **Element Interaction**: Complete native interaction commands (click, hover, fill, drag, press_key, upload_file, wait_for, handle_dialog)
52
53
  - 🔧 **CLI Interface**: Full command-line interface with argument parsing and routing
53
54
  - 🛠️ **IDE Integration**: Install Cursor commands and Claude skills with directory validation and --force option
54
55
  - 📦 **Build System**: Complete TypeScript build pipeline with testing framework
@@ -58,9 +59,6 @@ A command-line tool designed specifically for Large Language Models (LLMs) and A
58
59
  These features use the `eval` command by design (not as workarounds) - this is the intended approach for LLM-assisted development:
59
60
 
60
61
  - 📄 **Page Navigation**: `eval "window.location.href = 'https://example.com'"`
61
- - 🖱️ **Element Interaction**: `eval "document.querySelector('#btn').click()"`
62
- - 📝 **Form Filling**: `eval "document.querySelector('#input').value = 'text'"`
63
- - 📄 **HTML Content**: `eval "document.documentElement.outerHTML"`
64
62
  - 🚀 **Performance Data**: `eval "performance.now()"` or `eval "performance.getEntriesByType('navigation')"`
65
63
  - 📱 **User Agent**: `eval "navigator.userAgent"`
66
64
  - 🌐 **Network Requests**: `eval "fetch('/api').then(r => r.json())"`
@@ -93,7 +91,6 @@ This tool is designed for LLM-assisted development. The IDE integrations (`insta
93
91
  ### ⏳ Not Yet Implemented
94
92
 
95
93
  - 📄 **Direct Page Management**: Native commands for creating, closing, listing, and selecting tabs
96
- - 🖱️ **Direct Element Interaction**: Native click, hover, drag, and form filling commands
97
94
  - 🚀 **Performance Analysis**: Native performance profiling and metrics collection
98
95
  - 📱 **Device Emulation**: Native device and network condition simulation
99
96
  - 📊 **Output Formatting**: Advanced JSON/text formatting with quiet/verbose modes
@@ -104,6 +101,8 @@ This tool is designed for LLM-assisted development. The IDE integrations (`insta
104
101
  - ⚡ **JavaScript Execution**: Execute JavaScript code in browser context with full async support
105
102
  - 📸 **Visual Capture**: Take screenshots and capture HTML content
106
103
  - 📊 **Monitoring**: Monitor console messages and network requests in real-time
104
+ - 🖱️ **Element Interaction**: Complete native interaction commands (click, hover, fill, drag, press_key, upload_file, wait_for, handle_dialog)
105
+ - 📝 **Form Automation**: Single field and batch form filling with comprehensive options
107
106
  - 🔧 **Flexible Output**: Support for JSON and human-readable text output formats
108
107
  - 🚧 **Eval Workarounds**: Many advanced features available through JavaScript execution
109
108
 
@@ -179,21 +178,29 @@ chrome-cdp-cli screenshot --filename screenshot.png
179
178
  # Capture DOM snapshot
180
179
  chrome-cdp-cli snapshot --filename dom-snapshot.json
181
180
 
182
- # Click an element (via eval)
183
- chrome-cdp-cli eval "document.querySelector('#submit-button').click()"
181
+ # Element interactions
182
+ chrome-cdp-cli click "#submit-button"
183
+ chrome-cdp-cli hover ".menu-item"
184
+ chrome-cdp-cli fill "#email" "user@example.com"
184
185
 
185
- # Fill a form field (via eval)
186
- chrome-cdp-cli eval "document.querySelector('#email').value = 'user@example.com'"
186
+ # Advanced interactions
187
+ chrome-cdp-cli drag "#draggable" "#dropzone"
188
+ chrome-cdp-cli press_key "Enter"
189
+ chrome-cdp-cli press_key "a" --modifiers Ctrl
190
+ chrome-cdp-cli upload_file "input[type='file']" "./document.pdf"
191
+ chrome-cdp-cli wait_for "#loading" --condition hidden
192
+ chrome-cdp-cli handle_dialog accept
187
193
 
188
- # Monitor console messages
189
- chrome-cdp-cli get_console_message
194
+ # Batch form filling
195
+ chrome-cdp-cli fill_form --fields '[{"selector":"#username","value":"john"},{"selector":"#password","value":"secret"}]'
190
196
 
191
- # Monitor network requests
197
+ # Monitor console and network
198
+ chrome-cdp-cli get_console_message
192
199
  chrome-cdp-cli get_network_request
193
200
 
194
201
  # Install IDE integrations
195
- chrome-cdp-cli install-cursor-command
196
- chrome-cdp-cli install-claude-skill --skill-type personal
202
+ chrome-cdp-cli install_cursor_command
203
+ chrome-cdp-cli install_claude_skill --skill-type personal
197
204
 
198
205
  # Get help for all commands
199
206
  chrome-cdp-cli --help
@@ -267,6 +274,110 @@ chrome-cdp-cli snapshot --filename dom-snapshot.json
267
274
  chrome-cdp-cli screenshot --width 1920 --height 1080 --filename custom.png
268
275
  ```
269
276
 
277
+ #### Element Interaction
278
+ ```bash
279
+ # Click on an element using CSS selector
280
+ chrome-cdp-cli click "#submit-button"
281
+
282
+ # Click with custom timeout
283
+ chrome-cdp-cli click ".slow-loading-button" --timeout 10000
284
+
285
+ # Click without waiting for element (fail immediately if not found)
286
+ chrome-cdp-cli click "#optional-element" --no-wait
287
+
288
+ # Hover over an element
289
+ chrome-cdp-cli hover "#menu-item"
290
+
291
+ # Hover over a dropdown trigger
292
+ chrome-cdp-cli hover ".dropdown-trigger"
293
+
294
+ # Fill a single form field
295
+ chrome-cdp-cli fill "#username" "john@example.com"
296
+
297
+ # Fill a password field
298
+ chrome-cdp-cli fill "input[type='password']" "secret123"
299
+
300
+ # Fill a textarea
301
+ chrome-cdp-cli fill "#message" "Hello, this is a test message"
302
+
303
+ # Select an option in a dropdown (by value or text)
304
+ chrome-cdp-cli fill "#country" "US"
305
+ chrome-cdp-cli fill "#country" "United States"
306
+
307
+ # Fill without clearing existing content
308
+ chrome-cdp-cli fill "#notes" " - Additional note" --no-clear
309
+
310
+ # Fill multiple form fields in batch
311
+ chrome-cdp-cli fill_form --fields '[
312
+ {"selector":"#username","value":"john@example.com"},
313
+ {"selector":"#password","value":"secret123"},
314
+ {"selector":"#country","value":"United States"}
315
+ ]'
316
+
317
+ # Fill form from JSON file
318
+ echo '[
319
+ {"selector":"#firstName","value":"John"},
320
+ {"selector":"#lastName","value":"Doe"},
321
+ {"selector":"#email","value":"john.doe@example.com"}
322
+ ]' > form-data.json
323
+ chrome-cdp-cli fill_form --fields-file form-data.json
324
+
325
+ # Fill form with custom options
326
+ chrome-cdp-cli fill_form --fields '[
327
+ {"selector":"#notes","value":"Additional information"}
328
+ ]' --no-clear --timeout 10000 --stop-on-error
329
+
330
+ # Fill form and continue on errors (default behavior)
331
+ chrome-cdp-cli fill_form --fields '[
332
+ {"selector":"#field1","value":"value1"},
333
+ {"selector":"#nonexistent","value":"value2"},
334
+ {"selector":"#field3","value":"value3"}
335
+ ]' --continue-on-error
336
+ ```
337
+
338
+ #### Advanced Interactions
339
+ ```bash
340
+ # Drag and drop operations
341
+ chrome-cdp-cli drag "#draggable-item" "#drop-zone"
342
+
343
+ # Drag with custom timeout
344
+ chrome-cdp-cli drag ".file-item" ".upload-area" --timeout 10000
345
+
346
+ # Keyboard input simulation
347
+ chrome-cdp-cli press_key "Enter"
348
+ chrome-cdp-cli press_key "Escape"
349
+ chrome-cdp-cli press_key "Tab"
350
+
351
+ # Keyboard input with modifiers
352
+ chrome-cdp-cli press_key "a" --modifiers Ctrl # Ctrl+A (Select All)
353
+ chrome-cdp-cli press_key "s" --modifiers Ctrl # Ctrl+S (Save)
354
+ chrome-cdp-cli press_key "c" --modifiers Ctrl,Shift # Ctrl+Shift+C
355
+
356
+ # Target specific elements for keyboard input
357
+ chrome-cdp-cli press_key "Enter" --selector "#search-input"
358
+ chrome-cdp-cli press_key "ArrowDown" --selector "#dropdown"
359
+
360
+ # File upload to file input elements
361
+ chrome-cdp-cli upload_file "input[type='file']" "./document.pdf"
362
+ chrome-cdp-cli upload_file "#file-input" "/path/to/image.jpg"
363
+ chrome-cdp-cli upload_file ".upload-field" "./test-data.csv"
364
+
365
+ # Wait for elements to appear or meet conditions
366
+ chrome-cdp-cli wait_for "#loading-spinner" # Wait for element to exist
367
+ chrome-cdp-cli wait_for "#modal" --condition visible # Wait for element to be visible
368
+ chrome-cdp-cli wait_for "#loading" --condition hidden # Wait for element to be hidden
369
+ chrome-cdp-cli wait_for "#submit-btn" --condition enabled # Wait for element to be enabled
370
+ chrome-cdp-cli wait_for "#processing-btn" --condition disabled # Wait for element to be disabled
371
+ chrome-cdp-cli wait_for "#slow-element" --timeout 30000 # Custom timeout
372
+
373
+ # Handle browser dialogs (alert, confirm, prompt)
374
+ chrome-cdp-cli handle_dialog accept # Accept dialog
375
+ chrome-cdp-cli handle_dialog dismiss # Dismiss dialog
376
+ chrome-cdp-cli handle_dialog accept --text "John Doe" # Handle prompt with text input
377
+ chrome-cdp-cli handle_dialog accept --text "" # Handle prompt with empty input
378
+ chrome-cdp-cli handle_dialog accept --timeout 10000 # Wait for dialog to appear
379
+ ```
380
+
270
381
  #### Console Monitoring
271
382
  ```bash
272
383
  # Get latest console message
@@ -275,7 +386,7 @@ chrome-cdp-cli get_console_message
275
386
  # List all console messages
276
387
  chrome-cdp-cli list_console_messages
277
388
 
278
- # Filter console messages
389
+ # Filter console messages by type
279
390
  chrome-cdp-cli list_console_messages --filter '{"types":["error","warn"]}'
280
391
  ```
281
392
 
@@ -287,34 +398,34 @@ chrome-cdp-cli get_network_request
287
398
  # List all network requests
288
399
  chrome-cdp-cli list_network_requests
289
400
 
290
- # Filter network requests
401
+ # Filter network requests by method
291
402
  chrome-cdp-cli list_network_requests --filter '{"methods":["POST"],"statusCodes":[200,201]}'
292
403
  ```
293
404
 
294
405
  #### IDE Integration
295
406
  ```bash
296
407
  # Install Cursor command (creates .cursor/commands/cdp-cli.md)
297
- chrome-cdp-cli install-cursor-command
408
+ chrome-cdp-cli install_cursor_command
298
409
 
299
410
  # Install Cursor command with --force (bypasses directory validation)
300
- chrome-cdp-cli install-cursor-command --force
411
+ chrome-cdp-cli install_cursor_command --force
301
412
 
302
413
  # Install Claude skill for project (creates .claude/skills/cdp-cli/SKILL.md)
303
- chrome-cdp-cli install-claude-skill
414
+ chrome-cdp-cli install_claude_skill
304
415
 
305
416
  # Install Claude skill for personal use (creates ~/.claude/skills/cdp-cli/SKILL.md)
306
- chrome-cdp-cli install-claude-skill --skill-type personal
417
+ chrome-cdp-cli install_claude_skill --skill-type personal
307
418
 
308
419
  # Install Claude skill with examples and references
309
- chrome-cdp-cli install-claude-skill --include-examples --include-references
420
+ chrome-cdp-cli install_claude_skill --include-examples --include-references
310
421
 
311
422
  # Install with custom directory
312
- chrome-cdp-cli install-cursor-command --target-directory /custom/path/.cursor/commands
313
- chrome-cdp-cli install-claude-skill --target-directory /custom/path/.claude/skills
423
+ chrome-cdp-cli install_cursor_command --target-directory /custom/path/.cursor/commands
424
+ chrome-cdp-cli install_claude_skill --target-directory /custom/path/.claude/skills
314
425
 
315
426
  # Force install (bypasses directory validation)
316
- chrome-cdp-cli install-cursor-command --force
317
- chrome-cdp-cli install-claude-skill --force
427
+ chrome-cdp-cli install_cursor_command --force
428
+ chrome-cdp-cli install_claude_skill --force
318
429
  ```
319
430
 
320
431
  ### 🚧 Available via Eval Workarounds
@@ -339,14 +450,15 @@ chrome-cdp-cli eval "window.history.forward()"
339
450
 
340
451
  #### Element Interaction
341
452
  ```bash
342
- # Click element
343
- chrome-cdp-cli eval "document.querySelector('#button').click()"
344
-
345
- # Fill input field
346
- chrome-cdp-cli eval "document.querySelector('#email').value = 'user@example.com'"
453
+ # Native commands (recommended)
454
+ chrome-cdp-cli click "#button"
455
+ chrome-cdp-cli hover ".menu-item"
456
+ chrome-cdp-cli fill "#email" "user@example.com"
347
457
 
348
- # Hover over element (trigger mouseover event)
458
+ # Via eval (still available for complex scenarios)
459
+ chrome-cdp-cli eval "document.querySelector('#button').click()"
349
460
  chrome-cdp-cli eval "document.querySelector('.menu-item').dispatchEvent(new MouseEvent('mouseover'))"
461
+ chrome-cdp-cli eval "document.querySelector('#email').value = 'user@example.com'"
350
462
 
351
463
  # Check if element exists
352
464
  chrome-cdp-cli eval "!!document.querySelector('#element')"
@@ -360,7 +472,18 @@ chrome-cdp-cli eval "document.querySelector('#element').getAttribute('class')"
360
472
 
361
473
  #### Form Handling
362
474
  ```bash
363
- # Fill multiple form fields
475
+ # Native batch form filling (recommended)
476
+ chrome-cdp-cli fill_form --fields '[
477
+ {"selector":"#name","value":"John Doe"},
478
+ {"selector":"#email","value":"john@example.com"},
479
+ {"selector":"#phone","value":"123-456-7890"}
480
+ ]'
481
+
482
+ # Native single field filling
483
+ chrome-cdp-cli fill "#name" "John Doe"
484
+ chrome-cdp-cli fill "#email" "john@example.com"
485
+
486
+ # Via eval (for complex form operations)
364
487
  chrome-cdp-cli eval "
365
488
  document.querySelector('#name').value = 'John Doe';
366
489
  document.querySelector('#email').value = 'john@example.com';
@@ -370,7 +493,10 @@ document.querySelector('#phone').value = '123-456-7890';
370
493
  # Submit form
371
494
  chrome-cdp-cli eval "document.querySelector('#myform').submit()"
372
495
 
373
- # Select dropdown option
496
+ # Select dropdown option (native)
497
+ chrome-cdp-cli fill "#dropdown" "option1"
498
+
499
+ # Select dropdown option (via eval)
374
500
  chrome-cdp-cli eval "document.querySelector('#dropdown').value = 'option1'"
375
501
 
376
502
  # Check checkbox
@@ -460,7 +586,6 @@ chrome-cdp-cli eval "document.cookie"
460
586
  These features require dedicated handlers and are not yet available:
461
587
 
462
588
  - Native page management commands (new_page, close_page, list_pages, select_page)
463
- - Native element interaction commands (click, hover, fill, drag)
464
589
  - Native performance profiling commands
465
590
  - Native device emulation commands
466
591
  - Advanced output formatting options
@@ -533,7 +658,6 @@ new Promise(resolve => {
533
658
  ### Current Limitations
534
659
 
535
660
  - **No native page management**: Creating, closing, and switching between tabs requires manual implementation
536
- - **No native element interaction**: Clicking, hovering, and form filling must be done via eval
537
661
  - **No performance profiling**: Advanced performance analysis requires manual JavaScript
538
662
  - **No device emulation**: Mobile/tablet simulation not yet implemented
539
663
  - **Basic output formatting**: Advanced JSON/text formatting options not available
@@ -544,19 +668,15 @@ new Promise(resolve => {
544
668
  - `new_page`, `close_page`, `list_pages`, `select_page`
545
669
  - Direct CDP Target domain integration
546
670
 
547
- 2. **Native Element Interaction**
548
- - `click`, `hover`, `fill`, `drag` commands
549
- - CSS selector-based element targeting
550
-
551
- 3. **Performance Analysis**
671
+ 2. **Performance Analysis**
552
672
  - `performance_start_trace`, `performance_stop_trace`
553
673
  - Built-in performance metrics and analysis
554
674
 
555
- 4. **Device Emulation**
675
+ 3. **Device Emulation**
556
676
  - `emulate` command for device simulation
557
677
  - Network condition simulation
558
678
 
559
- 5. **Advanced Output Formatting**
679
+ 4. **Advanced Output Formatting**
560
680
  - Enhanced JSON/text formatting
561
681
  - Quiet and verbose modes
562
682
  - Custom output templates
@@ -581,6 +701,191 @@ new Promise(resolve => {
581
701
 
582
702
  **This tool is built for LLM-assisted development. The eval-first approach, combined with IDE integrations (Cursor commands & Claude skills), creates a seamless workflow where AI assistants can automate browser tasks as part of your development process.**
583
703
 
704
+ ## Form Filling & Element Interaction
705
+
706
+ The CLI now includes native commands for element interaction and form filling, designed to work seamlessly with both simple and complex automation scenarios.
707
+
708
+ ### Single Field Filling
709
+
710
+ ```bash
711
+ # Fill a text input
712
+ chrome-cdp-cli fill "#username" "john@example.com"
713
+
714
+ # Fill a password field
715
+ chrome-cdp-cli fill "input[type='password']" "secret123"
716
+
717
+ # Fill a textarea
718
+ chrome-cdp-cli fill "#message" "Hello, this is a test message"
719
+
720
+ # Select dropdown option (by value or text)
721
+ chrome-cdp-cli fill "#country" "US"
722
+ chrome-cdp-cli fill "#country" "United States"
723
+
724
+ # Fill without clearing existing content
725
+ chrome-cdp-cli fill "#notes" " - Additional note" --no-clear
726
+
727
+ # Fill with custom timeout
728
+ chrome-cdp-cli fill ".slow-loading-field" "value" --timeout 10000
729
+ ```
730
+
731
+ ### Batch Form Filling
732
+
733
+ ```bash
734
+ # Fill multiple fields at once
735
+ chrome-cdp-cli fill_form --fields '[
736
+ {"selector":"#firstName","value":"John"},
737
+ {"selector":"#lastName","value":"Doe"},
738
+ {"selector":"#email","value":"john.doe@example.com"},
739
+ {"selector":"#country","value":"United States"}
740
+ ]'
741
+
742
+ # Fill form from JSON file
743
+ echo '[
744
+ {"selector":"#username","value":"testuser"},
745
+ {"selector":"#password","value":"testpass"},
746
+ {"selector":"#confirmPassword","value":"testpass"}
747
+ ]' > login-form.json
748
+ chrome-cdp-cli fill_form --fields-file login-form.json
749
+
750
+ # Advanced options
751
+ chrome-cdp-cli fill_form --fields '[
752
+ {"selector":"#field1","value":"value1"},
753
+ {"selector":"#field2","value":"value2"}
754
+ ]' --no-clear --timeout 15000 --stop-on-error
755
+ ```
756
+
757
+ ### Element Interaction
758
+
759
+ ```bash
760
+ # Click elements
761
+ chrome-cdp-cli click "#submit-button"
762
+ chrome-cdp-cli click ".menu-item" --timeout 5000
763
+
764
+ # Hover over elements
765
+ chrome-cdp-cli hover "#dropdown-trigger"
766
+ chrome-cdp-cli hover ".tooltip-element" --no-wait
767
+ ```
768
+
769
+ ### Form Filling Options
770
+
771
+ **Single Field Options (`fill` command):**
772
+ - `--wait-for-element` / `--no-wait`: Wait for element to appear (default: true)
773
+ - `--timeout <ms>`: Timeout for waiting (default: 5000ms)
774
+ - `--clear-first` / `--no-clear`: Clear field before filling (default: true)
775
+
776
+ **Batch Form Options (`fill_form` command):**
777
+ - `--fields <json>`: JSON array of field objects
778
+ - `--fields-file <file>`: JSON file containing field array
779
+ - `--wait-for-elements` / `--no-wait`: Wait for all elements (default: true)
780
+ - `--timeout <ms>`: Timeout for each field (default: 5000ms)
781
+ - `--clear-first` / `--no-clear`: Clear all fields before filling (default: true)
782
+ - `--continue-on-error` / `--stop-on-error`: Continue if field fails (default: continue)
783
+
784
+ ### Supported Form Elements
785
+
786
+ **Input Types:**
787
+ - Text inputs (`<input type="text">`)
788
+ - Email inputs (`<input type="email">`)
789
+ - Password inputs (`<input type="password">`)
790
+ - Number inputs (`<input type="number">`)
791
+ - Search inputs (`<input type="search">`)
792
+ - URL inputs (`<input type="url">`)
793
+
794
+ **Other Elements:**
795
+ - Textareas (`<textarea>`)
796
+ - Select dropdowns (`<select>`) - matches by value or text content
797
+
798
+ ### Error Handling
799
+
800
+ The form filling commands include comprehensive error handling:
801
+
802
+ ```bash
803
+ # Continue filling other fields if one fails (default)
804
+ chrome-cdp-cli fill_form --fields '[
805
+ {"selector":"#valid-field","value":"works"},
806
+ {"selector":"#invalid-field","value":"fails"},
807
+ {"selector":"#another-field","value":"also works"}
808
+ ]' --continue-on-error
809
+
810
+ # Stop on first error
811
+ chrome-cdp-cli fill_form --fields '[
812
+ {"selector":"#field1","value":"value1"},
813
+ {"selector":"#nonexistent","value":"value2"}
814
+ ]' --stop-on-error
815
+ ```
816
+
817
+ ### Integration with Eval
818
+
819
+ For complex scenarios, combine native commands with eval:
820
+
821
+ ```bash
822
+ # Use native commands for standard operations
823
+ chrome-cdp-cli fill "#username" "john@example.com"
824
+ chrome-cdp-cli fill "#password" "secret123"
825
+
826
+ # Use eval for complex validation or custom logic
827
+ chrome-cdp-cli eval "
828
+ // Validate form before submission
829
+ const username = document.querySelector('#username').value;
830
+ const password = document.querySelector('#password').value;
831
+ if (username && password && password.length >= 8) {
832
+ document.querySelector('#submit').click();
833
+ return 'Form submitted successfully';
834
+ } else {
835
+ return 'Validation failed';
836
+ }
837
+ "
838
+ ```
839
+
840
+ ## Quick Reference
841
+
842
+ ### Form Filling Commands
843
+
844
+ ```bash
845
+ # Single field filling
846
+ chrome-cdp-cli fill "#username" "john@example.com"
847
+ chrome-cdp-cli fill "#country" "United States" # Works with dropdowns
848
+
849
+ # Batch form filling
850
+ chrome-cdp-cli fill_form --fields '[
851
+ {"selector":"#username","value":"john"},
852
+ {"selector":"#password","value":"secret"}
853
+ ]'
854
+
855
+ # From JSON file
856
+ chrome-cdp-cli fill_form --fields-file form-data.json
857
+ ```
858
+
859
+ ### Element Interaction Commands
860
+
861
+ ```bash
862
+ # Click and hover
863
+ chrome-cdp-cli click "#submit-button"
864
+ chrome-cdp-cli hover ".dropdown-trigger"
865
+
866
+ # With options
867
+ chrome-cdp-cli fill "#field" "value" --timeout 10000 --no-clear
868
+ chrome-cdp-cli click "#button" --no-wait
869
+ ```
870
+
871
+ ### Core Commands
872
+
873
+ ```bash
874
+ # JavaScript execution
875
+ chrome-cdp-cli eval "document.title"
876
+ chrome-cdp-cli eval --file script.js
877
+
878
+ # Visual capture
879
+ chrome-cdp-cli screenshot --filename page.png
880
+ chrome-cdp-cli snapshot --filename dom.json
881
+
882
+ # Monitoring
883
+ chrome-cdp-cli get_console_message
884
+ chrome-cdp-cli list_network_requests
885
+ ```
886
+
887
+ For detailed documentation, see the [Form Filling Guide](docs/FORM_FILLING.md).
888
+
584
889
  ## Configuration
585
890
 
586
891
  ### Configuration File
@@ -806,6 +1111,7 @@ MIT License - see [LICENSE](LICENSE) file for details.
806
1111
  ## Support
807
1112
 
808
1113
  - 📖 [Documentation](https://github.com/nickxiao42/chrome-devtools-cli/wiki)
1114
+ - 📝 [Form Filling Guide](docs/FORM_FILLING.md)
809
1115
  - 🐛 [Issue Tracker](https://github.com/nickxiao42/chrome-devtools-cli/issues)
810
1116
  - 💬 [Discussions](https://github.com/nickxiao42/chrome-devtools-cli/discussions)
811
1117
 
@@ -23,6 +23,15 @@ class CLIApplication {
23
23
  this.cli.registerHandler(new handlers_1.ListNetworkRequestsHandler());
24
24
  this.cli.registerHandler(new handlers_1.InstallCursorCommandHandler());
25
25
  this.cli.registerHandler(new handlers_1.InstallClaudeSkillHandler());
26
+ this.cli.registerHandler(new handlers_1.ClickHandler());
27
+ this.cli.registerHandler(new handlers_1.HoverHandler());
28
+ this.cli.registerHandler(new handlers_1.FillHandler());
29
+ this.cli.registerHandler(new handlers_1.FillFormHandler());
30
+ this.cli.registerHandler(new handlers_1.DragHandler());
31
+ this.cli.registerHandler(new handlers_1.PressKeyHandler());
32
+ this.cli.registerHandler(new handlers_1.UploadFileHandler());
33
+ this.cli.registerHandler(new handlers_1.WaitForHandler());
34
+ this.cli.registerHandler(new handlers_1.HandleDialogHandler());
26
35
  }
27
36
  async run(argv) {
28
37
  try {
@@ -242,7 +242,13 @@ For more information about a specific command, use:
242
242
  'eval': 'Execute JavaScript code',
243
243
  'click': 'Click element',
244
244
  'fill': 'Fill form field',
245
+ 'fill_form': 'Fill multiple form fields in batch',
245
246
  'hover': 'Hover over element',
247
+ 'drag': 'Perform drag and drop operations',
248
+ 'press_key': 'Simulate keyboard input with modifiers',
249
+ 'upload_file': 'Upload files to file input elements',
250
+ 'wait_for': 'Wait for elements to appear or meet conditions',
251
+ 'handle_dialog': 'Handle browser dialogs (alert, confirm, prompt)',
246
252
  'screenshot': 'Capture page screenshot',
247
253
  'snapshot': 'Capture DOM snapshot with structure and styles',
248
254
  'console-messages': 'Get console messages',