@@ -84,7 +84,24 @@ def cli():
8484 PySpector: A high-performance, security-focused static analysis tool
8585 for Python, powered by Rust.
8686 """
87- pass
87+ banner = r"""
88+ o__ __o o__ __o o
89+ <| v\ /v v\ <|>
90+ / \ <\ /> <\ < >
91+ \o/ o/ o o _\o____ \o_ __o o__ __o __o__ | o__ __o \o__ __o
92+ |__ _<|/ <|> <|> \_\__o__ | v\ /v |> /> \ o__/_ /v v\ | |>
93+ | < > < > \ / \ <\ /> // o/ | /> <\ / \ < >
94+ <o> \o o/ \ / \o/ / \o o/ <| | \ / \o/
95+ | v\ /v o o | o v\ /v __o \\ o o o |
96+ / \ <\/> <\__ __/> / \ __/> <\/> __/> _\o__</ <\__ <\__ __/> / \
97+ / \o/
98+ o |
99+ __/> / \
100+ """
101+ click .echo (click .style (banner ))
102+ click .echo ("Version: 0.1.1-beta\n " )
103+ click .echo ("Made with <3 by github.com/ParzivalHack\n " )
104+
88105cli = cast (click .Group , cli )
89106
90107@click .command (help = "Scan a directory, file, or remote Git repository for vulnerabilities." )
@@ -94,7 +111,8 @@ def cli():
94111@click .option ('-o' , '--output' , 'output_file' , type = click .Path (path_type = Path ), help = "Path to write the report to." )
95112@click .option ('-f' , '--format' , 'report_format' , type = click .Choice (['console' , 'json' , 'sarif' , 'html' ]), default = 'console' , help = "Format of the report." )
96113@click .option ('-s' , '--severity' , 'severity_level' , type = click .Choice (['LOW' , 'MEDIUM' , 'HIGH' , 'CRITICAL' ]), default = 'LOW' , help = "Minimum severity level to report." )
97- def run_scan_command (path : Optional [Path ], repo_url : Optional [str ], config_path : Optional [Path ], output_file : Optional [Path ], report_format : str , severity_level : str ):
114+ @click .option ('--ai' , 'ai_scan' , is_flag = True , default = False , help = "Enable specialized scanning for AI/LLM vulnerabilities." )
115+ def run_scan_command (path : Optional [Path ], repo_url : Optional [str ], config_path : Optional [Path ], output_file : Optional [Path ], report_format : str , severity_level : str , ai_scan : bool ):
98116 """The main scan command."""
99117 if not path and not repo_url :
100118 raise click .UsageError ("You must provide either a PATH or a --url to scan." )
@@ -116,7 +134,7 @@ def run_scan_command(path: Optional[Path], repo_url: Optional[str], config_path:
116134 text = True
117135 )
118136 scan_path = Path (temp_dir )
119- _execute_scan (scan_path , config_path , output_file , report_format , severity_level )
137+ _execute_scan (scan_path , config_path , output_file , report_format , severity_level , ai_scan )
120138 except subprocess .CalledProcessError as e :
121139 click .echo (click .style (f"Error: Failed to clone repository.\n { e .stderr } " , fg = "red" ))
122140 sys .exit (1 )
@@ -126,15 +144,15 @@ def run_scan_command(path: Optional[Path], repo_url: Optional[str], config_path:
126144 else :
127145 # Handle local path scan
128146 scan_path = path
129- _execute_scan (scan_path , config_path , output_file , report_format , severity_level )
147+ _execute_scan (scan_path , config_path , output_file , report_format , severity_level , ai_scan )
130148
131149
132- def _execute_scan (scan_path : Path , config_path : Optional [Path ], output_file : Optional [Path ], report_format : str , severity_level : str ):
150+ def _execute_scan (scan_path : Path , config_path : Optional [Path ], output_file : Optional [Path ], report_format : str , severity_level : str , ai_scan : bool ):
133151 """Helper function to run the actual scan and reporting."""
134152 start_time = time .time ()
135153
136154 config = load_config (config_path )
137- rules_toml_str = get_default_rules ()
155+ rules_toml_str = get_default_rules (ai_scan )
138156
139157 click .echo (f"[*] Starting PySpector scan on '{ scan_path } '..." )
140158
0 commit comments