@@ -9,9 +9,11 @@ import { colors } from 'consola/utils'
99import { downloadTemplate , startShell } from 'giget'
1010import { installDependencies } from 'nypm'
1111import { relative , resolve } from 'pathe'
12+ import { hasTTY } from 'std-env'
1213import { x } from 'tinyexec'
1314
1415import { runCommand } from '../run'
16+ import { nuxtIcon } from '../utils/ascii'
1517import { logger } from '../utils/logger'
1618import { cwdArgs } from './_shared'
1719
@@ -84,11 +86,22 @@ export default defineCommand({
8486 } ,
8587 } ,
8688 async run ( ctx ) {
87- const cwd = resolve ( ctx . args . cwd )
88-
89- let templateDownloadPath = resolve ( cwd , ctx . args . dir )
89+ if ( hasTTY ) {
90+ process . stdout . write ( ` ${ nuxtIcon } \n` )
91+ }
9092
9193 logger . info ( colors . bold ( `Welcome to Nuxt!` . split ( '' ) . map ( m => `\x1B[38;5;79m${ m } ` ) . join ( '' ) ) )
94+
95+ if ( ctx . args . dir === '' ) {
96+ ctx . args . dir = await logger . prompt ( 'Where would you like to create your project?' , {
97+ placeholder : './nuxt-app' ,
98+ type : 'text' ,
99+ default : 'nuxt-app' ,
100+ } )
101+ }
102+
103+ const cwd = resolve ( ctx . args . cwd )
104+ let templateDownloadPath = resolve ( cwd , ctx . args . dir )
92105 logger . info ( `Creating a new project in ${ colors . cyan ( relative ( cwd , templateDownloadPath ) || templateDownloadPath ) } .` )
93106
94107 // Get template name
0 commit comments