mother-brain 0.0.6 → 0.0.8
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 +170 -11
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
8
8
|
|
|
9
9
|
// src/cli.ts
|
|
10
10
|
import { Command } from "commander";
|
|
11
|
-
import
|
|
11
|
+
import chalk6 from "chalk";
|
|
12
12
|
|
|
13
13
|
// src/commands/init.ts
|
|
14
14
|
import path from "path";
|
|
@@ -528,27 +528,186 @@ ${chalk4.yellow("\u{1F4A1}")} ${improvement.description}`);
|
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
+
// src/commands/uninstall.ts
|
|
532
|
+
import { existsSync as existsSync3, rmSync, readdirSync as readdirSync2 } from "fs";
|
|
533
|
+
import { join as join3 } from "path";
|
|
534
|
+
import chalk5 from "chalk";
|
|
535
|
+
import readline2 from "readline";
|
|
536
|
+
var CORE_SKILLS = ["mother-brain", "child-brain", "skill-creator"];
|
|
537
|
+
async function confirm(question) {
|
|
538
|
+
const rl = readline2.createInterface({
|
|
539
|
+
input: process.stdin,
|
|
540
|
+
output: process.stdout
|
|
541
|
+
});
|
|
542
|
+
return new Promise((resolve) => {
|
|
543
|
+
rl.question(question, (answer) => {
|
|
544
|
+
rl.close();
|
|
545
|
+
resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
|
|
546
|
+
});
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
async function uninstall(options) {
|
|
550
|
+
const skillsDir = join3(process.cwd(), ".github", "skills");
|
|
551
|
+
const motherBrainDir = join3(process.cwd(), ".mother-brain");
|
|
552
|
+
if (!existsSync3(skillsDir) && !existsSync3(motherBrainDir)) {
|
|
553
|
+
console.log(chalk5.yellow("\u26A0\uFE0F Mother Brain is not installed in this project."));
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
console.log(chalk5.cyan("\n\u{1F9F9} Mother Brain Uninstall\n"));
|
|
557
|
+
const coreSkillsToRemove = [];
|
|
558
|
+
const projectSkillsFound = [];
|
|
559
|
+
if (existsSync3(skillsDir)) {
|
|
560
|
+
const skills = readdirSync2(skillsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
|
|
561
|
+
for (const skill of skills) {
|
|
562
|
+
if (CORE_SKILLS.includes(skill)) {
|
|
563
|
+
coreSkillsToRemove.push(skill);
|
|
564
|
+
} else {
|
|
565
|
+
projectSkillsFound.push(skill);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
console.log(chalk5.white.bold("What will be removed:"));
|
|
570
|
+
if (coreSkillsToRemove.length > 0) {
|
|
571
|
+
console.log(chalk5.red("\n Core Skills:"));
|
|
572
|
+
coreSkillsToRemove.forEach((s) => console.log(chalk5.red(` \u274C .github/skills/${s}/`)));
|
|
573
|
+
}
|
|
574
|
+
if (existsSync3(motherBrainDir)) {
|
|
575
|
+
console.log(chalk5.red("\n Configuration:"));
|
|
576
|
+
if (!options.keepDocs) {
|
|
577
|
+
console.log(chalk5.red(" \u274C .mother-brain/version.json"));
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
console.log(chalk5.white.bold("\nWhat will be kept:"));
|
|
581
|
+
if (projectSkillsFound.length > 0) {
|
|
582
|
+
console.log(chalk5.green("\n Project Skills:"));
|
|
583
|
+
projectSkillsFound.forEach((s) => console.log(chalk5.green(` \u2705 .github/skills/${s}/`)));
|
|
584
|
+
}
|
|
585
|
+
if (existsSync3(motherBrainDir)) {
|
|
586
|
+
console.log(chalk5.green("\n Project Docs:"));
|
|
587
|
+
console.log(chalk5.green(" \u2705 .mother-brain/docs/vision.md"));
|
|
588
|
+
console.log(chalk5.green(" \u2705 .mother-brain/docs/roadmap.md"));
|
|
589
|
+
console.log(chalk5.green(" \u2705 .mother-brain/docs/tasks/"));
|
|
590
|
+
console.log(chalk5.green(" \u2705 .mother-brain/session-state.json"));
|
|
591
|
+
}
|
|
592
|
+
if (options.all) {
|
|
593
|
+
console.log(chalk5.yellow("\n \u26A0\uFE0F --all flag: Will also remove .mother-brain/ docs"));
|
|
594
|
+
}
|
|
595
|
+
console.log("");
|
|
596
|
+
if (!options.force) {
|
|
597
|
+
const proceed = await confirm(chalk5.yellow("Proceed with uninstall? (y/N): "));
|
|
598
|
+
if (!proceed) {
|
|
599
|
+
console.log(chalk5.dim("\nUninstall cancelled."));
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
console.log("");
|
|
604
|
+
for (const skill of coreSkillsToRemove) {
|
|
605
|
+
const skillPath = join3(skillsDir, skill);
|
|
606
|
+
try {
|
|
607
|
+
rmSync(skillPath, { recursive: true, force: true });
|
|
608
|
+
console.log(chalk5.green(`\u2713 Removed .github/skills/${skill}/`));
|
|
609
|
+
} catch (err) {
|
|
610
|
+
console.log(chalk5.red(`\u2717 Failed to remove ${skill}: ${err}`));
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
const versionFile = join3(motherBrainDir, "version.json");
|
|
614
|
+
if (existsSync3(versionFile)) {
|
|
615
|
+
try {
|
|
616
|
+
rmSync(versionFile);
|
|
617
|
+
console.log(chalk5.green("\u2713 Removed .mother-brain/version.json"));
|
|
618
|
+
} catch (err) {
|
|
619
|
+
console.log(chalk5.red(`\u2717 Failed to remove version.json: ${err}`));
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (options.all && existsSync3(motherBrainDir)) {
|
|
623
|
+
try {
|
|
624
|
+
rmSync(motherBrainDir, { recursive: true, force: true });
|
|
625
|
+
console.log(chalk5.green("\u2713 Removed .mother-brain/"));
|
|
626
|
+
} catch (err) {
|
|
627
|
+
console.log(chalk5.red(`\u2717 Failed to remove .mother-brain/: ${err}`));
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (existsSync3(skillsDir)) {
|
|
631
|
+
const remaining = readdirSync2(skillsDir);
|
|
632
|
+
if (remaining.length === 0) {
|
|
633
|
+
try {
|
|
634
|
+
rmSync(skillsDir, { recursive: true });
|
|
635
|
+
console.log(chalk5.green("\u2713 Removed empty .github/skills/"));
|
|
636
|
+
} catch (err) {
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
console.log(chalk5.cyan("\n\u2705 Mother Brain uninstalled.\n"));
|
|
641
|
+
if (!options.all && existsSync3(motherBrainDir)) {
|
|
642
|
+
console.log(chalk5.dim("Your project docs (.mother-brain/) were preserved."));
|
|
643
|
+
console.log(chalk5.dim("Use --all to remove everything including docs."));
|
|
644
|
+
}
|
|
645
|
+
console.log(chalk5.dim("\nTo reinstall: npx mother-brain init"));
|
|
646
|
+
}
|
|
647
|
+
|
|
531
648
|
// src/cli.ts
|
|
649
|
+
import { exec as exec3 } from "child_process";
|
|
532
650
|
var program = new Command();
|
|
533
|
-
|
|
651
|
+
var VERSION = "0.0.8";
|
|
652
|
+
program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI").version(VERSION);
|
|
534
653
|
program.command("init").description("Initialize Mother Brain in the current project").option("-f, --force", "Overwrite existing skills").action(init);
|
|
535
654
|
program.command("update").description("Update Mother Brain skills to the latest version").action(update);
|
|
536
655
|
program.command("status").description("Show installed version and available updates").action(status);
|
|
537
656
|
analyzeCommand(program);
|
|
538
657
|
upgradeCommand(program);
|
|
658
|
+
program.command("docs").description("Open Mother Brain documentation in browser").action(() => {
|
|
659
|
+
const url = "https://github.com/super-state/mother-brain#readme";
|
|
660
|
+
console.log(chalk6.cyan("\u{1F4D6} Opening documentation..."));
|
|
661
|
+
const cmd = process.platform === "win32" ? "start" : process.platform === "darwin" ? "open" : "xdg-open";
|
|
662
|
+
exec3(`${cmd} ${url}`, (err) => {
|
|
663
|
+
if (err) {
|
|
664
|
+
console.log(chalk6.yellow(`
|
|
665
|
+
Couldn't open browser. Visit: ${url}`));
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
});
|
|
669
|
+
program.command("quickstart").description("Show quick start guide").action(() => {
|
|
670
|
+
console.log(chalk6.cyan(`
|
|
671
|
+
\u2533\u2533\u2513\u250F\u2513\u250F\u2533\u2513\u2513\u250F\u250F\u2513\u2533\u2513 \u2533\u2513\u2533\u2513\u250F\u2513\u2533\u2533\u2513
|
|
672
|
+
\u2503\u2503\u2503\u2503\u2503 \u2503 \u2523\u252B\u2523 \u2523\u252B \u2523\u252B\u2523\u252B\u2523\u252B\u2503\u2503\u2503
|
|
673
|
+
\u251B \u2517\u2517\u251B \u253B \u251B\u2517\u2517\u251B\u251B\u2517 \u253B\u251B\u251B\u2517\u251B\u2517\u253B\u251B\u2517
|
|
674
|
+
`));
|
|
675
|
+
console.log(chalk6.white.bold("\u{1F680} Quick Start Guide\n"));
|
|
676
|
+
console.log(chalk6.yellow("Step 1:") + " Initialize Mother Brain in your project");
|
|
677
|
+
console.log(chalk6.dim(" npx mother-brain init\n"));
|
|
678
|
+
console.log(chalk6.yellow("Step 2:") + " Start using it with GitHub Copilot CLI");
|
|
679
|
+
console.log(chalk6.dim(' ghcs "/mother-brain"\n'));
|
|
680
|
+
console.log(chalk6.yellow("Step 3:") + " Follow the wizard to define your vision");
|
|
681
|
+
console.log(chalk6.dim(" Mother Brain will guide you through:\n"));
|
|
682
|
+
console.log(chalk6.dim(" - Vision Discovery (what are you building?)"));
|
|
683
|
+
console.log(chalk6.dim(" - Roadmap Generation (how to get there)"));
|
|
684
|
+
console.log(chalk6.dim(" - Skill Creation (automate repetitive tasks)"));
|
|
685
|
+
console.log(chalk6.dim(" - Task Execution (build it step by step)\n"));
|
|
686
|
+
console.log(chalk6.green("That's it!") + " Mother Brain will help you ship faster.\n");
|
|
687
|
+
console.log(chalk6.dim("For more info: mother-brain docs"));
|
|
688
|
+
});
|
|
689
|
+
program.command("uninstall").description("Remove Mother Brain core skills from project").option("-f, --force", "Skip confirmation prompt").option("-a, --all", "Also remove .mother-brain/ docs folder").action(uninstall);
|
|
539
690
|
program.action(() => {
|
|
540
|
-
console.log(
|
|
691
|
+
console.log(chalk6.cyan(`
|
|
541
692
|
\u2533\u2533\u2513\u250F\u2513\u250F\u2533\u2513\u2513\u250F\u250F\u2513\u2533\u2513 \u2533\u2513\u2533\u2513\u250F\u2513\u2533\u2533\u2513
|
|
542
693
|
\u2503\u2503\u2503\u2503\u2503 \u2503 \u2523\u252B\u2523 \u2523\u252B \u2523\u252B\u2523\u252B\u2523\u252B\u2503\u2503\u2503
|
|
543
694
|
\u251B \u2517\u2517\u251B \u253B \u251B\u2517\u2517\u251B\u251B\u2517 \u253B\u251B\u251B\u2517\u251B\u2517\u253B\u251B\u2517
|
|
544
695
|
`));
|
|
545
|
-
console.log(
|
|
546
|
-
console.log(
|
|
547
|
-
|
|
548
|
-
console.log(
|
|
549
|
-
console.log(
|
|
550
|
-
console.log(
|
|
551
|
-
console.log(
|
|
552
|
-
console.log(
|
|
696
|
+
console.log(chalk6.white("AI-powered project management for GitHub Copilot CLI"));
|
|
697
|
+
console.log(chalk6.dim(`v${VERSION}
|
|
698
|
+
`));
|
|
699
|
+
console.log(chalk6.white.bold("Getting Started:"));
|
|
700
|
+
console.log(chalk6.green(" npx mother-brain init ") + "Add to your project");
|
|
701
|
+
console.log(chalk6.green(" npx mother-brain quickstart ") + "Show quick start guide\n");
|
|
702
|
+
console.log(chalk6.white.bold("Commands:"));
|
|
703
|
+
console.log(chalk6.green(" init ") + "Add Mother Brain skills to project");
|
|
704
|
+
console.log(chalk6.green(" update ") + "Update to the latest version");
|
|
705
|
+
console.log(chalk6.green(" status ") + "Check installed version");
|
|
706
|
+
console.log(chalk6.green(" analyze ") + "Analyze skills and suggest improvements");
|
|
707
|
+
console.log(chalk6.green(" upgrade ") + "Apply improvements to skills");
|
|
708
|
+
console.log(chalk6.green(" uninstall ") + "Remove Mother Brain from project");
|
|
709
|
+
console.log(chalk6.green(" docs ") + "Open documentation in browser");
|
|
710
|
+
console.log(chalk6.green(" quickstart ") + "Show quick start guide\n");
|
|
711
|
+
console.log(chalk6.dim("Run mother-brain <command> --help for command details"));
|
|
553
712
|
});
|
|
554
713
|
program.parse();
|