@@ -54,10 +54,27 @@ export function cli({
5454 // await initAddOn('overlay')
5555 // })
5656
57+ program . argument ( '[project-name]' , 'name of the project' )
58+
59+ if ( ! forcedMode ) {
60+ program . option < 'typescript' | 'javascript' | 'file-router' > (
61+ '--template <type>' ,
62+ 'project template (typescript, javascript, file-router)' ,
63+ ( value ) => {
64+ if (
65+ value !== 'typescript' &&
66+ value !== 'javascript' &&
67+ value !== 'file-router'
68+ ) {
69+ throw new InvalidArgumentError (
70+ `Invalid template: ${ value } . Only the following are allowed: typescript, javascript, file-router` ,
71+ )
72+ }
73+ return value
74+ } ,
75+ )
76+ }
5777 program
58- . argument ( '[project-name]' , 'name of the project' )
59- . option ( '--no-git' , 'do not create a git repository' )
60- . option ( '--target-dir <path>' , 'the directory to create the project in' )
6178 . option < Framework > (
6279 '--framework <type>' ,
6380 'project framework (solid, react)' ,
@@ -73,6 +90,7 @@ export function cli({
7390 } ,
7491 DEFAULT_FRAMEWORK ,
7592 )
93+ // .option('--overlay [url]', 'add an overlay from a URL', false)
7694 . option < PackageManager > (
7795 `--package-manager <${ SUPPORTED_PACKAGE_MANAGERS . join ( '|' ) } >` ,
7896 `Explicitly tell the CLI to use this package manager` ,
@@ -114,29 +132,11 @@ export function cli({
114132 } ,
115133 )
116134 . option ( '--list-add-ons' , 'list all available add-ons' , false )
117- // .option('--overlay [url]', 'add an overlay from a URL', false)
135+ . option ( '--no-git' , 'do not create a git repository' )
136+ . option ( '--target-dir <path>' , 'the directory to create the project in' )
118137 . option ( '--mcp' , 'run the MCP server' , false )
119138 . option ( '--mcp-sse' , 'run the MCP server in SSE mode' , false )
120139
121- if ( ! forcedMode ) {
122- program . option < 'typescript' | 'javascript' | 'file-router' > (
123- '--template <type>' ,
124- 'project template (typescript, javascript, file-router)' ,
125- ( value ) => {
126- if (
127- value !== 'typescript' &&
128- value !== 'javascript' &&
129- value !== 'file-router'
130- ) {
131- throw new InvalidArgumentError (
132- `Invalid template: ${ value } . Only the following are allowed: typescript, javascript, file-router` ,
133- )
134- }
135- return value
136- } ,
137- )
138- }
139-
140140 program . action ( async ( projectName : string , options : CliOptions ) => {
141141 if ( options . listAddOns ) {
142142 await listAddOns ( options , {
0 commit comments