PySpector: A high-performance, security-focused static analysis tool for Python, powered by Rust.
(
ctx: click.Context,
ai_scan: bool,
severity_level: str,
report_format: str,
config_path: Optional[Path],
output_file: Optional[Path],
repo_url: Optional[str],
supply_chain: bool,
show_stats: bool,
debug: bool,
wizard: bool,
)
| 395 | + click.style(f"[{sev}]", fg=_SEV_COLOR.get(sev, "white")) |
| 396 | + f" {issue.rule_id}" |
| 397 | + f" {issue.file_path}:{issue.line_number}" |
| 398 | + f" `{issue.code.strip()[:60]}`" |
| 399 | ) |
| 400 | |
| 401 | |
| 402 | # --- Main CLI Logic --- |
| 403 | |
| 404 | @click.group() |
| 405 | @click.option('--ai', 'ai_scan', is_flag=True, default=False, |
| 406 | help="Enable the specialized ruleset for AI/LLM vulnerability scanning.") |
| 407 | @click.option('-s', '--severity', 'severity_level', |
| 408 | type=click.Choice(['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']), |
| 409 | default='LOW', show_default=True, |
| 410 | help="Minimum severity level to report.") |
| 411 | @click.option('-f', '--format', 'report_format', |
| 412 | type=click.Choice(['console', 'json', 'sarif', 'html']), |
| 413 | default='console', show_default=True, |
| 414 | help="Output format: console, json, sarif, or html.") |
| 415 | @click.option('-c', '--config', 'config_path', |
| 416 | type=click.Path(path_type=Path), |
| 417 | help="Path to a pyspector.toml configuration file.") |
| 418 | @click.option('-o', '--output', 'output_file', |
| 419 | type=click.Path(path_type=Path), |
| 420 | help="Path to write the report to (default: stdout).") |
| 421 | @click.option('-u', '--url', 'repo_url', type=str, |
| 422 | help="URL of a public GitHub or GitLab repository to clone and scan.") |
| 423 | @click.option('--supply-chain', is_flag=True, default=False, |
| 424 | help="Check project dependencies against the OSV database for known CVEs.") |
| 425 | @click.option('--stats', 'show_stats', is_flag=True, default=False, |
| 426 | help="Print a performance and findings statistics table after the scan.") |
| 427 | @click.option('--debug', is_flag=True, default=False, |
| 428 | help="Show all informational/progress messages.") |
| 429 | @click.option('--wizard', is_flag=True, default=False, |
| 430 | help="Launch interactive guided scan mode — ideal for first-time users.") |
| 431 | @click.option('--msg', 'show_msg', type=bool, default=None, |
| 432 | help="Enable or disable the rotating contact message shown below the " |
| 433 | "banner (--msg=True / --msg=False). The setting persists across " |
| 434 | "future runs until changed again, so it only needs to be set once.") |
| 435 | @click.pass_context |
| 436 | def cli( |
| 437 | ctx: click.Context, |
nothing calls this directly
no outgoing calls
no test coverage detected