@@ -9,6 +9,8 @@ import 'package:flutter_skill/src/cli/doctor.dart';
99import 'package:flutter_skill/src/cli/init.dart' ;
1010import 'package:flutter_skill/src/cli/demo.dart' ;
1111import 'package:flutter_skill/src/cli/serve.dart' ;
12+ import 'package:flutter_skill/src/cli/test_runner.dart' ;
13+ import 'package:flutter_skill/src/cli/explore.dart' ;
1214
1315void main (List <String > args) async {
1416 if (args.isEmpty) {
@@ -23,6 +25,7 @@ void main(List<String> args) async {
2325 print (' act Perform actions (tap, enter_text, scroll)' );
2426 print (' screenshot Take a screenshot of the running app' );
2527 print (' serve <url> Zero-config WebMCP server — any site → AI tools' );
28+ print (' explore <url> AI Test Agent — auto-explore and test any web app' );
2629 print (' test <url> Zero-config web testing — launch Chrome + CDP' );
2730 print (' doctor Check installation and environment health' );
2831 print (' setup Install tool priority rules for Claude Code' );
@@ -95,23 +98,44 @@ void main(List<String> args) async {
9598 case 'serve' :
9699 await runServe (commandArgs);
97100 break ;
101+ case 'explore' :
102+ await runExplore (commandArgs);
103+ break ;
98104 case 'test' :
99- // Convenience wrapper: `flutter-skill test <url>` → `server --url=<url>`
100105 if (commandArgs.isEmpty) {
101- print ('Usage: flutter-skill test <url>' );
106+ print ('Usage: flutter-skill test <url> [options] ' );
102107 print ('' );
103- print ('Example: flutter-skill test https://example.com' );
108+ print ('Examples:' );
109+ print (' flutter-skill test https://example.com' );
110+ print (' flutter-skill test --url=https://example.com --platforms=web,electron,android' );
104111 print ('' );
105- print (
106- 'Launches Chrome, navigates to the URL, and starts the MCP server' );
107- print ('with CDP auto-connected. No setup needed.' );
112+ print ('Options:' );
113+ print (' --url=<url> URL to test' );
114+ print (' --platforms=<list> Platforms: web,electron,android,ios (default: web)' );
115+ print (' --cdp-port=<port> CDP port (default: 9222)' );
116+ print (' --no-headless Show browser window' );
117+ print (' --report=<path> Save JSON report to file' );
108118 exit (1 );
109119 }
110- final testUrl = commandArgs[0 ];
111- final serverArgs = ['--url=$testUrl ' ];
112- // Pass through any additional flags (e.g. --cdp-port=9333)
113- serverArgs.addAll (commandArgs.sublist (1 ));
114- await runServer (serverArgs);
120+ // Check if --platforms flag is used → parallel test runner
121+ final hasMultiPlatform = commandArgs.any ((a) => a.startsWith ('--platforms=' ));
122+ if (hasMultiPlatform) {
123+ await runTestRunner (commandArgs);
124+ } else {
125+ // Single-platform: convenience wrapper → server --url=<url>
126+ final testUrl = commandArgs.firstWhere ((a) => ! a.startsWith ('--' ),
127+ orElse: () => commandArgs
128+ .firstWhere ((a) => a.startsWith ('--url=' ),
129+ orElse: () => '' )
130+ .replaceFirst ('--url=' , '' ));
131+ if (testUrl.isEmpty) {
132+ print ('Error: URL is required' );
133+ exit (1 );
134+ }
135+ final serverArgs = ['--url=$testUrl ' ];
136+ serverArgs.addAll (commandArgs.where ((a) => a != testUrl && ! a.startsWith ('--url=' )));
137+ await runServer (serverArgs);
138+ }
115139 break ;
116140 default :
117141 print ('Unknown command: $command ' );
0 commit comments