1010#
1111# Additional attribution and requirements are provided in the NOTICE file.
1212
13-
1413from __future__ import annotations
1514
16- from pathlib import Path
1715import os
16+ from pathlib import Path
1817from textwrap import dedent
1918from typing import Optional
2019
3231@app .command ()
3332def project (
3433 name : Optional [str ] = typer .Option (
35- None , "--name" , "-n" ,
36- help = "Project name (defaults to current directory name)"
34+ None , "--name" , "-n" , help = "Project name (defaults to current directory name)"
3735 ),
3836 api_url : Optional [str ] = typer .Option (
39- None , "--api-url" , "-u" ,
40- help = "FuzzForge API URL (defaults to http://localhost:8000)"
37+ None ,
38+ "--api-url" ,
39+ "-u" ,
40+ help = "FuzzForge API URL (defaults to http://localhost:8000)" ,
4141 ),
4242 force : bool = typer .Option (
43- False , "--force" , "-f" ,
44- help = "Force initialization even if project already exists"
45- )
43+ False ,
44+ "--force" ,
45+ "-f" ,
46+ help = "Force initialization even if project already exists" ,
47+ ),
4648):
4749 """
4850 π Initialize a new FuzzForge project in the current directory.
@@ -58,24 +60,20 @@ def project(
5860 # Check if project already exists
5961 if fuzzforge_dir .exists () and not force :
6062 if fuzzforge_dir .is_dir () and any (fuzzforge_dir .iterdir ()):
61- console .print ("β FuzzForge project already exists in this directory" , style = "red" )
63+ console .print (
64+ "β FuzzForge project already exists in this directory" , style = "red"
65+ )
6266 console .print ("Use --force to reinitialize" , style = "dim" )
6367 raise typer .Exit (1 )
6468
6569 # Get project name
6670 if not name :
67- name = Prompt .ask (
68- "Project name" ,
69- default = current_dir .name ,
70- console = console
71- )
71+ name = Prompt .ask ("Project name" , default = current_dir .name , console = console )
7272
7373 # Get API URL
7474 if not api_url :
7575 api_url = Prompt .ask (
76- "FuzzForge API URL" ,
77- default = "http://localhost:8000" ,
78- console = console
76+ "FuzzForge API URL" , default = "http://localhost:8000" , console = console
7977 )
8078
8179 # Confirm initialization
@@ -117,15 +115,15 @@ def project(
117115 ]
118116
119117 if gitignore_path .exists ():
120- with open (gitignore_path , 'r' ) as f :
118+ with open (gitignore_path , "r" ) as f :
121119 existing_content = f .read ()
122120
123121 if "# FuzzForge CLI" not in existing_content :
124- with open (gitignore_path , 'a' ) as f :
122+ with open (gitignore_path , "a" ) as f :
125123 f .write (f"\n { chr (10 ).join (gitignore_entries )} \n " )
126124 console .print ("π Updated .gitignore with FuzzForge entries" )
127125 else :
128- with open (gitignore_path , 'w' ) as f :
126+ with open (gitignore_path , "w" ) as f :
129127 f .write (f"{ chr (10 ).join (gitignore_entries )} \n " )
130128 console .print ("π Created .gitignore" )
131129
@@ -145,9 +143,6 @@ def project(
145143# Submit a workflow for analysis
146144fuzzforge workflow <workflow-name> /path/to/target
147145
148- # Monitor run progress
149- fuzzforge monitor live <run-id>
150-
151146# View findings
152147fuzzforge finding <run-id>
153148```
@@ -159,12 +154,12 @@ def project(
159154- `.fuzzforge/findings.db` - Local database for runs and findings
160155"""
161156
162- with open (readme_path , 'w' ) as f :
157+ with open (readme_path , "w" ) as f :
163158 f .write (readme_content )
164159 console .print ("π Created README.md" )
165160
166161 console .print ("\n β
FuzzForge project initialized successfully!" , style = "green" )
167- console .print (f "\n π― Next steps:" )
162+ console .print ("\n π― Next steps:" )
168163 console .print (" β’ ff workflows - See available workflows" )
169164 console .print (" β’ ff status - Check API connectivity" )
170165 console .print (" β’ ff workflow <workflow> <path> - Start your first analysis" )
0 commit comments