@@ -105,7 +105,9 @@ def get_package_directory(path: Path) -> Path:
105105 return src_dir .parent
106106
107107
108- def copy_template (path : Path , name : str , version : str = "0.1.0" ) -> None :
108+ def copy_template (
109+ path : Path , name : str , description : str , version : str = "0.1.0"
110+ ) -> None :
109111 """Copy template files into src/<project_name>"""
110112 template_dir = Path (__file__ ).parent / "template"
111113
@@ -116,18 +118,24 @@ def copy_template(path: Path, name: str, version: str = "0.1.0") -> None:
116118 env = Environment (loader = FileSystemLoader (str (template_dir )))
117119
118120 files = [
119- ("__init__.py.jinja2" , "__init__.py" ),
120- ("server.py.jinja2" , "server.py" ),
121+ ("__init__.py.jinja2" , "__init__.py" , target_dir ),
122+ ("server.py.jinja2" , "server.py" , target_dir ),
123+ ("README.md.jinja2" , "README.md" , path ),
121124 ]
122125
123- template_vars = {"server_name" : name , "server_version" : version }
126+ template_vars = {
127+ "server_name" : name ,
128+ "server_version" : version ,
129+ "server_description" : description ,
130+ "server_directory" : str (path .resolve ()),
131+ }
124132
125133 try :
126- for template_file , output_file in files :
134+ for template_file , output_file , output_dir in files :
127135 template = env .get_template (template_file )
128136 rendered = template .render (** template_vars )
129137
130- out_path = target_dir / output_file
138+ out_path = output_dir / output_file
131139 out_path .write_text (rendered )
132140
133141 except Exception as e :
@@ -136,7 +144,7 @@ def copy_template(path: Path, name: str, version: str = "0.1.0") -> None:
136144
137145
138146def create_project (
139- path : Path , name : str , version : str , use_claude : bool = True
147+ path : Path , name : str , description : str , version : str , use_claude : bool = True
140148) -> None :
141149 """Create a new project using uv"""
142150 path .mkdir (parents = True , exist_ok = True )
@@ -158,7 +166,7 @@ def create_project(
158166 click .echo ("❌ Error: Failed to add mcp dependency." , err = True )
159167 sys .exit (1 )
160168
161- copy_template (path , name , version )
169+ copy_template (path , name , description , version )
162170
163171 # Check if Claude.app is available
164172 if (
@@ -313,7 +321,7 @@ def main(
313321 click .echo ("❌ Error: Invalid path. Project creation aborted." , err = True )
314322 return 1
315323
316- create_project (project_path , name , version , claudeapp )
324+ create_project (project_path , name , description , version , claudeapp )
317325 update_pyproject_settings (project_path , version , description )
318326
319327 return 0
0 commit comments