File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
comfy_cli/command/custom_nodes Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 88
99import typer
1010from rich import print
11+ from rich .console import Console
1112from typing_extensions import Annotated , List
1213
1314from comfy_cli import logging , tracking , ui , utils
2829)
2930from comfy_cli .workspace_manager import WorkspaceManager
3031
32+ console = Console ()
3133app = typer .Typer ()
3234app .add_typer (bisect_app , name = "bisect" , help = "Bisect custom nodes for culprit node." )
3335manager_app = typer .Typer ()
@@ -918,3 +920,20 @@ def pack():
918920 zip_files (zip_filename )
919921 typer .echo (f"Created zip file: { NODE_ZIP_FILENAME } " )
920922 logging .info ("Node has been packed successfully." )
923+
924+
925+ @app .command ("scaffold" , help = "Create a new ComfyUI custom node project using cookiecutter" )
926+ @tracking .track_command ("node" )
927+ def scaffold_cookiecutter ():
928+ """Create a new ComfyUI custom node project using cookiecutter."""
929+ import cookiecutter .main
930+
931+ try :
932+ cookiecutter .main .cookiecutter (
933+ "https://github.com/Comfy-Org/cookiecutter-comfy-extension.git" ,
934+ overwrite_if_exists = True ,
935+ )
936+ console .print ("[bold green]✓ Custom node project created successfully![/bold green]" )
937+ except Exception as e :
938+ console .print (f"[bold red]Error creating project: { str (e )} [/bold red]" )
939+ raise typer .Exit (code = 1 )
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ dependencies = [
4343 " websocket-client" ,
4444 " ruff" ,
4545 " semver~=3.0.2" ,
46+ " cookiecutter" ,
4647]
4748
4849[project .optional-dependencies ]
You can’t perform that action at this time.
0 commit comments