cursor-kit-cli 1.2.1 → 1.3.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +508 -178
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +507 -177
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +37 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -45,9 +45,9 @@ function highlight(text3) {
|
|
|
45
45
|
|
|
46
46
|
// src/commands/init.ts
|
|
47
47
|
import { defineCommand } from "citty";
|
|
48
|
-
import * as
|
|
49
|
-
import
|
|
50
|
-
import { join as
|
|
48
|
+
import * as p2 from "@clack/prompts";
|
|
49
|
+
import pc3 from "picocolors";
|
|
50
|
+
import { join as join4 } from "path";
|
|
51
51
|
|
|
52
52
|
// src/utils/fs.ts
|
|
53
53
|
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, rmSync, statSync, cpSync } from "fs";
|
|
@@ -113,6 +113,29 @@ function getConflictingDirs(dir, dirs) {
|
|
|
113
113
|
if (!dirExists(dir)) return [];
|
|
114
114
|
return dirs.filter((d) => dirExists(join(dir, d)));
|
|
115
115
|
}
|
|
116
|
+
function getGitHubDir(cwd = process.cwd()) {
|
|
117
|
+
return join(cwd, ".github");
|
|
118
|
+
}
|
|
119
|
+
function getCopilotInstructionsPath(cwd = process.cwd()) {
|
|
120
|
+
return join(getGitHubDir(cwd), "copilot-instructions.md");
|
|
121
|
+
}
|
|
122
|
+
function getCopilotInstructionsDir(cwd = process.cwd()) {
|
|
123
|
+
return join(getGitHubDir(cwd), "copilot-instructions");
|
|
124
|
+
}
|
|
125
|
+
function getCopilotCommandsDir(cwd = process.cwd()) {
|
|
126
|
+
return join(getCopilotInstructionsDir(cwd), "commands");
|
|
127
|
+
}
|
|
128
|
+
function getCopilotRulesDir(cwd = process.cwd()) {
|
|
129
|
+
return join(getCopilotInstructionsDir(cwd), "rules");
|
|
130
|
+
}
|
|
131
|
+
function getCopilotSkillsDir(cwd = process.cwd()) {
|
|
132
|
+
return join(getCopilotInstructionsDir(cwd), "skills");
|
|
133
|
+
}
|
|
134
|
+
function deleteFile(path) {
|
|
135
|
+
if (fileExists(path)) {
|
|
136
|
+
rmSync(path);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
116
139
|
|
|
117
140
|
// src/utils/templates.ts
|
|
118
141
|
import { join as join2, dirname as dirname2 } from "path";
|
|
@@ -225,11 +248,290 @@ function getTemplateLabel(filename) {
|
|
|
225
248
|
function getSkillLabel(skillName) {
|
|
226
249
|
return skillName.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
227
250
|
}
|
|
251
|
+
function stripFrontmatter(content) {
|
|
252
|
+
const frontmatterRegex = /^---\n[\s\S]*?\n---\n/;
|
|
253
|
+
return content.replace(frontmatterRegex, "").trim();
|
|
254
|
+
}
|
|
255
|
+
function extractFrontmatter(content) {
|
|
256
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---\n/);
|
|
257
|
+
if (!frontmatterMatch) return {};
|
|
258
|
+
const frontmatter = frontmatterMatch[1];
|
|
259
|
+
const result = {};
|
|
260
|
+
for (const line of frontmatter.split("\n")) {
|
|
261
|
+
const match = line.match(/^(\w+):\s*(.+)$/);
|
|
262
|
+
if (match) {
|
|
263
|
+
const [, key, value] = match;
|
|
264
|
+
result[key] = value === "true" ? true : value === "false" ? false : value;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
269
|
+
function generateCopilotIndex(commands, rules, skills, alwaysApplyRules = []) {
|
|
270
|
+
let output = "# GitHub Copilot Custom Instructions\n\n";
|
|
271
|
+
output += "> Generated by cursor-kit-cli\n\n";
|
|
272
|
+
output += "This file provides instructions for GitHub Copilot. ";
|
|
273
|
+
output += "When working on tasks, read the relevant files from the `copilot-instructions/` directory as needed.\n\n";
|
|
274
|
+
if (alwaysApplyRules.length > 0) {
|
|
275
|
+
output += "## Rules Applied Automatically\n\n";
|
|
276
|
+
output += "The following rules are always applied. Read these files for context:\n\n";
|
|
277
|
+
for (const rule of alwaysApplyRules) {
|
|
278
|
+
const ruleName = rule.replace(/\.md$/, "");
|
|
279
|
+
output += `- **${ruleName}**: Read \`.github/copilot-instructions/rules/${rule}\` for guidelines
|
|
280
|
+
`;
|
|
281
|
+
}
|
|
282
|
+
output += "\n";
|
|
283
|
+
}
|
|
284
|
+
if (commands.length > 0) {
|
|
285
|
+
output += "## Commands\n\n";
|
|
286
|
+
output += "When the user requests a command, read the corresponding file:\n\n";
|
|
287
|
+
for (const cmd of commands) {
|
|
288
|
+
const cmdName = cmd.replace(/\.md$/, "");
|
|
289
|
+
output += `- **${cmdName}**: Read \`.github/copilot-instructions/commands/${cmd}\` when user requests "${cmdName}"
|
|
290
|
+
`;
|
|
291
|
+
}
|
|
292
|
+
output += "\n";
|
|
293
|
+
}
|
|
294
|
+
if (rules.length > 0) {
|
|
295
|
+
output += "## Rules\n\n";
|
|
296
|
+
output += "Apply these rules when relevant to the task. Read the files as needed:\n\n";
|
|
297
|
+
for (const rule of rules) {
|
|
298
|
+
const ruleName = rule.replace(/\.md$/, "");
|
|
299
|
+
output += `- **${ruleName}**: Read \`.github/copilot-instructions/rules/${rule}\` for ${ruleName} guidelines
|
|
300
|
+
`;
|
|
301
|
+
}
|
|
302
|
+
output += "\n";
|
|
303
|
+
}
|
|
304
|
+
if (skills.length > 0) {
|
|
305
|
+
output += "## Skills\n\n";
|
|
306
|
+
output += "These are comprehensive guides for specialized domains. Read the relevant skill when working in that domain:\n\n";
|
|
307
|
+
for (const skill of skills) {
|
|
308
|
+
output += `- **${skill}**: Read \`.github/copilot-instructions/skills/${skill}/SKILL.md\` when working on ${skill} tasks
|
|
309
|
+
`;
|
|
310
|
+
}
|
|
311
|
+
output += "\n";
|
|
312
|
+
}
|
|
313
|
+
output += "## Usage Guidelines\n\n";
|
|
314
|
+
output += "- **Don't read all files at once** - Only read files relevant to the current task\n";
|
|
315
|
+
output += "- **Commands**: Read command files when the user explicitly requests that command\n";
|
|
316
|
+
output += "- **Rules**: Reference rules when they apply to the current coding task\n";
|
|
317
|
+
output += "- **Skills**: Read skill files when working in that domain (e.g., frontend-development for React components)\n";
|
|
318
|
+
output += "- **Always Apply Rules**: These are automatically considered, but you can reference them for specific guidance\n\n";
|
|
319
|
+
return output;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// src/utils/copilot.ts
|
|
323
|
+
import { join as join3 } from "path";
|
|
324
|
+
import * as p from "@clack/prompts";
|
|
325
|
+
import pc2 from "picocolors";
|
|
326
|
+
async function installCopilotCommands(commandsDir, selectedCommands) {
|
|
327
|
+
if (selectedCommands.length === 0) return [];
|
|
328
|
+
ensureDir(commandsDir);
|
|
329
|
+
const commandsMap = await fetchMultipleTemplates("commands", selectedCommands);
|
|
330
|
+
const installed = [];
|
|
331
|
+
for (const [filename, content] of commandsMap) {
|
|
332
|
+
const cleanContent = stripFrontmatter(content);
|
|
333
|
+
const filePath = join3(commandsDir, filename);
|
|
334
|
+
writeFile(filePath, cleanContent);
|
|
335
|
+
installed.push(filename);
|
|
336
|
+
}
|
|
337
|
+
return installed;
|
|
338
|
+
}
|
|
339
|
+
async function installCopilotRules(rulesDir, selectedRules) {
|
|
340
|
+
if (selectedRules.length === 0) return { installed: [], alwaysApply: [] };
|
|
341
|
+
ensureDir(rulesDir);
|
|
342
|
+
const rulesMap = await fetchMultipleTemplates("rules", selectedRules);
|
|
343
|
+
const installed = [];
|
|
344
|
+
const alwaysApply = [];
|
|
345
|
+
for (const [filename, content] of rulesMap) {
|
|
346
|
+
const frontmatter = extractFrontmatter(content);
|
|
347
|
+
const cleanContent = stripFrontmatter(content);
|
|
348
|
+
const mdFilename = filename.replace(/\.mdc$/, ".md");
|
|
349
|
+
const filePath = join3(rulesDir, mdFilename);
|
|
350
|
+
writeFile(filePath, cleanContent);
|
|
351
|
+
installed.push(mdFilename);
|
|
352
|
+
if (frontmatter.alwaysApply) {
|
|
353
|
+
alwaysApply.push(mdFilename);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return { installed, alwaysApply };
|
|
357
|
+
}
|
|
358
|
+
async function installCopilotSkills(skillsDir, selectedSkills) {
|
|
359
|
+
if (selectedSkills.length === 0) return [];
|
|
360
|
+
ensureDir(skillsDir);
|
|
361
|
+
const installed = [];
|
|
362
|
+
for (const skillName of selectedSkills) {
|
|
363
|
+
const success = copyLocalSkill(skillName, skillsDir);
|
|
364
|
+
if (!success) continue;
|
|
365
|
+
const skillTargetDir = join3(skillsDir, skillName);
|
|
366
|
+
const skillMdcPath = join3(skillTargetDir, "SKILL.mdc");
|
|
367
|
+
const skillMdPath = join3(skillTargetDir, "SKILL.md");
|
|
368
|
+
if (fileExists(skillMdcPath)) {
|
|
369
|
+
const content = readFile(skillMdcPath);
|
|
370
|
+
const cleanContent = stripFrontmatter(content);
|
|
371
|
+
writeFile(skillMdPath, cleanContent);
|
|
372
|
+
deleteFile(skillMdcPath);
|
|
373
|
+
}
|
|
374
|
+
installed.push(skillName);
|
|
375
|
+
}
|
|
376
|
+
return installed;
|
|
377
|
+
}
|
|
378
|
+
async function checkCopilotConflicts(cwd, force) {
|
|
379
|
+
const copilotDir = getCopilotInstructionsDir(cwd);
|
|
380
|
+
const copilotIndexPath = getCopilotInstructionsPath(cwd);
|
|
381
|
+
const hasExistingDir = dirExists(copilotDir);
|
|
382
|
+
const hasExistingIndex = fileExists(copilotIndexPath);
|
|
383
|
+
if ((hasExistingDir || hasExistingIndex) && !force) {
|
|
384
|
+
const overwrite = await p.confirm({
|
|
385
|
+
message: "GitHub Copilot instructions already exist. Overwrite?",
|
|
386
|
+
initialValue: false
|
|
387
|
+
});
|
|
388
|
+
if (p.isCancel(overwrite) || !overwrite) {
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
async function installCopilotInstructions(cwd, selectedCommands, selectedRules, selectedSkills) {
|
|
395
|
+
const commandsDir = getCopilotCommandsDir(cwd);
|
|
396
|
+
const rulesDir = getCopilotRulesDir(cwd);
|
|
397
|
+
const skillsDir = getCopilotSkillsDir(cwd);
|
|
398
|
+
const copilotIndexPath = getCopilotInstructionsPath(cwd);
|
|
399
|
+
const [installedCommands, rulesResult, installedSkills] = await Promise.all([
|
|
400
|
+
installCopilotCommands(commandsDir, selectedCommands),
|
|
401
|
+
installCopilotRules(rulesDir, selectedRules),
|
|
402
|
+
installCopilotSkills(skillsDir, selectedSkills)
|
|
403
|
+
]);
|
|
404
|
+
const installedRules = rulesResult.installed;
|
|
405
|
+
const alwaysApplyRules = rulesResult.alwaysApply;
|
|
406
|
+
const indexContent = generateCopilotIndex(
|
|
407
|
+
installedCommands,
|
|
408
|
+
installedRules,
|
|
409
|
+
installedSkills,
|
|
410
|
+
alwaysApplyRules
|
|
411
|
+
);
|
|
412
|
+
writeFile(copilotIndexPath, indexContent);
|
|
413
|
+
printSuccess(`GitHub Copilot instructions generated`);
|
|
414
|
+
console.log(pc2.dim(` \u2514\u2500 ${copilotIndexPath}`));
|
|
415
|
+
console.log(pc2.dim(` \u2514\u2500 ${getCopilotInstructionsDir(cwd)}/`));
|
|
416
|
+
return {
|
|
417
|
+
commands: installedCommands,
|
|
418
|
+
rules: installedRules.map((r) => r.replace(/\.md$/, "")),
|
|
419
|
+
skills: installedSkills,
|
|
420
|
+
alwaysApplyRules
|
|
421
|
+
};
|
|
422
|
+
}
|
|
228
423
|
|
|
229
424
|
// src/commands/init.ts
|
|
425
|
+
async function promptTargetSelection() {
|
|
426
|
+
return await p2.select({
|
|
427
|
+
message: "Which AI IDE are you using?",
|
|
428
|
+
options: [
|
|
429
|
+
{
|
|
430
|
+
value: "cursor",
|
|
431
|
+
label: "Cursor",
|
|
432
|
+
hint: "Generate .cursor/ directory structure"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
value: "github-copilot",
|
|
436
|
+
label: "GitHub Copilot",
|
|
437
|
+
hint: "Generate .github/copilot-instructions.md"
|
|
438
|
+
}
|
|
439
|
+
],
|
|
440
|
+
initialValue: "cursor"
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
async function handleCopilotInstallation(cwd, manifest, args, shouldInitCommands, shouldInitRules, shouldInitSkills) {
|
|
444
|
+
const s = p2.spinner();
|
|
445
|
+
const canProceed = await checkCopilotConflicts(cwd, args.force ?? false);
|
|
446
|
+
if (!canProceed) {
|
|
447
|
+
p2.cancel("Operation cancelled");
|
|
448
|
+
process.exit(0);
|
|
449
|
+
}
|
|
450
|
+
let selectedCommands = [];
|
|
451
|
+
let selectedRules = [];
|
|
452
|
+
let selectedSkills = [];
|
|
453
|
+
if (shouldInitCommands) {
|
|
454
|
+
if (args.all) {
|
|
455
|
+
selectedCommands = manifest.commands;
|
|
456
|
+
} else {
|
|
457
|
+
const selection = await selectTemplates("commands", manifest.commands);
|
|
458
|
+
if (p2.isCancel(selection)) {
|
|
459
|
+
p2.cancel("Operation cancelled");
|
|
460
|
+
process.exit(0);
|
|
461
|
+
}
|
|
462
|
+
selectedCommands = selection;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (shouldInitRules) {
|
|
466
|
+
if (args.all) {
|
|
467
|
+
selectedRules = manifest.rules;
|
|
468
|
+
} else {
|
|
469
|
+
const selection = await selectTemplates("rules", manifest.rules);
|
|
470
|
+
if (p2.isCancel(selection)) {
|
|
471
|
+
p2.cancel("Operation cancelled");
|
|
472
|
+
process.exit(0);
|
|
473
|
+
}
|
|
474
|
+
selectedRules = selection;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (shouldInitSkills) {
|
|
478
|
+
if (args.all) {
|
|
479
|
+
selectedSkills = manifest.skills;
|
|
480
|
+
} else {
|
|
481
|
+
const selection = await selectTemplates("skills", manifest.skills);
|
|
482
|
+
if (p2.isCancel(selection)) {
|
|
483
|
+
p2.cancel("Operation cancelled");
|
|
484
|
+
process.exit(0);
|
|
485
|
+
}
|
|
486
|
+
selectedSkills = selection;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (selectedCommands.length === 0 && selectedRules.length === 0 && selectedSkills.length === 0) {
|
|
490
|
+
p2.cancel("No templates selected");
|
|
491
|
+
process.exit(0);
|
|
492
|
+
}
|
|
493
|
+
try {
|
|
494
|
+
s.start("Installing GitHub Copilot instructions...");
|
|
495
|
+
const result = await installCopilotInstructions(
|
|
496
|
+
cwd,
|
|
497
|
+
selectedCommands,
|
|
498
|
+
selectedRules,
|
|
499
|
+
selectedSkills
|
|
500
|
+
);
|
|
501
|
+
s.stop("GitHub Copilot instructions installed");
|
|
502
|
+
printDivider();
|
|
503
|
+
console.log();
|
|
504
|
+
if (result.commands.length > 0) {
|
|
505
|
+
printSuccess(`Commands: ${highlight(result.commands.length.toString())} added`);
|
|
506
|
+
for (const cmd of result.commands) {
|
|
507
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.green("+")} ${cmd}`));
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (result.rules.length > 0) {
|
|
511
|
+
printSuccess(`Rules: ${highlight(result.rules.length.toString())} added`);
|
|
512
|
+
for (const rule of result.rules) {
|
|
513
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.green("+")} ${rule}`));
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
if (result.skills.length > 0) {
|
|
517
|
+
printSuccess(`Skills: ${highlight(result.skills.length.toString())} added`);
|
|
518
|
+
for (const skill of result.skills) {
|
|
519
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.green("+")} ${skill}`));
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
console.log();
|
|
523
|
+
p2.outro(pc3.green("\u2728 GitHub Copilot instructions created successfully!"));
|
|
524
|
+
} catch (error) {
|
|
525
|
+
s.stop("Failed");
|
|
526
|
+
p2.cancel(
|
|
527
|
+
`Error: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
528
|
+
);
|
|
529
|
+
process.exit(1);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
230
532
|
async function selectTemplates(type, availableTemplates) {
|
|
231
533
|
const labelFn = type === "skills" ? getSkillLabel : getTemplateLabel;
|
|
232
|
-
const selectionMode = await
|
|
534
|
+
const selectionMode = await p2.select({
|
|
233
535
|
message: `How would you like to add ${type}?`,
|
|
234
536
|
options: [
|
|
235
537
|
{
|
|
@@ -244,11 +546,11 @@ async function selectTemplates(type, availableTemplates) {
|
|
|
244
546
|
}
|
|
245
547
|
]
|
|
246
548
|
});
|
|
247
|
-
if (
|
|
549
|
+
if (p2.isCancel(selectionMode)) return selectionMode;
|
|
248
550
|
if (selectionMode === "all") {
|
|
249
551
|
return availableTemplates;
|
|
250
552
|
}
|
|
251
|
-
const selectedTemplates = await
|
|
553
|
+
const selectedTemplates = await p2.multiselect({
|
|
252
554
|
message: `Select ${type} to add:`,
|
|
253
555
|
options: availableTemplates.map((template) => ({
|
|
254
556
|
value: template,
|
|
@@ -262,13 +564,13 @@ async function selectTemplates(type, availableTemplates) {
|
|
|
262
564
|
async function handleConflicts(type, conflictingFiles) {
|
|
263
565
|
console.log();
|
|
264
566
|
console.log(
|
|
265
|
-
|
|
567
|
+
pc3.yellow(`\u26A0 ${conflictingFiles.length} existing ${type} found:`)
|
|
266
568
|
);
|
|
267
569
|
for (const file of conflictingFiles) {
|
|
268
|
-
console.log(
|
|
570
|
+
console.log(pc3.dim(` \u2514\u2500 ${file}`));
|
|
269
571
|
}
|
|
270
572
|
console.log();
|
|
271
|
-
const strategy = await
|
|
573
|
+
const strategy = await p2.select({
|
|
272
574
|
message: "How would you like to handle conflicts?",
|
|
273
575
|
options: [
|
|
274
576
|
{
|
|
@@ -310,7 +612,7 @@ async function installTemplates(type, targetDir, selectedTemplates, conflictStra
|
|
|
310
612
|
const templates = await fetchMultipleTemplates(type, templatesToInstall);
|
|
311
613
|
ensureDir(targetDir);
|
|
312
614
|
for (const [filename, content] of templates) {
|
|
313
|
-
const filePath =
|
|
615
|
+
const filePath = join4(targetDir, filename);
|
|
314
616
|
writeFile(filePath, content);
|
|
315
617
|
result.added.push(filename);
|
|
316
618
|
}
|
|
@@ -377,6 +679,12 @@ var initCommand = defineCommand({
|
|
|
377
679
|
alias: "a",
|
|
378
680
|
description: "Install all templates without selection prompts",
|
|
379
681
|
default: false
|
|
682
|
+
},
|
|
683
|
+
target: {
|
|
684
|
+
type: "string",
|
|
685
|
+
alias: "t",
|
|
686
|
+
description: "Target AI IDE: 'cursor' or 'github-copilot'",
|
|
687
|
+
default: void 0
|
|
380
688
|
}
|
|
381
689
|
},
|
|
382
690
|
async run({ args }) {
|
|
@@ -389,8 +697,19 @@ var initCommand = defineCommand({
|
|
|
389
697
|
const shouldInitCommands = initAll || args.commands;
|
|
390
698
|
const shouldInitRules = initAll || args.rules;
|
|
391
699
|
const shouldInitSkills = initAll || args.skills;
|
|
392
|
-
|
|
393
|
-
|
|
700
|
+
p2.intro(pc3.bgCyan(pc3.black(" cursor-kit init ")));
|
|
701
|
+
let target;
|
|
702
|
+
if (args.target === "github-copilot" || args.target === "cursor") {
|
|
703
|
+
target = args.target;
|
|
704
|
+
} else {
|
|
705
|
+
const selection = await promptTargetSelection();
|
|
706
|
+
if (p2.isCancel(selection)) {
|
|
707
|
+
p2.cancel("Operation cancelled");
|
|
708
|
+
process.exit(0);
|
|
709
|
+
}
|
|
710
|
+
target = selection;
|
|
711
|
+
}
|
|
712
|
+
const s = p2.spinner();
|
|
394
713
|
let manifest;
|
|
395
714
|
try {
|
|
396
715
|
s.start("Fetching template manifest...");
|
|
@@ -398,11 +717,22 @@ var initCommand = defineCommand({
|
|
|
398
717
|
s.stop("Template manifest loaded");
|
|
399
718
|
} catch (error) {
|
|
400
719
|
s.stop("Failed to fetch manifest");
|
|
401
|
-
|
|
720
|
+
p2.cancel(
|
|
402
721
|
`Error: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
403
722
|
);
|
|
404
723
|
process.exit(1);
|
|
405
724
|
}
|
|
725
|
+
if (target === "github-copilot") {
|
|
726
|
+
await handleCopilotInstallation(
|
|
727
|
+
cwd,
|
|
728
|
+
manifest,
|
|
729
|
+
args,
|
|
730
|
+
shouldInitCommands,
|
|
731
|
+
shouldInitRules,
|
|
732
|
+
shouldInitSkills
|
|
733
|
+
);
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
406
736
|
const results = {};
|
|
407
737
|
try {
|
|
408
738
|
ensureDir(cursorDir);
|
|
@@ -412,8 +742,8 @@ var initCommand = defineCommand({
|
|
|
412
742
|
selectedCommands = manifest.commands;
|
|
413
743
|
} else {
|
|
414
744
|
const selection = await selectTemplates("commands", manifest.commands);
|
|
415
|
-
if (
|
|
416
|
-
|
|
745
|
+
if (p2.isCancel(selection)) {
|
|
746
|
+
p2.cancel("Operation cancelled");
|
|
417
747
|
process.exit(0);
|
|
418
748
|
}
|
|
419
749
|
selectedCommands = selection;
|
|
@@ -425,8 +755,8 @@ var initCommand = defineCommand({
|
|
|
425
755
|
let commandStrategy = "overwrite";
|
|
426
756
|
if (conflictingCommands.length > 0 && !args.force) {
|
|
427
757
|
const strategy = await handleConflicts("commands", conflictingCommands);
|
|
428
|
-
if (
|
|
429
|
-
|
|
758
|
+
if (p2.isCancel(strategy) || strategy === "cancel") {
|
|
759
|
+
p2.cancel("Operation cancelled");
|
|
430
760
|
process.exit(0);
|
|
431
761
|
}
|
|
432
762
|
commandStrategy = strategy;
|
|
@@ -446,8 +776,8 @@ var initCommand = defineCommand({
|
|
|
446
776
|
selectedRules = manifest.rules;
|
|
447
777
|
} else {
|
|
448
778
|
const selection = await selectTemplates("rules", manifest.rules);
|
|
449
|
-
if (
|
|
450
|
-
|
|
779
|
+
if (p2.isCancel(selection)) {
|
|
780
|
+
p2.cancel("Operation cancelled");
|
|
451
781
|
process.exit(0);
|
|
452
782
|
}
|
|
453
783
|
selectedRules = selection;
|
|
@@ -456,8 +786,8 @@ var initCommand = defineCommand({
|
|
|
456
786
|
let ruleStrategy = "overwrite";
|
|
457
787
|
if (conflictingRules.length > 0 && !args.force) {
|
|
458
788
|
const strategy = await handleConflicts("rules", conflictingRules);
|
|
459
|
-
if (
|
|
460
|
-
|
|
789
|
+
if (p2.isCancel(strategy) || strategy === "cancel") {
|
|
790
|
+
p2.cancel("Operation cancelled");
|
|
461
791
|
process.exit(0);
|
|
462
792
|
}
|
|
463
793
|
ruleStrategy = strategy;
|
|
@@ -477,8 +807,8 @@ var initCommand = defineCommand({
|
|
|
477
807
|
selectedSkills = manifest.skills;
|
|
478
808
|
} else {
|
|
479
809
|
const selection = await selectTemplates("skills", manifest.skills);
|
|
480
|
-
if (
|
|
481
|
-
|
|
810
|
+
if (p2.isCancel(selection)) {
|
|
811
|
+
p2.cancel("Operation cancelled");
|
|
482
812
|
process.exit(0);
|
|
483
813
|
}
|
|
484
814
|
selectedSkills = selection;
|
|
@@ -487,8 +817,8 @@ var initCommand = defineCommand({
|
|
|
487
817
|
let skillStrategy = "overwrite";
|
|
488
818
|
if (conflictingSkills.length > 0 && !args.force) {
|
|
489
819
|
const strategy = await handleConflicts("skills", conflictingSkills);
|
|
490
|
-
if (
|
|
491
|
-
|
|
820
|
+
if (p2.isCancel(strategy) || strategy === "cancel") {
|
|
821
|
+
p2.cancel("Operation cancelled");
|
|
492
822
|
process.exit(0);
|
|
493
823
|
}
|
|
494
824
|
skillStrategy = strategy;
|
|
@@ -507,13 +837,13 @@ var initCommand = defineCommand({
|
|
|
507
837
|
const { added, skipped } = results.commands;
|
|
508
838
|
if (added.length > 0 || skipped.length > 0) {
|
|
509
839
|
printSuccess(
|
|
510
|
-
`Commands: ${highlight(added.length.toString())} added${skipped.length > 0 ? `, ${
|
|
840
|
+
`Commands: ${highlight(added.length.toString())} added${skipped.length > 0 ? `, ${pc3.yellow(skipped.length.toString())} skipped` : ""}`
|
|
511
841
|
);
|
|
512
842
|
for (const f of added) {
|
|
513
|
-
console.log(
|
|
843
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.green("+")} ${f}`));
|
|
514
844
|
}
|
|
515
845
|
for (const f of skipped) {
|
|
516
|
-
console.log(
|
|
846
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.yellow("\u25CB")} ${f} (kept existing)`));
|
|
517
847
|
}
|
|
518
848
|
}
|
|
519
849
|
}
|
|
@@ -521,13 +851,13 @@ var initCommand = defineCommand({
|
|
|
521
851
|
const { added, skipped } = results.rules;
|
|
522
852
|
if (added.length > 0 || skipped.length > 0) {
|
|
523
853
|
printSuccess(
|
|
524
|
-
`Rules: ${highlight(added.length.toString())} added${skipped.length > 0 ? `, ${
|
|
854
|
+
`Rules: ${highlight(added.length.toString())} added${skipped.length > 0 ? `, ${pc3.yellow(skipped.length.toString())} skipped` : ""}`
|
|
525
855
|
);
|
|
526
856
|
for (const f of added) {
|
|
527
|
-
console.log(
|
|
857
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.green("+")} ${f}`));
|
|
528
858
|
}
|
|
529
859
|
for (const f of skipped) {
|
|
530
|
-
console.log(
|
|
860
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.yellow("\u25CB")} ${f} (kept existing)`));
|
|
531
861
|
}
|
|
532
862
|
}
|
|
533
863
|
}
|
|
@@ -535,13 +865,13 @@ var initCommand = defineCommand({
|
|
|
535
865
|
const { added, skipped } = results.skills;
|
|
536
866
|
if (added.length > 0 || skipped.length > 0) {
|
|
537
867
|
printSuccess(
|
|
538
|
-
`Skills: ${highlight(added.length.toString())} added${skipped.length > 0 ? `, ${
|
|
868
|
+
`Skills: ${highlight(added.length.toString())} added${skipped.length > 0 ? `, ${pc3.yellow(skipped.length.toString())} skipped` : ""}`
|
|
539
869
|
);
|
|
540
870
|
for (const f of added) {
|
|
541
|
-
console.log(
|
|
871
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.green("+")} ${f}`));
|
|
542
872
|
}
|
|
543
873
|
for (const f of skipped) {
|
|
544
|
-
console.log(
|
|
874
|
+
console.log(pc3.dim(` \u2514\u2500 ${pc3.yellow("\u25CB")} ${f} (kept existing)`));
|
|
545
875
|
}
|
|
546
876
|
}
|
|
547
877
|
}
|
|
@@ -549,14 +879,14 @@ var initCommand = defineCommand({
|
|
|
549
879
|
const totalSkipped = (results.commands?.skipped.length ?? 0) + (results.rules?.skipped.length ?? 0) + (results.skills?.skipped.length ?? 0);
|
|
550
880
|
if (totalAdded === 0 && totalSkipped > 0) {
|
|
551
881
|
console.log();
|
|
552
|
-
|
|
882
|
+
p2.outro(pc3.yellow("No new templates added (all selected files already exist)"));
|
|
553
883
|
} else {
|
|
554
884
|
console.log();
|
|
555
|
-
|
|
885
|
+
p2.outro(pc3.green("\u2728 Cursor Kit initialized successfully!"));
|
|
556
886
|
}
|
|
557
887
|
} catch (error) {
|
|
558
888
|
s.stop("Failed");
|
|
559
|
-
|
|
889
|
+
p2.cancel(
|
|
560
890
|
`Error: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
561
891
|
);
|
|
562
892
|
process.exit(1);
|
|
@@ -565,10 +895,10 @@ var initCommand = defineCommand({
|
|
|
565
895
|
});
|
|
566
896
|
|
|
567
897
|
// src/commands/add.ts
|
|
568
|
-
import * as
|
|
898
|
+
import * as p3 from "@clack/prompts";
|
|
569
899
|
import { defineCommand as defineCommand2 } from "citty";
|
|
570
|
-
import { join as
|
|
571
|
-
import
|
|
900
|
+
import { join as join5 } from "path";
|
|
901
|
+
import pc4 from "picocolors";
|
|
572
902
|
var COMMAND_TEMPLATE = `You are a helpful assistant. Describe what this command does.
|
|
573
903
|
|
|
574
904
|
## Instructions
|
|
@@ -654,13 +984,13 @@ var addCommand = defineCommand2({
|
|
|
654
984
|
}
|
|
655
985
|
},
|
|
656
986
|
async run({ args }) {
|
|
657
|
-
|
|
987
|
+
p3.intro(pc4.bgCyan(pc4.black(" cursor-kit add ")));
|
|
658
988
|
let itemType;
|
|
659
989
|
let itemName;
|
|
660
990
|
if (args.type && ["command", "rule", "skill"].includes(args.type)) {
|
|
661
991
|
itemType = args.type;
|
|
662
992
|
} else {
|
|
663
|
-
const typeResult = await
|
|
993
|
+
const typeResult = await p3.select({
|
|
664
994
|
message: "What do you want to add?",
|
|
665
995
|
options: [
|
|
666
996
|
{
|
|
@@ -680,8 +1010,8 @@ var addCommand = defineCommand2({
|
|
|
680
1010
|
}
|
|
681
1011
|
]
|
|
682
1012
|
});
|
|
683
|
-
if (
|
|
684
|
-
|
|
1013
|
+
if (p3.isCancel(typeResult)) {
|
|
1014
|
+
p3.cancel("Operation cancelled");
|
|
685
1015
|
process.exit(0);
|
|
686
1016
|
}
|
|
687
1017
|
itemType = typeResult;
|
|
@@ -689,7 +1019,7 @@ var addCommand = defineCommand2({
|
|
|
689
1019
|
if (args.name) {
|
|
690
1020
|
itemName = args.name;
|
|
691
1021
|
} else {
|
|
692
|
-
const nameResult = await
|
|
1022
|
+
const nameResult = await p3.text({
|
|
693
1023
|
message: `Enter ${itemType} name:`,
|
|
694
1024
|
placeholder: itemType === "command" ? "my-command" : itemType === "rule" ? "my-rule" : "my-skill",
|
|
695
1025
|
validate: (value) => {
|
|
@@ -698,8 +1028,8 @@ var addCommand = defineCommand2({
|
|
|
698
1028
|
return void 0;
|
|
699
1029
|
}
|
|
700
1030
|
});
|
|
701
|
-
if (
|
|
702
|
-
|
|
1031
|
+
if (p3.isCancel(nameResult)) {
|
|
1032
|
+
p3.cancel("Operation cancelled");
|
|
703
1033
|
process.exit(0);
|
|
704
1034
|
}
|
|
705
1035
|
itemName = nameResult;
|
|
@@ -711,32 +1041,32 @@ var addCommand = defineCommand2({
|
|
|
711
1041
|
let displayPath;
|
|
712
1042
|
if (isSkill) {
|
|
713
1043
|
const skillsDir = getSkillsDir();
|
|
714
|
-
targetPath =
|
|
1044
|
+
targetPath = join5(skillsDir, slug);
|
|
715
1045
|
displayPath = targetPath;
|
|
716
1046
|
} else {
|
|
717
1047
|
const targetDir = isCommand ? getCommandsDir() : getRulesDir();
|
|
718
1048
|
const extension = isCommand ? ".md" : ".mdc";
|
|
719
|
-
targetPath =
|
|
1049
|
+
targetPath = join5(targetDir, `${slug}${extension}`);
|
|
720
1050
|
displayPath = targetPath;
|
|
721
1051
|
}
|
|
722
1052
|
if (isSkill ? dirExists(targetPath) : fileExists(targetPath)) {
|
|
723
|
-
const shouldOverwrite = await
|
|
1053
|
+
const shouldOverwrite = await p3.confirm({
|
|
724
1054
|
message: `${highlight(isSkill ? slug : slug + (isCommand ? ".md" : ".mdc"))} already exists. Overwrite?`,
|
|
725
1055
|
initialValue: false
|
|
726
1056
|
});
|
|
727
|
-
if (
|
|
728
|
-
|
|
1057
|
+
if (p3.isCancel(shouldOverwrite) || !shouldOverwrite) {
|
|
1058
|
+
p3.cancel("Operation cancelled");
|
|
729
1059
|
process.exit(0);
|
|
730
1060
|
}
|
|
731
1061
|
}
|
|
732
|
-
const s =
|
|
1062
|
+
const s = p3.spinner();
|
|
733
1063
|
s.start(`Creating ${itemType}...`);
|
|
734
1064
|
try {
|
|
735
1065
|
if (isSkill) {
|
|
736
1066
|
ensureDir(targetPath);
|
|
737
|
-
ensureDir(
|
|
738
|
-
writeFile(
|
|
739
|
-
writeFile(
|
|
1067
|
+
ensureDir(join5(targetPath, "references"));
|
|
1068
|
+
writeFile(join5(targetPath, "SKILL.mdc"), SKILL_TEMPLATE);
|
|
1069
|
+
writeFile(join5(targetPath, "references", "example.md"), SKILL_REFERENCE_TEMPLATE);
|
|
740
1070
|
} else {
|
|
741
1071
|
const targetDir = isCommand ? getCommandsDir() : getRulesDir();
|
|
742
1072
|
ensureDir(targetDir);
|
|
@@ -746,18 +1076,18 @@ var addCommand = defineCommand2({
|
|
|
746
1076
|
s.stop(`${itemType.charAt(0).toUpperCase() + itemType.slice(1)} created`);
|
|
747
1077
|
console.log();
|
|
748
1078
|
if (isSkill) {
|
|
749
|
-
console.log(
|
|
750
|
-
console.log(
|
|
1079
|
+
console.log(pc4.dim(" Directory: ") + highlight(displayPath));
|
|
1080
|
+
console.log(pc4.dim(" Main file: ") + highlight(join5(displayPath, "SKILL.mdc")));
|
|
751
1081
|
} else {
|
|
752
|
-
console.log(
|
|
1082
|
+
console.log(pc4.dim(" File: ") + highlight(displayPath));
|
|
753
1083
|
}
|
|
754
1084
|
console.log();
|
|
755
|
-
|
|
756
|
-
|
|
1085
|
+
p3.outro(
|
|
1086
|
+
pc4.green(`\u2728 ${itemType.charAt(0).toUpperCase() + itemType.slice(1)} created! Edit the file to customize it.`)
|
|
757
1087
|
);
|
|
758
1088
|
} catch (error) {
|
|
759
1089
|
s.stop("Failed");
|
|
760
|
-
|
|
1090
|
+
p3.cancel(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
761
1091
|
process.exit(1);
|
|
762
1092
|
}
|
|
763
1093
|
}
|
|
@@ -765,8 +1095,8 @@ var addCommand = defineCommand2({
|
|
|
765
1095
|
|
|
766
1096
|
// src/commands/pull.ts
|
|
767
1097
|
import { defineCommand as defineCommand3 } from "citty";
|
|
768
|
-
import * as
|
|
769
|
-
import
|
|
1098
|
+
import * as p4 from "@clack/prompts";
|
|
1099
|
+
import pc5 from "picocolors";
|
|
770
1100
|
import { downloadTemplate } from "giget";
|
|
771
1101
|
var pullCommand = defineCommand3({
|
|
772
1102
|
meta: {
|
|
@@ -804,7 +1134,7 @@ var pullCommand = defineCommand3({
|
|
|
804
1134
|
const shouldPullCommands = pullAll || args.commands;
|
|
805
1135
|
const shouldPullRules = pullAll || args.rules;
|
|
806
1136
|
const shouldPullSkills = pullAll || args.skills;
|
|
807
|
-
|
|
1137
|
+
p4.intro(pc5.bgCyan(pc5.black(" cursor-kit pull ")));
|
|
808
1138
|
const commandsDir = getCommandsDir();
|
|
809
1139
|
const rulesDir = getRulesDir();
|
|
810
1140
|
const skillsDir = getSkillsDir();
|
|
@@ -815,25 +1145,25 @@ var pullCommand = defineCommand3({
|
|
|
815
1145
|
if (hasExisting && !args.force) {
|
|
816
1146
|
printInfo("Current status:");
|
|
817
1147
|
if (existingCommands.length > 0) {
|
|
818
|
-
console.log(
|
|
1148
|
+
console.log(pc5.dim(` Commands: ${existingCommands.length} files`));
|
|
819
1149
|
}
|
|
820
1150
|
if (existingRules.length > 0) {
|
|
821
|
-
console.log(
|
|
1151
|
+
console.log(pc5.dim(` Rules: ${existingRules.length} files`));
|
|
822
1152
|
}
|
|
823
1153
|
if (existingSkills.length > 0) {
|
|
824
|
-
console.log(
|
|
1154
|
+
console.log(pc5.dim(` Skills: ${existingSkills.length} directories`));
|
|
825
1155
|
}
|
|
826
1156
|
console.log();
|
|
827
|
-
const shouldContinue = await
|
|
1157
|
+
const shouldContinue = await p4.confirm({
|
|
828
1158
|
message: "This will merge with existing files. Continue?",
|
|
829
1159
|
initialValue: true
|
|
830
1160
|
});
|
|
831
|
-
if (
|
|
832
|
-
|
|
1161
|
+
if (p4.isCancel(shouldContinue) || !shouldContinue) {
|
|
1162
|
+
p4.cancel("Operation cancelled");
|
|
833
1163
|
process.exit(0);
|
|
834
1164
|
}
|
|
835
1165
|
}
|
|
836
|
-
const s =
|
|
1166
|
+
const s = p4.spinner();
|
|
837
1167
|
try {
|
|
838
1168
|
ensureDir(getCursorDir());
|
|
839
1169
|
if (shouldPullCommands) {
|
|
@@ -868,36 +1198,36 @@ var pullCommand = defineCommand3({
|
|
|
868
1198
|
if (shouldPullCommands) {
|
|
869
1199
|
const added = newCommands.length - existingCommands.length;
|
|
870
1200
|
printSuccess(
|
|
871
|
-
`Commands: ${highlight(newCommands.length.toString())} total` + (added > 0 ?
|
|
1201
|
+
`Commands: ${highlight(newCommands.length.toString())} total` + (added > 0 ? pc5.green(` (+${added} new)`) : "")
|
|
872
1202
|
);
|
|
873
1203
|
}
|
|
874
1204
|
if (shouldPullRules) {
|
|
875
1205
|
const added = newRules.length - existingRules.length;
|
|
876
1206
|
printSuccess(
|
|
877
|
-
`Rules: ${highlight(newRules.length.toString())} total` + (added > 0 ?
|
|
1207
|
+
`Rules: ${highlight(newRules.length.toString())} total` + (added > 0 ? pc5.green(` (+${added} new)`) : "")
|
|
878
1208
|
);
|
|
879
1209
|
}
|
|
880
1210
|
if (shouldPullSkills) {
|
|
881
1211
|
const added = newSkills.length - existingSkills.length;
|
|
882
1212
|
printSuccess(
|
|
883
|
-
`Skills: ${highlight(newSkills.length.toString())} total` + (added > 0 ?
|
|
1213
|
+
`Skills: ${highlight(newSkills.length.toString())} total` + (added > 0 ? pc5.green(` (+${added} new)`) : "")
|
|
884
1214
|
);
|
|
885
1215
|
}
|
|
886
1216
|
console.log();
|
|
887
|
-
|
|
1217
|
+
p4.outro(pc5.green("\u2728 Successfully pulled latest updates!"));
|
|
888
1218
|
} catch (error) {
|
|
889
1219
|
s.stop("Failed");
|
|
890
|
-
|
|
1220
|
+
p4.cancel(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
891
1221
|
process.exit(1);
|
|
892
1222
|
}
|
|
893
1223
|
}
|
|
894
1224
|
});
|
|
895
1225
|
|
|
896
1226
|
// src/commands/list.ts
|
|
897
|
-
import * as
|
|
1227
|
+
import * as p5 from "@clack/prompts";
|
|
898
1228
|
import { defineCommand as defineCommand4 } from "citty";
|
|
899
|
-
import { join as
|
|
900
|
-
import
|
|
1229
|
+
import { join as join6 } from "path";
|
|
1230
|
+
import pc6 from "picocolors";
|
|
901
1231
|
function extractDescription(content, isCommand) {
|
|
902
1232
|
if (isCommand) {
|
|
903
1233
|
const firstLine = content.trim().split("\n")[0];
|
|
@@ -915,7 +1245,7 @@ function extractDescription(content, isCommand) {
|
|
|
915
1245
|
function getItems(dir, extension, isCommand) {
|
|
916
1246
|
const files = listFiles(dir, extension);
|
|
917
1247
|
return files.map((file) => {
|
|
918
|
-
const filePath =
|
|
1248
|
+
const filePath = join6(dir, file);
|
|
919
1249
|
const content = fileExists(filePath) ? readFile(filePath) : "";
|
|
920
1250
|
return {
|
|
921
1251
|
name: file.replace(extension, ""),
|
|
@@ -927,9 +1257,9 @@ function getItems(dir, extension, isCommand) {
|
|
|
927
1257
|
function getSkills(dir) {
|
|
928
1258
|
const skillDirs = listDirs(dir);
|
|
929
1259
|
return skillDirs.map((skillName) => {
|
|
930
|
-
const skillPath =
|
|
931
|
-
const skillFile =
|
|
932
|
-
const altSkillFile =
|
|
1260
|
+
const skillPath = join6(dir, skillName);
|
|
1261
|
+
const skillFile = join6(skillPath, "SKILL.mdc");
|
|
1262
|
+
const altSkillFile = join6(skillPath, "SKILL.md");
|
|
933
1263
|
let description;
|
|
934
1264
|
if (fileExists(skillFile)) {
|
|
935
1265
|
const content = readFile(skillFile);
|
|
@@ -981,7 +1311,7 @@ var listCommand = defineCommand4({
|
|
|
981
1311
|
const shouldListCommands = listAll || args.commands;
|
|
982
1312
|
const shouldListRules = listAll || args.rules;
|
|
983
1313
|
const shouldListSkills = listAll || args.skills;
|
|
984
|
-
|
|
1314
|
+
p5.intro(pc6.bgCyan(pc6.black(" cursor-kit list ")));
|
|
985
1315
|
const commandsDir = getCommandsDir();
|
|
986
1316
|
const rulesDir = getRulesDir();
|
|
987
1317
|
const skillsDir = getSkillsDir();
|
|
@@ -990,75 +1320,75 @@ var listCommand = defineCommand4({
|
|
|
990
1320
|
const skills = shouldListSkills ? getSkills(skillsDir) : [];
|
|
991
1321
|
if (commands.length === 0 && rules.length === 0 && skills.length === 0) {
|
|
992
1322
|
console.log();
|
|
993
|
-
console.log(
|
|
1323
|
+
console.log(pc6.yellow(" No commands, rules, or skills found."));
|
|
994
1324
|
console.log(
|
|
995
|
-
|
|
1325
|
+
pc6.dim(" Run ") + highlight("cursor-kit init") + pc6.dim(" to get started.")
|
|
996
1326
|
);
|
|
997
1327
|
console.log();
|
|
998
|
-
|
|
1328
|
+
p5.outro(pc6.dim("Nothing to show"));
|
|
999
1329
|
return;
|
|
1000
1330
|
}
|
|
1001
1331
|
printDivider();
|
|
1002
1332
|
if (shouldListCommands && commands.length > 0) {
|
|
1003
1333
|
console.log();
|
|
1004
1334
|
console.log(
|
|
1005
|
-
|
|
1335
|
+
pc6.bold(pc6.cyan(" \u{1F4DC} Commands")) + pc6.dim(` (${commands.length})`)
|
|
1006
1336
|
);
|
|
1007
1337
|
console.log();
|
|
1008
1338
|
commands.forEach((cmd) => {
|
|
1009
|
-
console.log(` ${
|
|
1339
|
+
console.log(` ${pc6.green("\u25CF")} ${highlight(cmd.name)}`);
|
|
1010
1340
|
if (cmd.description) {
|
|
1011
|
-
console.log(
|
|
1341
|
+
console.log(pc6.dim(` ${cmd.description}`));
|
|
1012
1342
|
}
|
|
1013
1343
|
if (args.verbose) {
|
|
1014
|
-
console.log(
|
|
1344
|
+
console.log(pc6.dim(` ${cmd.path}`));
|
|
1015
1345
|
}
|
|
1016
1346
|
});
|
|
1017
1347
|
}
|
|
1018
1348
|
if (shouldListRules && rules.length > 0) {
|
|
1019
1349
|
console.log();
|
|
1020
1350
|
console.log(
|
|
1021
|
-
|
|
1351
|
+
pc6.bold(pc6.cyan(" \u{1F4CB} Rules")) + pc6.dim(` (${rules.length})`)
|
|
1022
1352
|
);
|
|
1023
1353
|
console.log();
|
|
1024
1354
|
rules.forEach((rule) => {
|
|
1025
|
-
console.log(` ${
|
|
1355
|
+
console.log(` ${pc6.green("\u25CF")} ${highlight(rule.name)}`);
|
|
1026
1356
|
if (rule.description) {
|
|
1027
|
-
console.log(
|
|
1357
|
+
console.log(pc6.dim(` ${rule.description}`));
|
|
1028
1358
|
}
|
|
1029
1359
|
if (args.verbose) {
|
|
1030
|
-
console.log(
|
|
1360
|
+
console.log(pc6.dim(` ${rule.path}`));
|
|
1031
1361
|
}
|
|
1032
1362
|
});
|
|
1033
1363
|
}
|
|
1034
1364
|
if (shouldListSkills && skills.length > 0) {
|
|
1035
1365
|
console.log();
|
|
1036
1366
|
console.log(
|
|
1037
|
-
|
|
1367
|
+
pc6.bold(pc6.cyan(" \u{1F3AF} Skills")) + pc6.dim(` (${skills.length})`)
|
|
1038
1368
|
);
|
|
1039
1369
|
console.log();
|
|
1040
1370
|
skills.forEach((skill) => {
|
|
1041
|
-
console.log(` ${
|
|
1371
|
+
console.log(` ${pc6.green("\u25CF")} ${highlight(skill.name)}`);
|
|
1042
1372
|
if (skill.description) {
|
|
1043
|
-
console.log(
|
|
1373
|
+
console.log(pc6.dim(` ${skill.description}`));
|
|
1044
1374
|
}
|
|
1045
1375
|
if (args.verbose) {
|
|
1046
|
-
console.log(
|
|
1376
|
+
console.log(pc6.dim(` ${skill.path}`));
|
|
1047
1377
|
}
|
|
1048
1378
|
});
|
|
1049
1379
|
}
|
|
1050
1380
|
console.log();
|
|
1051
1381
|
printDivider();
|
|
1052
1382
|
const total = commands.length + rules.length + skills.length;
|
|
1053
|
-
|
|
1383
|
+
p5.outro(pc6.dim(`Total: ${total} item${total !== 1 ? "s" : ""}`));
|
|
1054
1384
|
}
|
|
1055
1385
|
});
|
|
1056
1386
|
|
|
1057
1387
|
// src/commands/remove.ts
|
|
1058
1388
|
import { defineCommand as defineCommand5 } from "citty";
|
|
1059
|
-
import * as
|
|
1060
|
-
import
|
|
1061
|
-
import { join as
|
|
1389
|
+
import * as p6 from "@clack/prompts";
|
|
1390
|
+
import pc7 from "picocolors";
|
|
1391
|
+
import { join as join7 } from "path";
|
|
1062
1392
|
var removeCommand = defineCommand5({
|
|
1063
1393
|
meta: {
|
|
1064
1394
|
name: "remove",
|
|
@@ -1083,7 +1413,7 @@ var removeCommand = defineCommand5({
|
|
|
1083
1413
|
}
|
|
1084
1414
|
},
|
|
1085
1415
|
async run({ args }) {
|
|
1086
|
-
|
|
1416
|
+
p6.intro(pc7.bgCyan(pc7.black(" cursor-kit remove ")));
|
|
1087
1417
|
const commandsDir = getCommandsDir();
|
|
1088
1418
|
const rulesDir = getRulesDir();
|
|
1089
1419
|
const skillsDir = getSkillsDir();
|
|
@@ -1092,9 +1422,9 @@ var removeCommand = defineCommand5({
|
|
|
1092
1422
|
const skills = listDirs(skillsDir);
|
|
1093
1423
|
if (commands.length === 0 && rules.length === 0 && skills.length === 0) {
|
|
1094
1424
|
console.log();
|
|
1095
|
-
console.log(
|
|
1425
|
+
console.log(pc7.yellow(" No commands, rules, or skills to remove."));
|
|
1096
1426
|
console.log();
|
|
1097
|
-
|
|
1427
|
+
p6.outro(pc7.dim("Nothing to do"));
|
|
1098
1428
|
return;
|
|
1099
1429
|
}
|
|
1100
1430
|
let itemType;
|
|
@@ -1124,12 +1454,12 @@ var removeCommand = defineCommand5({
|
|
|
1124
1454
|
hint: `${skills.length} available`
|
|
1125
1455
|
});
|
|
1126
1456
|
}
|
|
1127
|
-
const typeResult = await
|
|
1457
|
+
const typeResult = await p6.select({
|
|
1128
1458
|
message: "What do you want to remove?",
|
|
1129
1459
|
options: typeOptions
|
|
1130
1460
|
});
|
|
1131
|
-
if (
|
|
1132
|
-
|
|
1461
|
+
if (p6.isCancel(typeResult)) {
|
|
1462
|
+
p6.cancel("Operation cancelled");
|
|
1133
1463
|
process.exit(0);
|
|
1134
1464
|
}
|
|
1135
1465
|
itemType = typeResult;
|
|
@@ -1141,7 +1471,7 @@ var removeCommand = defineCommand5({
|
|
|
1141
1471
|
const dir = isCommand ? commandsDir : isRule ? rulesDir : skillsDir;
|
|
1142
1472
|
const extension = isCommand ? ".md" : isRule ? ".mdc" : "";
|
|
1143
1473
|
if (items.length === 0) {
|
|
1144
|
-
|
|
1474
|
+
p6.cancel(`No ${itemType}s found`);
|
|
1145
1475
|
process.exit(0);
|
|
1146
1476
|
}
|
|
1147
1477
|
if (args.name && items.includes(args.name)) {
|
|
@@ -1151,30 +1481,30 @@ var removeCommand = defineCommand5({
|
|
|
1151
1481
|
value: item,
|
|
1152
1482
|
label: item
|
|
1153
1483
|
}));
|
|
1154
|
-
const nameResult = await
|
|
1484
|
+
const nameResult = await p6.select({
|
|
1155
1485
|
message: `Select ${itemType} to remove:`,
|
|
1156
1486
|
options: itemOptions
|
|
1157
1487
|
});
|
|
1158
|
-
if (
|
|
1159
|
-
|
|
1488
|
+
if (p6.isCancel(nameResult)) {
|
|
1489
|
+
p6.cancel("Operation cancelled");
|
|
1160
1490
|
process.exit(0);
|
|
1161
1491
|
}
|
|
1162
1492
|
itemName = nameResult;
|
|
1163
1493
|
}
|
|
1164
|
-
const targetPath = isSkill ?
|
|
1494
|
+
const targetPath = isSkill ? join7(dir, itemName) : join7(dir, `${itemName}${extension}`);
|
|
1165
1495
|
const exists = isSkill ? dirExists(targetPath) : fileExists(targetPath);
|
|
1166
1496
|
if (!exists) {
|
|
1167
|
-
|
|
1497
|
+
p6.cancel(`${itemType} '${itemName}' not found`);
|
|
1168
1498
|
process.exit(1);
|
|
1169
1499
|
}
|
|
1170
1500
|
if (!args.force) {
|
|
1171
1501
|
const displayName = isSkill ? itemName : itemName + extension;
|
|
1172
|
-
const shouldDelete = await
|
|
1502
|
+
const shouldDelete = await p6.confirm({
|
|
1173
1503
|
message: `Are you sure you want to delete ${highlight(displayName)}?${isSkill ? " (This will remove the entire skill directory)" : ""}`,
|
|
1174
1504
|
initialValue: false
|
|
1175
1505
|
});
|
|
1176
|
-
if (
|
|
1177
|
-
|
|
1506
|
+
if (p6.isCancel(shouldDelete) || !shouldDelete) {
|
|
1507
|
+
p6.cancel("Operation cancelled");
|
|
1178
1508
|
process.exit(0);
|
|
1179
1509
|
}
|
|
1180
1510
|
}
|
|
@@ -1184,9 +1514,9 @@ var removeCommand = defineCommand5({
|
|
|
1184
1514
|
console.log();
|
|
1185
1515
|
printSuccess(`Removed ${highlight(displayName)}`);
|
|
1186
1516
|
console.log();
|
|
1187
|
-
|
|
1517
|
+
p6.outro(pc7.green("\u2728 Done!"));
|
|
1188
1518
|
} catch (error) {
|
|
1189
|
-
|
|
1519
|
+
p6.cancel(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1190
1520
|
process.exit(1);
|
|
1191
1521
|
}
|
|
1192
1522
|
}
|
|
@@ -1194,17 +1524,17 @@ var removeCommand = defineCommand5({
|
|
|
1194
1524
|
|
|
1195
1525
|
// src/commands/instance.ts
|
|
1196
1526
|
import { defineCommand as defineCommand6 } from "citty";
|
|
1197
|
-
import * as
|
|
1198
|
-
import
|
|
1527
|
+
import * as p7 from "@clack/prompts";
|
|
1528
|
+
import pc8 from "picocolors";
|
|
1199
1529
|
import { spawn } from "child_process";
|
|
1200
|
-
import { join as
|
|
1530
|
+
import { join as join8, dirname as dirname3 } from "path";
|
|
1201
1531
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1202
1532
|
import { existsSync as existsSync2, chmodSync, readdirSync as readdirSync2 } from "fs";
|
|
1203
1533
|
function getBinPath() {
|
|
1204
1534
|
const currentDir = dirname3(fileURLToPath2(import.meta.url));
|
|
1205
1535
|
const possiblePaths = [
|
|
1206
|
-
|
|
1207
|
-
|
|
1536
|
+
join8(currentDir, "..", "..", "bin"),
|
|
1537
|
+
join8(currentDir, "..", "bin")
|
|
1208
1538
|
];
|
|
1209
1539
|
for (const binPath of possiblePaths) {
|
|
1210
1540
|
if (existsSync2(binPath)) {
|
|
@@ -1220,13 +1550,13 @@ function ensureExecutable(scriptPath) {
|
|
|
1220
1550
|
}
|
|
1221
1551
|
}
|
|
1222
1552
|
function getExistingInstances() {
|
|
1223
|
-
const userAppsDir =
|
|
1553
|
+
const userAppsDir = join8(process.env.HOME ?? "", "Applications");
|
|
1224
1554
|
if (!existsSync2(userAppsDir)) return [];
|
|
1225
1555
|
try {
|
|
1226
1556
|
const apps = readdirSync2(userAppsDir);
|
|
1227
1557
|
return apps.filter((app) => app.startsWith("Cursor") && app.endsWith(".app") && app !== "Cursor.app").map((app) => ({
|
|
1228
1558
|
name: app.replace(".app", ""),
|
|
1229
|
-
path:
|
|
1559
|
+
path: join8(userAppsDir, app)
|
|
1230
1560
|
}));
|
|
1231
1561
|
} catch {
|
|
1232
1562
|
return [];
|
|
@@ -1270,13 +1600,13 @@ var instanceCommand = defineCommand6({
|
|
|
1270
1600
|
}
|
|
1271
1601
|
},
|
|
1272
1602
|
async run({ args }) {
|
|
1273
|
-
|
|
1603
|
+
p7.intro(pc8.bgCyan(pc8.black(" cursor-kit instance ")));
|
|
1274
1604
|
if (process.platform !== "darwin") {
|
|
1275
1605
|
console.log();
|
|
1276
1606
|
printWarning("This command only works on macOS.");
|
|
1277
|
-
console.log(
|
|
1607
|
+
console.log(pc8.dim(" Cursor instance management requires macOS-specific features."));
|
|
1278
1608
|
console.log();
|
|
1279
|
-
|
|
1609
|
+
p7.outro(pc8.dim("Exiting"));
|
|
1280
1610
|
process.exit(1);
|
|
1281
1611
|
}
|
|
1282
1612
|
if (args.list) {
|
|
@@ -1285,34 +1615,34 @@ var instanceCommand = defineCommand6({
|
|
|
1285
1615
|
console.log();
|
|
1286
1616
|
if (instances.length === 0) {
|
|
1287
1617
|
printInfo("No custom Cursor instances found.");
|
|
1288
|
-
console.log(
|
|
1618
|
+
console.log(pc8.dim(" Run ") + highlight("cursor-kit instance") + pc8.dim(" to create one."));
|
|
1289
1619
|
} else {
|
|
1290
|
-
console.log(
|
|
1620
|
+
console.log(pc8.bold(pc8.cyan(" \u{1F5A5} Cursor Instances")) + pc8.dim(` (${instances.length})`));
|
|
1291
1621
|
console.log();
|
|
1292
1622
|
for (const instance of instances) {
|
|
1293
|
-
console.log(` ${
|
|
1294
|
-
console.log(
|
|
1623
|
+
console.log(` ${pc8.green("\u25CF")} ${highlight(instance.name)}`);
|
|
1624
|
+
console.log(pc8.dim(` \u2514\u2500 ${instance.path}`));
|
|
1295
1625
|
}
|
|
1296
1626
|
}
|
|
1297
1627
|
console.log();
|
|
1298
1628
|
printDivider();
|
|
1299
|
-
|
|
1629
|
+
p7.outro(pc8.dim(`Total: ${instances.length} instance${instances.length !== 1 ? "s" : ""}`));
|
|
1300
1630
|
return;
|
|
1301
1631
|
}
|
|
1302
|
-
const s =
|
|
1632
|
+
const s = p7.spinner();
|
|
1303
1633
|
s.start("Checking prerequisites...");
|
|
1304
1634
|
const binPath = getBinPath();
|
|
1305
|
-
const createScript =
|
|
1306
|
-
const removeScript =
|
|
1307
|
-
const reinstallScript =
|
|
1635
|
+
const createScript = join8(binPath, "cursor-new-instance");
|
|
1636
|
+
const removeScript = join8(binPath, "cursor-remove-instance");
|
|
1637
|
+
const reinstallScript = join8(binPath, "cursor-reinstall-instance.sh");
|
|
1308
1638
|
const scriptsExist = existsSync2(createScript) && existsSync2(removeScript) && existsSync2(reinstallScript);
|
|
1309
1639
|
if (!scriptsExist) {
|
|
1310
1640
|
s.stop("Prerequisites check failed");
|
|
1311
1641
|
console.log();
|
|
1312
1642
|
printWarning("Required scripts not found.");
|
|
1313
|
-
console.log(
|
|
1643
|
+
console.log(pc8.dim(` Expected at: ${binPath}`));
|
|
1314
1644
|
console.log();
|
|
1315
|
-
|
|
1645
|
+
p7.outro(pc8.red("Installation may be corrupted"));
|
|
1316
1646
|
process.exit(1);
|
|
1317
1647
|
}
|
|
1318
1648
|
const originalCursor = "/Applications/Cursor.app";
|
|
@@ -1320,9 +1650,9 @@ var instanceCommand = defineCommand6({
|
|
|
1320
1650
|
s.stop("Prerequisites check failed");
|
|
1321
1651
|
console.log();
|
|
1322
1652
|
printWarning("Cursor.app not found in /Applications");
|
|
1323
|
-
console.log(
|
|
1653
|
+
console.log(pc8.dim(" Please install Cursor IDE first."));
|
|
1324
1654
|
console.log();
|
|
1325
|
-
|
|
1655
|
+
p7.outro(pc8.red("Cursor IDE required"));
|
|
1326
1656
|
process.exit(1);
|
|
1327
1657
|
}
|
|
1328
1658
|
s.stop("Prerequisites verified");
|
|
@@ -1332,7 +1662,7 @@ var instanceCommand = defineCommand6({
|
|
|
1332
1662
|
if (args.action && ["create", "remove", "reinstall"].includes(args.action)) {
|
|
1333
1663
|
action = args.action;
|
|
1334
1664
|
} else {
|
|
1335
|
-
const actionResult = await
|
|
1665
|
+
const actionResult = await p7.select({
|
|
1336
1666
|
message: "What would you like to do?",
|
|
1337
1667
|
options: [
|
|
1338
1668
|
{
|
|
@@ -1352,8 +1682,8 @@ var instanceCommand = defineCommand6({
|
|
|
1352
1682
|
}
|
|
1353
1683
|
]
|
|
1354
1684
|
});
|
|
1355
|
-
if (
|
|
1356
|
-
|
|
1685
|
+
if (p7.isCancel(actionResult)) {
|
|
1686
|
+
p7.cancel("Operation cancelled");
|
|
1357
1687
|
process.exit(0);
|
|
1358
1688
|
}
|
|
1359
1689
|
action = actionResult;
|
|
@@ -1362,7 +1692,7 @@ var instanceCommand = defineCommand6({
|
|
|
1362
1692
|
instanceName = args.name;
|
|
1363
1693
|
} else if ((action === "remove" || action === "reinstall") && existingInstances.length > 0) {
|
|
1364
1694
|
const actionLabel2 = action === "remove" ? "remove" : "reinstall";
|
|
1365
|
-
const instanceResult = await
|
|
1695
|
+
const instanceResult = await p7.select({
|
|
1366
1696
|
message: `Select instance to ${actionLabel2}:`,
|
|
1367
1697
|
options: existingInstances.map((inst) => ({
|
|
1368
1698
|
value: inst.name,
|
|
@@ -1370,8 +1700,8 @@ var instanceCommand = defineCommand6({
|
|
|
1370
1700
|
hint: inst.path
|
|
1371
1701
|
}))
|
|
1372
1702
|
});
|
|
1373
|
-
if (
|
|
1374
|
-
|
|
1703
|
+
if (p7.isCancel(instanceResult)) {
|
|
1704
|
+
p7.cancel("Operation cancelled");
|
|
1375
1705
|
process.exit(0);
|
|
1376
1706
|
}
|
|
1377
1707
|
instanceName = instanceResult;
|
|
@@ -1379,10 +1709,10 @@ var instanceCommand = defineCommand6({
|
|
|
1379
1709
|
console.log();
|
|
1380
1710
|
printInfo(`No custom Cursor instances found to ${action}.`);
|
|
1381
1711
|
console.log();
|
|
1382
|
-
|
|
1712
|
+
p7.outro(pc8.dim("Nothing to do"));
|
|
1383
1713
|
return;
|
|
1384
1714
|
} else {
|
|
1385
|
-
const nameResult = await
|
|
1715
|
+
const nameResult = await p7.text({
|
|
1386
1716
|
message: "Enter a name for the new instance:",
|
|
1387
1717
|
placeholder: "Cursor Enterprise",
|
|
1388
1718
|
validate: (value) => {
|
|
@@ -1395,41 +1725,41 @@ var instanceCommand = defineCommand6({
|
|
|
1395
1725
|
return void 0;
|
|
1396
1726
|
}
|
|
1397
1727
|
});
|
|
1398
|
-
if (
|
|
1399
|
-
|
|
1728
|
+
if (p7.isCancel(nameResult)) {
|
|
1729
|
+
p7.cancel("Operation cancelled");
|
|
1400
1730
|
process.exit(0);
|
|
1401
1731
|
}
|
|
1402
1732
|
instanceName = nameResult;
|
|
1403
1733
|
}
|
|
1404
1734
|
printDivider();
|
|
1405
1735
|
console.log();
|
|
1406
|
-
console.log(
|
|
1736
|
+
console.log(pc8.bold(pc8.cyan(" \u{1F4CB} Summary")));
|
|
1407
1737
|
console.log();
|
|
1408
|
-
const actionColor = action === "create" ?
|
|
1738
|
+
const actionColor = action === "create" ? pc8.green : action === "reinstall" ? pc8.blue : pc8.yellow;
|
|
1409
1739
|
const actionLabel = action === "create" ? "Create" : action === "reinstall" ? "Reinstall" : "Remove";
|
|
1410
|
-
console.log(` ${
|
|
1411
|
-
console.log(` ${
|
|
1740
|
+
console.log(` ${pc8.dim("Action:")} ${actionColor(actionLabel)}`);
|
|
1741
|
+
console.log(` ${pc8.dim("Instance:")} ${highlight(instanceName)}`);
|
|
1412
1742
|
if (action === "create" || action === "reinstall") {
|
|
1413
1743
|
const slug = instanceName.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
1414
|
-
console.log(` ${
|
|
1415
|
-
console.log(` ${
|
|
1744
|
+
console.log(` ${pc8.dim("Bundle ID:")} ${pc8.dim("com.cursor.")}${highlight(slug)}`);
|
|
1745
|
+
console.log(` ${pc8.dim("Location:")} ${pc8.dim("~/Applications/")}${highlight(instanceName + ".app")}`);
|
|
1416
1746
|
if (action === "reinstall") {
|
|
1417
|
-
const dataDir =
|
|
1418
|
-
console.log(` ${
|
|
1747
|
+
const dataDir = join8(process.env.HOME ?? "", "Library", "Application Support", instanceName.replace(/ /g, ""));
|
|
1748
|
+
console.log(` ${pc8.dim("Data:")} ${pc8.green("\u2713")} ${pc8.dim("Preserved at")} ${pc8.dim(dataDir)}`);
|
|
1419
1749
|
}
|
|
1420
1750
|
} else {
|
|
1421
|
-
const targetPath =
|
|
1422
|
-
console.log(` ${
|
|
1751
|
+
const targetPath = join8(process.env.HOME ?? "", "Applications", `${instanceName}.app`);
|
|
1752
|
+
console.log(` ${pc8.dim("Path:")} ${pc8.dim(targetPath)}`);
|
|
1423
1753
|
}
|
|
1424
1754
|
console.log();
|
|
1425
1755
|
printDivider();
|
|
1426
1756
|
console.log();
|
|
1427
|
-
const shouldContinue = await
|
|
1757
|
+
const shouldContinue = await p7.confirm({
|
|
1428
1758
|
message: action === "create" ? "Create this Cursor instance?" : action === "reinstall" ? "Reinstall this instance? (User data will be preserved)" : "Remove this Cursor instance? This cannot be undone.",
|
|
1429
1759
|
initialValue: action !== "remove"
|
|
1430
1760
|
});
|
|
1431
|
-
if (
|
|
1432
|
-
|
|
1761
|
+
if (p7.isCancel(shouldContinue) || !shouldContinue) {
|
|
1762
|
+
p7.cancel("Operation cancelled");
|
|
1433
1763
|
process.exit(0);
|
|
1434
1764
|
}
|
|
1435
1765
|
console.log();
|
|
@@ -1445,26 +1775,26 @@ var instanceCommand = defineCommand6({
|
|
|
1445
1775
|
if (action === "create") {
|
|
1446
1776
|
printSuccess(`Instance ${highlight(instanceName)} created successfully!`);
|
|
1447
1777
|
console.log();
|
|
1448
|
-
console.log(
|
|
1449
|
-
console.log(
|
|
1450
|
-
console.log(
|
|
1451
|
-
console.log(
|
|
1778
|
+
console.log(pc8.dim(" Next steps:"));
|
|
1779
|
+
console.log(pc8.dim(" \u2022 The new instance should launch automatically"));
|
|
1780
|
+
console.log(pc8.dim(" \u2022 Sign in with a different Cursor account"));
|
|
1781
|
+
console.log(pc8.dim(" \u2022 Find it in ~/Applications/"));
|
|
1452
1782
|
} else if (action === "reinstall") {
|
|
1453
1783
|
printSuccess(`Instance ${highlight(instanceName)} reinstalled successfully!`);
|
|
1454
1784
|
console.log();
|
|
1455
|
-
console.log(
|
|
1456
|
-
console.log(
|
|
1457
|
-
console.log(
|
|
1458
|
-
console.log(
|
|
1785
|
+
console.log(pc8.dim(" The instance has been:"));
|
|
1786
|
+
console.log(pc8.dim(" \u2022 Refreshed with the latest Cursor version"));
|
|
1787
|
+
console.log(pc8.dim(" \u2022 Relaunched with your preserved data"));
|
|
1788
|
+
console.log(pc8.dim(" \u2022 Ready to use with your existing account"));
|
|
1459
1789
|
} else {
|
|
1460
1790
|
printSuccess(`Instance ${highlight(instanceName)} removed successfully!`);
|
|
1461
1791
|
}
|
|
1462
1792
|
console.log();
|
|
1463
|
-
|
|
1793
|
+
p7.outro(pc8.green("\u2728 Done!"));
|
|
1464
1794
|
} else {
|
|
1465
1795
|
printWarning(`Operation completed with exit code ${exitCode}`);
|
|
1466
1796
|
console.log();
|
|
1467
|
-
|
|
1797
|
+
p7.outro(pc8.yellow("Check the output above for details"));
|
|
1468
1798
|
process.exit(exitCode);
|
|
1469
1799
|
}
|
|
1470
1800
|
}
|