11import chalk from 'chalk' ;
22import { resolveOptions } from './options' ;
33import { createNodeProject } from './createNodeProject' ;
4- import { confirmPrompt } from './utils/prompts' ;
5- import { spawn } from './utils/spawn' ;
4+ import { promptInstallSkill } from './installSkill' ;
65
7- const SMELTER_SKILL_REPO = 'smelter-labs/skills' ;
8- const SMELTER_SKILL_NAME = 'live-composing-smelter' ;
9-
10- export default async function ( ) {
6+ export default async function ( ) {
117 const options = await resolveOptions ( ) ;
128 if ( options . runtime . type === 'node' ) {
139 console . log ( 'Generating Node.js Smelter project' ) ;
@@ -19,27 +15,7 @@ export default async function() {
1915 console . log ( chalk . green ( 'Project created successfully.' ) ) ;
2016 console . log ( ) ;
2117
22- const installSkill = await confirmPrompt (
23- 'Would you like to install the Smelter TypeScript SDK skill for your AI coding assistant?'
24- ) ;
25-
26- if ( installSkill ) {
27- console . log ( ) ;
28- console . log ( 'Installing Smelter skill...' ) ;
29- try {
30- await spawn (
31- 'npx' ,
32- [ '-y' , 'skills' , 'add' , SMELTER_SKILL_REPO , '--skill' , SMELTER_SKILL_NAME ] ,
33- { cwd : options . directory }
34- ) ;
35- console . log ( chalk . green ( 'Smelter skill installed successfully.' ) ) ;
36- } catch ( err : any ) {
37- console . log ( chalk . yellow ( 'Failed to install Smelter skill. You can install it later with:' ) ) ;
38- console . log (
39- chalk . bold ( ` npx skills add ${ SMELTER_SKILL_REPO } --skill ${ SMELTER_SKILL_NAME } ` )
40- ) ;
41- }
42- }
18+ await promptInstallSkill ( options . directory ) ;
4319
4420 console . log ( ) ;
4521 console . log ( `To get started run:` ) ;
0 commit comments