| 435 | 'repo_url': repo_url, |
| 436 | 'supply_chain': supply_chain, |
| 437 | 'show_stats': show_stats, |
| 438 | 'debug': debug, |
| 439 | 'wizard': wizard, |
| 440 | 'show_msg': show_msg, |
| 441 | }, |
| 442 | 'watch': { |
| 443 | 'ai_scan': ai_scan, |
| 444 | 'severity_level': severity_level, |
| 445 | 'config_path': config_path, |
| 446 | 'debug': debug, |
| 447 | 'show_msg': show_msg, |
| 448 | }, |
| 449 | } |
| 450 | |
| 451 | |
| 452 | def run_wizard(): |
| 453 | click.echo("\n🧙 PySpector Scan Wizard\n") |
| 454 | |
| 455 | mode = click.prompt( |
| 456 | "What do you want to scan?", |
| 457 | type=click.Choice(["local", "repo"]), |
| 458 | default="local" |
| 459 | ) |
| 460 | |
| 461 | scan_path = None |
| 462 | repo_url = None |
| 463 | |
| 464 | if mode == "local": |
| 465 | scan_path = Path(click.prompt("Path to file or directory", type=str)) |
| 466 | else: |
| 467 | repo_url = click.prompt("GitHub/GitLab repository URL", type=str) |
| 468 | |
| 469 | ai_scan = click.confirm("Enable AI / LLM vulnerability scanning?", default=False) |
| 470 | |
| 471 | severity_level = click.prompt( |
| 472 | "Minimum severity level", |
| 473 | type=click.Choice(["LOW", "MEDIUM", "HIGH", "CRITICAL"]), |
| 474 | default="LOW" |
| 475 | ) |
| 476 | |
| 477 | report_format = click.prompt( |
| 478 | "Report format", |
| 479 | type=click.Choice(["console", "json", "sarif", "html"]), |
| 480 | default="console" |
| 481 | ) |
| 482 | |
| 483 | supply_chain = click.confirm("Check dependencies for CVE vulnerabilities?", default=False) |
| 484 | syntax_warnings = click.confirm("Treat Python SyntaxWarnings as errors?", default=False) |
| 485 | show_stats = click.confirm("Show scan performance statistics at the end?", default=False) |
| 486 | debug = click.confirm("Show verbose debug output?", default=False) |
| 487 | |
| 488 | output_file = None |
| 489 | if report_format != "console": |
| 490 | output_file = Path( |
| 491 | click.prompt("Output file path", type=str) |
| 492 | ) |
| 493 | |
| 494 | click.echo("\n[*] Wizard completed. Starting scan...\n") |