cursor-kit-cli 1.0.3

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.js ADDED
@@ -0,0 +1,686 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/cli.ts
4
+ import { defineCommand as defineCommand6, runMain } from "citty";
5
+
6
+ // src/utils/branding.ts
7
+ import figlet from "figlet";
8
+ import gradient from "gradient-string";
9
+ import pc from "picocolors";
10
+ var cursorGradient = gradient(["#00DC82", "#36E4DA", "#0047E1"]);
11
+ function printBanner() {
12
+ const banner = figlet.textSync("Cursor Kit", {
13
+ font: "ANSI Shadow",
14
+ horizontalLayout: "fitted"
15
+ });
16
+ console.log(cursorGradient.multiline(banner));
17
+ console.log();
18
+ console.log(
19
+ pc.dim(" ") + pc.bold(pc.cyan("\u2726")) + pc.dim(" Supercharge your Cursor IDE with rules & commands")
20
+ );
21
+ console.log();
22
+ }
23
+ function printSuccess(message) {
24
+ console.log(pc.green("\u2713") + pc.dim(" ") + message);
25
+ }
26
+ function printInfo(message) {
27
+ console.log(pc.cyan("\u2139") + pc.dim(" ") + message);
28
+ }
29
+ function printDivider() {
30
+ console.log(pc.dim("\u2500".repeat(50)));
31
+ }
32
+ function printVersion(version) {
33
+ console.log(
34
+ pc.dim(" v") + cursorGradient(version) + pc.dim(" \u2022 Made with \u2665")
35
+ );
36
+ console.log();
37
+ }
38
+ function highlight(text2) {
39
+ return pc.cyan(text2);
40
+ }
41
+
42
+ // src/commands/init.ts
43
+ import { defineCommand } from "citty";
44
+ import * as p from "@clack/prompts";
45
+ import pc2 from "picocolors";
46
+ import { downloadTemplate } from "giget";
47
+
48
+ // src/utils/fs.ts
49
+ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, rmSync, statSync } from "fs";
50
+ import { dirname, join, resolve } from "path";
51
+ function ensureDir(path) {
52
+ if (!existsSync(path)) {
53
+ mkdirSync(path, { recursive: true });
54
+ }
55
+ }
56
+ function fileExists(path) {
57
+ return existsSync(path);
58
+ }
59
+ function dirExists(path) {
60
+ return existsSync(path) && statSync(path).isDirectory();
61
+ }
62
+ function readFile(path) {
63
+ return readFileSync(path, "utf-8");
64
+ }
65
+ function writeFile(path, content) {
66
+ ensureDir(dirname(path));
67
+ writeFileSync(path, content, "utf-8");
68
+ }
69
+ function removeFile(path) {
70
+ if (existsSync(path)) {
71
+ rmSync(path, { recursive: true });
72
+ }
73
+ }
74
+ function listFiles(dir, extension) {
75
+ if (!dirExists(dir)) return [];
76
+ const files = readdirSync(dir);
77
+ if (extension) {
78
+ return files.filter((f) => f.endsWith(extension));
79
+ }
80
+ return files;
81
+ }
82
+ function getCursorDir(cwd = process.cwd()) {
83
+ return join(cwd, ".cursor");
84
+ }
85
+ function getCommandsDir(cwd = process.cwd()) {
86
+ return join(getCursorDir(cwd), "commands");
87
+ }
88
+ function getRulesDir(cwd = process.cwd()) {
89
+ return join(getCursorDir(cwd), "rules");
90
+ }
91
+
92
+ // src/utils/constants.ts
93
+ var REPO_URL = "github:duongductrong/cursor-kit";
94
+ var REPO_REF = "master";
95
+
96
+ // src/commands/init.ts
97
+ var initCommand = defineCommand({
98
+ meta: {
99
+ name: "init",
100
+ description: "Initialize .cursor/commands and .cursor/rules in your project"
101
+ },
102
+ args: {
103
+ force: {
104
+ type: "boolean",
105
+ alias: "f",
106
+ description: "Overwrite existing files",
107
+ default: false
108
+ },
109
+ commands: {
110
+ type: "boolean",
111
+ alias: "c",
112
+ description: "Only initialize commands",
113
+ default: false
114
+ },
115
+ rules: {
116
+ type: "boolean",
117
+ alias: "r",
118
+ description: "Only initialize rules",
119
+ default: false
120
+ }
121
+ },
122
+ async run({ args }) {
123
+ const cwd = process.cwd();
124
+ const cursorDir = getCursorDir(cwd);
125
+ const commandsDir = getCommandsDir(cwd);
126
+ const rulesDir = getRulesDir(cwd);
127
+ const initBoth = !args.commands && !args.rules;
128
+ const shouldInitCommands = initBoth || args.commands;
129
+ const shouldInitRules = initBoth || args.rules;
130
+ p.intro(pc2.bgCyan(pc2.black(" cursor-kit init ")));
131
+ const commandsExist = dirExists(commandsDir) && listFiles(commandsDir).length > 0;
132
+ const rulesExist = dirExists(rulesDir) && listFiles(rulesDir).length > 0;
133
+ if ((commandsExist || rulesExist) && !args.force) {
134
+ const existingItems = [];
135
+ if (commandsExist) existingItems.push("commands");
136
+ if (rulesExist) existingItems.push("rules");
137
+ const shouldContinue = await p.confirm({
138
+ message: `Existing ${existingItems.join(" and ")} found. Overwrite?`,
139
+ initialValue: false
140
+ });
141
+ if (p.isCancel(shouldContinue) || !shouldContinue) {
142
+ p.cancel("Operation cancelled");
143
+ process.exit(0);
144
+ }
145
+ }
146
+ const s = p.spinner();
147
+ try {
148
+ ensureDir(cursorDir);
149
+ if (shouldInitCommands) {
150
+ s.start("Fetching commands templates...");
151
+ await downloadTemplate(`${REPO_URL}/templates/commands#${REPO_REF}`, {
152
+ dir: commandsDir,
153
+ force: true
154
+ });
155
+ s.stop("Commands initialized");
156
+ }
157
+ if (shouldInitRules) {
158
+ s.start("Fetching rules templates...");
159
+ await downloadTemplate(`${REPO_URL}/templates/rules#${REPO_REF}`, {
160
+ dir: rulesDir,
161
+ force: true
162
+ });
163
+ s.stop("Rules initialized");
164
+ }
165
+ printDivider();
166
+ console.log();
167
+ const commandFiles = listFiles(commandsDir, ".md");
168
+ const ruleFiles = listFiles(rulesDir, ".mdc");
169
+ if (shouldInitCommands && commandFiles.length > 0) {
170
+ printSuccess(
171
+ `Commands: ${highlight(commandFiles.length.toString())} templates`
172
+ );
173
+ commandFiles.forEach((f) => {
174
+ console.log(pc2.dim(` \u2514\u2500 ${f}`));
175
+ });
176
+ }
177
+ if (shouldInitRules && ruleFiles.length > 0) {
178
+ printSuccess(
179
+ `Rules: ${highlight(ruleFiles.length.toString())} templates`
180
+ );
181
+ ruleFiles.forEach((f) => {
182
+ console.log(pc2.dim(` \u2514\u2500 ${f}`));
183
+ });
184
+ }
185
+ console.log();
186
+ p.outro(pc2.green("\u2728 Cursor Kit initialized successfully!"));
187
+ } catch (error) {
188
+ s.stop("Failed");
189
+ p.cancel(
190
+ `Error: ${error instanceof Error ? error.message : "Unknown error"}`
191
+ );
192
+ process.exit(1);
193
+ }
194
+ }
195
+ });
196
+
197
+ // src/commands/add.ts
198
+ import { defineCommand as defineCommand2 } from "citty";
199
+ import * as p2 from "@clack/prompts";
200
+ import pc3 from "picocolors";
201
+ import { join as join2 } from "path";
202
+ var COMMAND_TEMPLATE = `You are a helpful assistant. Describe what this command does.
203
+
204
+ ## Instructions
205
+ - Step 1: ...
206
+ - Step 2: ...
207
+
208
+ ## Rules
209
+ - Be concise
210
+ - Focus on the task
211
+
212
+ START: Wait for user input.
213
+ `;
214
+ var RULE_TEMPLATE = `---
215
+ description: Describe when this rule should apply
216
+ globs:
217
+ alwaysApply: false
218
+ ---
219
+
220
+ # Rule Title
221
+
222
+ Describe the rule behavior here.
223
+
224
+ ## Guidelines
225
+ - Guideline 1
226
+ - Guideline 2
227
+ `;
228
+ function generateSlug(name) {
229
+ return name.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").trim();
230
+ }
231
+ var addCommand = defineCommand2({
232
+ meta: {
233
+ name: "add",
234
+ description: "Add a new command or rule"
235
+ },
236
+ args: {
237
+ type: {
238
+ type: "string",
239
+ alias: "t",
240
+ description: "Type: 'command' or 'rule'"
241
+ },
242
+ name: {
243
+ type: "string",
244
+ alias: "n",
245
+ description: "Name of the command or rule"
246
+ }
247
+ },
248
+ async run({ args }) {
249
+ p2.intro(pc3.bgCyan(pc3.black(" cursor-kit add ")));
250
+ let itemType;
251
+ let itemName;
252
+ if (args.type && ["command", "rule"].includes(args.type)) {
253
+ itemType = args.type;
254
+ } else {
255
+ const typeResult = await p2.select({
256
+ message: "What do you want to add?",
257
+ options: [
258
+ {
259
+ value: "command",
260
+ label: "Command",
261
+ hint: "A reusable prompt template"
262
+ },
263
+ {
264
+ value: "rule",
265
+ label: "Rule",
266
+ hint: "Project-specific AI behavior rules"
267
+ }
268
+ ]
269
+ });
270
+ if (p2.isCancel(typeResult)) {
271
+ p2.cancel("Operation cancelled");
272
+ process.exit(0);
273
+ }
274
+ itemType = typeResult;
275
+ }
276
+ if (args.name) {
277
+ itemName = args.name;
278
+ } else {
279
+ const nameResult = await p2.text({
280
+ message: `Enter ${itemType} name:`,
281
+ placeholder: itemType === "command" ? "my-command" : "my-rule",
282
+ validate: (value) => {
283
+ if (!value.trim()) return "Name is required";
284
+ if (value.length < 2) return "Name must be at least 2 characters";
285
+ return void 0;
286
+ }
287
+ });
288
+ if (p2.isCancel(nameResult)) {
289
+ p2.cancel("Operation cancelled");
290
+ process.exit(0);
291
+ }
292
+ itemName = nameResult;
293
+ }
294
+ const slug = generateSlug(itemName);
295
+ const isCommand = itemType === "command";
296
+ const targetDir = isCommand ? getCommandsDir() : getRulesDir();
297
+ const extension = isCommand ? ".md" : ".mdc";
298
+ const filePath = join2(targetDir, `${slug}${extension}`);
299
+ if (fileExists(filePath)) {
300
+ const shouldOverwrite = await p2.confirm({
301
+ message: `${highlight(slug + extension)} already exists. Overwrite?`,
302
+ initialValue: false
303
+ });
304
+ if (p2.isCancel(shouldOverwrite) || !shouldOverwrite) {
305
+ p2.cancel("Operation cancelled");
306
+ process.exit(0);
307
+ }
308
+ }
309
+ const s = p2.spinner();
310
+ s.start(`Creating ${itemType}...`);
311
+ try {
312
+ ensureDir(targetDir);
313
+ const template = isCommand ? COMMAND_TEMPLATE : RULE_TEMPLATE;
314
+ writeFile(filePath, template);
315
+ s.stop(`${itemType.charAt(0).toUpperCase() + itemType.slice(1)} created`);
316
+ console.log();
317
+ console.log(pc3.dim(" File: ") + highlight(filePath));
318
+ console.log();
319
+ p2.outro(
320
+ pc3.green(`\u2728 ${itemType.charAt(0).toUpperCase() + itemType.slice(1)} created! Edit the file to customize it.`)
321
+ );
322
+ } catch (error) {
323
+ s.stop("Failed");
324
+ p2.cancel(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
325
+ process.exit(1);
326
+ }
327
+ }
328
+ });
329
+
330
+ // src/commands/pull.ts
331
+ import { defineCommand as defineCommand3 } from "citty";
332
+ import * as p3 from "@clack/prompts";
333
+ import pc4 from "picocolors";
334
+ import { downloadTemplate as downloadTemplate2 } from "giget";
335
+ var pullCommand = defineCommand3({
336
+ meta: {
337
+ name: "pull",
338
+ description: "Pull latest updates from cursor-kit repository"
339
+ },
340
+ args: {
341
+ commands: {
342
+ type: "boolean",
343
+ alias: "c",
344
+ description: "Only pull commands",
345
+ default: false
346
+ },
347
+ rules: {
348
+ type: "boolean",
349
+ alias: "r",
350
+ description: "Only pull rules",
351
+ default: false
352
+ },
353
+ force: {
354
+ type: "boolean",
355
+ alias: "f",
356
+ description: "Force overwrite without confirmation",
357
+ default: false
358
+ }
359
+ },
360
+ async run({ args }) {
361
+ const pullBoth = !args.commands && !args.rules;
362
+ const shouldPullCommands = pullBoth || args.commands;
363
+ const shouldPullRules = pullBoth || args.rules;
364
+ p3.intro(pc4.bgCyan(pc4.black(" cursor-kit pull ")));
365
+ const commandsDir = getCommandsDir();
366
+ const rulesDir = getRulesDir();
367
+ const existingCommands = listFiles(commandsDir, ".md");
368
+ const existingRules = listFiles(rulesDir, ".mdc");
369
+ const hasExisting = existingCommands.length > 0 || existingRules.length > 0;
370
+ if (hasExisting && !args.force) {
371
+ printInfo("Current status:");
372
+ if (existingCommands.length > 0) {
373
+ console.log(pc4.dim(` Commands: ${existingCommands.length} files`));
374
+ }
375
+ if (existingRules.length > 0) {
376
+ console.log(pc4.dim(` Rules: ${existingRules.length} files`));
377
+ }
378
+ console.log();
379
+ const shouldContinue = await p3.confirm({
380
+ message: "This will merge with existing files. Continue?",
381
+ initialValue: true
382
+ });
383
+ if (p3.isCancel(shouldContinue) || !shouldContinue) {
384
+ p3.cancel("Operation cancelled");
385
+ process.exit(0);
386
+ }
387
+ }
388
+ const s = p3.spinner();
389
+ try {
390
+ ensureDir(getCursorDir());
391
+ if (shouldPullCommands) {
392
+ s.start("Pulling commands...");
393
+ await downloadTemplate2(`${REPO_URL}/templates/commands#${REPO_REF}`, {
394
+ dir: commandsDir,
395
+ force: true
396
+ });
397
+ s.stop("Commands updated");
398
+ }
399
+ if (shouldPullRules) {
400
+ s.start("Pulling rules...");
401
+ await downloadTemplate2(`${REPO_URL}/templates/rules#${REPO_REF}`, {
402
+ dir: rulesDir,
403
+ force: true
404
+ });
405
+ s.stop("Rules updated");
406
+ }
407
+ printDivider();
408
+ console.log();
409
+ const newCommands = listFiles(commandsDir, ".md");
410
+ const newRules = listFiles(rulesDir, ".mdc");
411
+ if (shouldPullCommands) {
412
+ const added = newCommands.length - existingCommands.length;
413
+ printSuccess(
414
+ `Commands: ${highlight(newCommands.length.toString())} total` + (added > 0 ? pc4.green(` (+${added} new)`) : "")
415
+ );
416
+ }
417
+ if (shouldPullRules) {
418
+ const added = newRules.length - existingRules.length;
419
+ printSuccess(
420
+ `Rules: ${highlight(newRules.length.toString())} total` + (added > 0 ? pc4.green(` (+${added} new)`) : "")
421
+ );
422
+ }
423
+ console.log();
424
+ p3.outro(pc4.green("\u2728 Successfully pulled latest updates!"));
425
+ } catch (error) {
426
+ s.stop("Failed");
427
+ p3.cancel(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
428
+ process.exit(1);
429
+ }
430
+ }
431
+ });
432
+
433
+ // src/commands/list.ts
434
+ import { defineCommand as defineCommand4 } from "citty";
435
+ import * as p4 from "@clack/prompts";
436
+ import pc5 from "picocolors";
437
+ import { join as join3 } from "path";
438
+ function extractDescription(content, isCommand) {
439
+ if (isCommand) {
440
+ const firstLine = content.trim().split("\n")[0];
441
+ if (firstLine && !firstLine.startsWith("#") && !firstLine.startsWith("---")) {
442
+ return firstLine.slice(0, 60) + (firstLine.length > 60 ? "..." : "");
443
+ }
444
+ } else {
445
+ const match = content.match(/description:\s*(.+)/);
446
+ if (match) {
447
+ return match[1].trim().slice(0, 60) + (match[1].length > 60 ? "..." : "");
448
+ }
449
+ }
450
+ return void 0;
451
+ }
452
+ function getItems(dir, extension, isCommand) {
453
+ const files = listFiles(dir, extension);
454
+ return files.map((file) => {
455
+ const filePath = join3(dir, file);
456
+ const content = fileExists(filePath) ? readFile(filePath) : "";
457
+ return {
458
+ name: file.replace(extension, ""),
459
+ path: filePath,
460
+ description: extractDescription(content, isCommand)
461
+ };
462
+ });
463
+ }
464
+ var listCommand = defineCommand4({
465
+ meta: {
466
+ name: "list",
467
+ description: "List all commands and rules"
468
+ },
469
+ args: {
470
+ commands: {
471
+ type: "boolean",
472
+ alias: "c",
473
+ description: "Only list commands",
474
+ default: false
475
+ },
476
+ rules: {
477
+ type: "boolean",
478
+ alias: "r",
479
+ description: "Only list rules",
480
+ default: false
481
+ },
482
+ verbose: {
483
+ type: "boolean",
484
+ alias: "v",
485
+ description: "Show full file paths",
486
+ default: false
487
+ }
488
+ },
489
+ async run({ args }) {
490
+ const listBoth = !args.commands && !args.rules;
491
+ const shouldListCommands = listBoth || args.commands;
492
+ const shouldListRules = listBoth || args.rules;
493
+ p4.intro(pc5.bgCyan(pc5.black(" cursor-kit list ")));
494
+ const commandsDir = getCommandsDir();
495
+ const rulesDir = getRulesDir();
496
+ const commands = shouldListCommands ? getItems(commandsDir, ".md", true) : [];
497
+ const rules = shouldListRules ? getItems(rulesDir, ".mdc", false) : [];
498
+ if (commands.length === 0 && rules.length === 0) {
499
+ console.log();
500
+ console.log(pc5.yellow(" No commands or rules found."));
501
+ console.log(pc5.dim(" Run ") + highlight("cursor-kit init") + pc5.dim(" to get started."));
502
+ console.log();
503
+ p4.outro(pc5.dim("Nothing to show"));
504
+ return;
505
+ }
506
+ printDivider();
507
+ if (shouldListCommands && commands.length > 0) {
508
+ console.log();
509
+ console.log(pc5.bold(pc5.cyan(" \u{1F4DC} Commands")) + pc5.dim(` (${commands.length})`));
510
+ console.log();
511
+ commands.forEach((cmd) => {
512
+ console.log(` ${pc5.green("\u25CF")} ${highlight(cmd.name)}`);
513
+ if (cmd.description) {
514
+ console.log(pc5.dim(` ${cmd.description}`));
515
+ }
516
+ if (args.verbose) {
517
+ console.log(pc5.dim(` ${cmd.path}`));
518
+ }
519
+ });
520
+ }
521
+ if (shouldListRules && rules.length > 0) {
522
+ console.log();
523
+ console.log(pc5.bold(pc5.cyan(" \u{1F4CB} Rules")) + pc5.dim(` (${rules.length})`));
524
+ console.log();
525
+ rules.forEach((rule) => {
526
+ console.log(` ${pc5.green("\u25CF")} ${highlight(rule.name)}`);
527
+ if (rule.description) {
528
+ console.log(pc5.dim(` ${rule.description}`));
529
+ }
530
+ if (args.verbose) {
531
+ console.log(pc5.dim(` ${rule.path}`));
532
+ }
533
+ });
534
+ }
535
+ console.log();
536
+ printDivider();
537
+ const total = commands.length + rules.length;
538
+ p4.outro(pc5.dim(`Total: ${total} item${total !== 1 ? "s" : ""}`));
539
+ }
540
+ });
541
+
542
+ // src/commands/remove.ts
543
+ import { defineCommand as defineCommand5 } from "citty";
544
+ import * as p5 from "@clack/prompts";
545
+ import pc6 from "picocolors";
546
+ import { join as join4 } from "path";
547
+ var removeCommand = defineCommand5({
548
+ meta: {
549
+ name: "remove",
550
+ description: "Remove a command or rule"
551
+ },
552
+ args: {
553
+ type: {
554
+ type: "string",
555
+ alias: "t",
556
+ description: "Type: 'command' or 'rule'"
557
+ },
558
+ name: {
559
+ type: "string",
560
+ alias: "n",
561
+ description: "Name of the command or rule to remove"
562
+ },
563
+ force: {
564
+ type: "boolean",
565
+ alias: "f",
566
+ description: "Skip confirmation",
567
+ default: false
568
+ }
569
+ },
570
+ async run({ args }) {
571
+ p5.intro(pc6.bgCyan(pc6.black(" cursor-kit remove ")));
572
+ const commandsDir = getCommandsDir();
573
+ const rulesDir = getRulesDir();
574
+ const commands = listFiles(commandsDir, ".md").map((f) => f.replace(".md", ""));
575
+ const rules = listFiles(rulesDir, ".mdc").map((f) => f.replace(".mdc", ""));
576
+ if (commands.length === 0 && rules.length === 0) {
577
+ console.log();
578
+ console.log(pc6.yellow(" No commands or rules to remove."));
579
+ console.log();
580
+ p5.outro(pc6.dim("Nothing to do"));
581
+ return;
582
+ }
583
+ let itemType;
584
+ let itemName;
585
+ if (args.type && ["command", "rule"].includes(args.type)) {
586
+ itemType = args.type;
587
+ } else {
588
+ const typeOptions = [];
589
+ if (commands.length > 0) {
590
+ typeOptions.push({
591
+ value: "command",
592
+ label: "Command",
593
+ hint: `${commands.length} available`
594
+ });
595
+ }
596
+ if (rules.length > 0) {
597
+ typeOptions.push({
598
+ value: "rule",
599
+ label: "Rule",
600
+ hint: `${rules.length} available`
601
+ });
602
+ }
603
+ const typeResult = await p5.select({
604
+ message: "What do you want to remove?",
605
+ options: typeOptions
606
+ });
607
+ if (p5.isCancel(typeResult)) {
608
+ p5.cancel("Operation cancelled");
609
+ process.exit(0);
610
+ }
611
+ itemType = typeResult;
612
+ }
613
+ const isCommand = itemType === "command";
614
+ const items = isCommand ? commands : rules;
615
+ const dir = isCommand ? commandsDir : rulesDir;
616
+ const extension = isCommand ? ".md" : ".mdc";
617
+ if (items.length === 0) {
618
+ p5.cancel(`No ${itemType}s found`);
619
+ process.exit(0);
620
+ }
621
+ if (args.name && items.includes(args.name)) {
622
+ itemName = args.name;
623
+ } else {
624
+ const itemOptions = items.map((item) => ({
625
+ value: item,
626
+ label: item
627
+ }));
628
+ const nameResult = await p5.select({
629
+ message: `Select ${itemType} to remove:`,
630
+ options: itemOptions
631
+ });
632
+ if (p5.isCancel(nameResult)) {
633
+ p5.cancel("Operation cancelled");
634
+ process.exit(0);
635
+ }
636
+ itemName = nameResult;
637
+ }
638
+ const filePath = join4(dir, `${itemName}${extension}`);
639
+ if (!fileExists(filePath)) {
640
+ p5.cancel(`${itemType} '${itemName}' not found`);
641
+ process.exit(1);
642
+ }
643
+ if (!args.force) {
644
+ const shouldDelete = await p5.confirm({
645
+ message: `Are you sure you want to delete ${highlight(itemName + extension)}?`,
646
+ initialValue: false
647
+ });
648
+ if (p5.isCancel(shouldDelete) || !shouldDelete) {
649
+ p5.cancel("Operation cancelled");
650
+ process.exit(0);
651
+ }
652
+ }
653
+ try {
654
+ removeFile(filePath);
655
+ console.log();
656
+ printSuccess(`Removed ${highlight(itemName + extension)}`);
657
+ console.log();
658
+ p5.outro(pc6.green("\u2728 Done!"));
659
+ } catch (error) {
660
+ p5.cancel(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
661
+ process.exit(1);
662
+ }
663
+ }
664
+ });
665
+
666
+ // src/cli.ts
667
+ var main = defineCommand6({
668
+ meta: {
669
+ name: "cursor-kit",
670
+ version: "0.1.0",
671
+ description: "CLI toolkit to manage Cursor IDE rules and commands"
672
+ },
673
+ setup() {
674
+ printBanner();
675
+ printVersion("0.1.0");
676
+ },
677
+ subCommands: {
678
+ init: initCommand,
679
+ add: addCommand,
680
+ pull: pullCommand,
681
+ list: listCommand,
682
+ remove: removeCommand
683
+ }
684
+ });
685
+ runMain(main);
686
+ //# sourceMappingURL=cli.js.map