diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index d33d1ca5b1..d4fbbde40d 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -411,10 +411,12 @@ export default defineCommand({ alias: "t", }, video: { type: "string", description: "Path to a source video file", alias: "V" }, + "skip-skills": { type: "boolean", description: "Skip AI skills installation" }, }, async run({ args }) { const templateFlag = args.template; const videoFlag = args.video; + const skipSkills = args["skip-skills"] === true; // ----------------------------------------------------------------------- // Non-interactive mode: flags provided @@ -450,7 +452,9 @@ export default defineCommand({ scaffoldProject(destDir, basename(destDir), templateId, localVideoName); trackInitTemplate(templateId); - await installSkills(false); + if (!skipSkills) { + await installSkills(false); + } console.log(c.success(`\nCreated ${c.accent(name + "/")}`)); for (const f of readdirSync(destDir)) { @@ -573,7 +577,9 @@ export default defineCommand({ trackInitTemplate(templateId); // 5. Install AI coding skills - await installSkills(true); + if (!skipSkills) { + await installSkills(true); + } const files = readdirSync(destDir); clack.note(files.map((f) => c.accent(f)).join("\n"), c.success(`Created ${name}/`)); diff --git a/packages/cli/src/commands/install-skills.ts b/packages/cli/src/commands/install-skills.ts index e1a3487cbd..51b6c77a2a 100644 --- a/packages/cli/src/commands/install-skills.ts +++ b/packages/cli/src/commands/install-skills.ts @@ -39,7 +39,9 @@ const TARGETS: Target[] = [ { name: "Cursor", flag: "cursor", - dir: join(process.cwd(), ".cursor", "skills"), + get dir() { + return join(process.cwd(), ".cursor", "skills"); + }, defaultEnabled: false, }, ]; @@ -122,6 +124,7 @@ function fetchRepo(source: SkillSource): string { interface InstalledSkill { name: string; source: string; + overwritten: boolean; } function installSkillsFromDir( @@ -139,10 +142,11 @@ function installSkillsFromDir( if (!existsSync(skillFile)) continue; const destDir = join(targetDir, entry.name); - if (existsSync(destDir)) rmSync(destDir, { recursive: true, force: true }); + const overwritten = existsSync(destDir); + if (overwritten) rmSync(destDir, { recursive: true, force: true }); mkdirSync(destDir, { recursive: true }); cpSync(join(sourceDir, entry.name), destDir, { recursive: true }); - installed.push({ name: entry.name, source: sourceName }); + installed.push({ name: entry.name, source: sourceName, overwritten }); } return installed; }