@synapsync/cli 0.1.2 → 0.1.4

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/index.js CHANGED
@@ -28,7 +28,7 @@ var init_version = __esm({
28
28
  "src/version.ts"() {
29
29
  "use strict";
30
30
  init_esm_shims();
31
- version = "0.1.0";
31
+ version = "0.1.4";
32
32
  }
33
33
  });
34
34
 
@@ -144,7 +144,7 @@ var REGISTRY_MANIFEST_FILE = "manifest.json";
144
144
  // src/ui/repl.ts
145
145
  init_esm_shims();
146
146
  import * as readline from "readline";
147
- import pc16 from "picocolors";
147
+ import pc17 from "picocolors";
148
148
 
149
149
  // src/ui/banner.ts
150
150
  init_esm_shims();
@@ -337,7 +337,7 @@ function showBanner() {
337
337
  logger.command("synapsync init", "Initialize a new project");
338
338
  logger.command("synapsync connect", "Connect to AI providers");
339
339
  logger.command("synapsync search", "Search registry for assets");
340
- logger.command("synapsync install <name>", "Install skill, agent, or prompt");
340
+ logger.command("synapsync add <name>", "Add skill, agent, or prompt");
341
341
  logger.command("synapsync sync", "Sync assets to providers");
342
342
  logger.line();
343
343
  logger.log(` ${pc2.dim("Run")} ${pc2.cyan("synapsync --help")} ${pc2.dim("for all commands")}`);
@@ -359,10 +359,10 @@ var INFO_TOPICS = {
359
359
  description: "Types of AI cognitives managed by SynapSync",
360
360
  content: showCognitivesInfo
361
361
  },
362
- install: {
363
- name: "Install",
364
- description: "How to install cognitives from different sources",
365
- content: showInstallInfo
362
+ add: {
363
+ name: "Add",
364
+ description: "How to add cognitives from different sources",
365
+ content: showAddInfo
366
366
  },
367
367
  providers: {
368
368
  name: "Providers",
@@ -439,8 +439,8 @@ function showCognitivesInfo() {
439
439
  logger.line();
440
440
  logger.log(pc3.bold(" Usage Examples:"));
441
441
  logger.line();
442
- logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync install")} code-reviewer ${pc3.dim("# Install a skill")}`);
443
- logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync install")} ci-agent ${pc3.dim("# Install an agent")}`);
442
+ logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync add")} code-reviewer ${pc3.dim("# Add a skill")}`);
443
+ logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync add")} ci-agent ${pc3.dim("# Add an agent")}`);
444
444
  logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync list")} --type agent ${pc3.dim("# List only agents")}`);
445
445
  logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync sync")} --type skill ${pc3.dim("# Sync only skills")}`);
446
446
  logger.line();
@@ -451,7 +451,7 @@ function showCognitivesInfo() {
451
451
  logger.line();
452
452
  logger.log(pc3.bold(" Type Detection:"));
453
453
  logger.line();
454
- logger.dim(" When installing, SynapSync detects the cognitive type automatically:");
454
+ logger.dim(" When adding, SynapSync detects the cognitive type automatically:");
455
455
  logger.line();
456
456
  logger.log(` ${pc3.cyan("1.")} ${pc3.white("Flag")} ${pc3.dim("--type skill (explicit, highest priority)")}`);
457
457
  logger.log(` ${pc3.cyan("2.")} ${pc3.white("Registry")} ${pc3.dim("Metadata from the registry")}`);
@@ -459,43 +459,43 @@ function showCognitivesInfo() {
459
459
  logger.log(` ${pc3.cyan("4.")} ${pc3.white("Prompt")} ${pc3.dim("Asks you if cannot detect")}`);
460
460
  logger.line();
461
461
  }
462
- function showInstallInfo() {
462
+ function showAddInfo() {
463
463
  logger.line();
464
464
  logger.log(pc3.bold(pc3.cyan(" Installation Sources")));
465
465
  logger.line();
466
- logger.dim(" SynapSync can install cognitives from multiple sources:");
466
+ logger.dim(" SynapSync can add cognitives from multiple sources:");
467
467
  logger.line();
468
468
  logger.log(pc3.bold(" Supported Sources:"));
469
469
  logger.line();
470
470
  const sources = [
471
471
  {
472
472
  source: "Registry",
473
- format: "synapsync install code-reviewer",
473
+ format: "synapsync add code-reviewer",
474
474
  description: "From the SynapSync registry"
475
475
  },
476
476
  {
477
477
  source: "Local",
478
- format: "synapsync install ./path/to/cognitive",
478
+ format: "synapsync add ./path/to/cognitive",
479
479
  description: "From local file system"
480
480
  },
481
481
  {
482
482
  source: "GitHub",
483
- format: "synapsync install github:user/repo",
483
+ format: "synapsync add github:user/repo",
484
484
  description: "From a GitHub repository"
485
485
  },
486
486
  {
487
487
  source: "GitHub Path",
488
- format: "synapsync install github:user/repo/cognitives/skill",
488
+ format: "synapsync add github:user/repo/cognitives/skill",
489
489
  description: "Specific path in repo"
490
490
  },
491
491
  {
492
492
  source: "GitHub Branch",
493
- format: "synapsync install github:user/repo#develop",
493
+ format: "synapsync add github:user/repo#develop",
494
494
  description: "Specific branch or tag"
495
495
  },
496
496
  {
497
497
  source: "GitHub URL",
498
- format: "synapsync install https://github.com/user/repo",
498
+ format: "synapsync add https://github.com/user/repo",
499
499
  description: "Full GitHub URL"
500
500
  }
501
501
  ];
@@ -508,22 +508,21 @@ function showInstallInfo() {
508
508
  logger.line();
509
509
  logger.dim(" SynapSync automatically detects the cognitive type using:");
510
510
  logger.line();
511
- logger.log(` ${pc3.cyan("1.")} ${pc3.white("Explicit flag")} ${pc3.dim("synapsync install code-reviewer --type skill")}`);
511
+ logger.log(` ${pc3.cyan("1.")} ${pc3.white("Explicit flag")} ${pc3.dim("synapsync add code-reviewer --type skill")}`);
512
512
  logger.log(` ${pc3.cyan("2.")} ${pc3.white("Registry lookup")} ${pc3.dim("Registry provides type metadata")}`);
513
513
  logger.log(` ${pc3.cyan("3.")} ${pc3.white("File detection")} ${pc3.dim("Scans for SKILL.md, AGENT.md, etc.")}`);
514
514
  logger.log(` ${pc3.cyan("4.")} ${pc3.white("Interactive")} ${pc3.dim("Prompts you to select if unknown")}`);
515
515
  logger.line();
516
516
  logger.log(pc3.bold(" Version Specification:"));
517
517
  logger.line();
518
- logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync install")} code-reviewer ${pc3.dim("# Latest version")}`);
519
- logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync install")} code-reviewer@1.2.0 ${pc3.dim("# Specific version")}`);
520
- logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync install")} code-reviewer@^1.0.0 ${pc3.dim("# Version range")}`);
518
+ logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync add")} code-reviewer ${pc3.dim("# Latest version")}`);
519
+ logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync add")} code-reviewer@1.2.0 ${pc3.dim("# Specific version")}`);
520
+ logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync add")} code-reviewer@^1.0.0 ${pc3.dim("# Version range")}`);
521
521
  logger.line();
522
522
  logger.log(pc3.bold(" Common Options:"));
523
523
  logger.line();
524
524
  logger.log(` ${pc3.yellow("--type <type>")} ${pc3.dim("Explicit cognitive type (skill, agent, prompt, workflow, tool)")}`);
525
525
  logger.log(` ${pc3.yellow("--category <cat>")} ${pc3.dim("Explicit category (frontend, backend, etc.)")}`);
526
- logger.log(` ${pc3.yellow("--global")} ${pc3.dim("Install globally for all projects")}`);
527
526
  logger.log(` ${pc3.yellow("--force")} ${pc3.dim("Force reinstall even if exists")}`);
528
527
  logger.line();
529
528
  }
@@ -586,7 +585,7 @@ function showCategoriesInfo() {
586
585
  logger.line();
587
586
  logger.log(pc3.bold(" Usage:"));
588
587
  logger.line();
589
- logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync install")} react-patterns ${pc3.dim("--category frontend")}`);
588
+ logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync add")} react-patterns ${pc3.dim("--category frontend")}`);
590
589
  logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync list")} --category devops`);
591
590
  logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync search")} --category security`);
592
591
  logger.line();
@@ -664,7 +663,7 @@ function showAllTopics() {
664
663
  logger.line();
665
664
  const topics = [
666
665
  { flag: "--cognitives", desc: "Types of AI cognitives (skills, agents, prompts, etc.)" },
667
- { flag: "--install", desc: "How to install from registry, GitHub, local" },
666
+ { flag: "--add", desc: "How to add from registry, GitHub, local" },
668
667
  { flag: "--providers", desc: "Supported AI providers (Claude, OpenAI, etc.)" },
669
668
  { flag: "--categories", desc: "Cognitive organization categories" },
670
669
  { flag: "--sync", desc: "How synchronization works" },
@@ -707,7 +706,7 @@ function executeInfoCommand(args) {
707
706
  }
708
707
  }
709
708
  function registerInfoCommand(program) {
710
- program.command("info").description("Show information about SynapSync concepts").option("--cognitives", "Show cognitive types information").option("--install", "Show installation sources and detection").option("--providers", "Show supported providers").option("--categories", "Show cognitive categories").option("--sync", "Show sync information").option("--structure", "Show project structure").action((options) => {
709
+ program.command("info").description("Show information about SynapSync concepts").option("--cognitives", "Show cognitive types information").option("--add", "Show installation sources and detection").option("--providers", "Show supported providers").option("--categories", "Show cognitive categories").option("--sync", "Show sync information").option("--structure", "Show project structure").action((options) => {
711
710
  const topic = Object.keys(options).find((key) => options[key] === true);
712
711
  if (topic && INFO_TOPICS[topic]) {
713
712
  INFO_TOPICS[topic].content();
@@ -823,8 +822,8 @@ function validateConfig(config) {
823
822
  }
824
823
  return errors;
825
824
  }
826
- function getNestedValue(obj, path16) {
827
- const parts = path16.split(".");
825
+ function getNestedValue(obj, path17) {
826
+ const parts = path17.split(".");
828
827
  let current = obj;
829
828
  for (const part of parts) {
830
829
  if (current === null || current === void 0) {
@@ -837,8 +836,8 @@ function getNestedValue(obj, path16) {
837
836
  }
838
837
  return current;
839
838
  }
840
- function setNestedValue(obj, path16, value) {
841
- const parts = path16.split(".");
839
+ function setNestedValue(obj, path17, value) {
840
+ const parts = path17.split(".");
842
841
  let current = obj;
843
842
  for (let i = 0; i < parts.length - 1; i++) {
844
843
  const part = parts[i];
@@ -1197,9 +1196,9 @@ function showSuccessMessage(setup, configPath, storagePath) {
1197
1196
  logger.log(` ${pc4.cyan("1.")} Connect to providers:`);
1198
1197
  logger.log(` ${pc4.dim("$")} synapsync connect claude`);
1199
1198
  logger.line();
1200
- logger.log(` ${pc4.cyan("2.")} Install cognitives:`);
1201
- logger.log(` ${pc4.dim("$")} synapsync install code-reviewer`);
1202
- logger.log(` ${pc4.dim("$")} synapsync install github:user/my-skill`);
1199
+ logger.log(` ${pc4.cyan("2.")} Add cognitives:`);
1200
+ logger.log(` ${pc4.dim("$")} synapsync add code-reviewer`);
1201
+ logger.log(` ${pc4.dim("$")} synapsync add github:user/my-skill`);
1203
1202
  logger.line();
1204
1203
  logger.log(` ${pc4.cyan("3.")} Sync to providers:`);
1205
1204
  logger.log(` ${pc4.dim("$")} synapsync sync`);
@@ -2101,7 +2100,7 @@ function displaySearchResults(cognitives, query, total) {
2101
2100
  displayCognitive(cognitive);
2102
2101
  }
2103
2102
  logger.line();
2104
- logger.hint("Run synapsync install <name> to install a cognitive.");
2103
+ logger.hint("Run synapsync add <name> to add a cognitive.");
2105
2104
  }
2106
2105
  function displayCognitive(cognitive) {
2107
2106
  const typeIcon = getCognitiveIcon2(cognitive.type);
@@ -2141,7 +2140,7 @@ function registerSearchCommand(program) {
2141
2140
  });
2142
2141
  }
2143
2142
 
2144
- // src/commands/install.ts
2143
+ // src/commands/add.ts
2145
2144
  init_esm_shims();
2146
2145
  import * as fs8 from "fs";
2147
2146
  import * as path10 from "path";
@@ -3318,8 +3317,8 @@ var SyncEngine = class {
3318
3317
  }
3319
3318
  };
3320
3319
 
3321
- // src/commands/install.ts
3322
- async function executeInstallCommand(source, options) {
3320
+ // src/commands/add.ts
3321
+ async function executeAddCommand(source, options) {
3323
3322
  logger.line();
3324
3323
  const configManager = ConfigManager.findConfig();
3325
3324
  if (configManager === null) {
@@ -3344,7 +3343,7 @@ async function executeInstallCommand(source, options) {
3344
3343
  success = installFromGitHub(parsedSource, options, configManager);
3345
3344
  break;
3346
3345
  }
3347
- if (success && options.sync === true) {
3346
+ if (success) {
3348
3347
  logger.log(` ${pc9.dim("Syncing to providers...")}`);
3349
3348
  const synapSyncDir = configManager.getSynapSyncDir();
3350
3349
  const projectRoot = configManager.getProjectRoot();
@@ -3433,10 +3432,6 @@ async function installFromRegistry(name, options, configManager) {
3433
3432
  logger.log(` ${pc9.dim("Type:")} ${manifest.type}`);
3434
3433
  logger.log(` ${pc9.dim("Category:")} ${category}`);
3435
3434
  logger.log(` ${pc9.dim("Location:")} ${path10.relative(process.cwd(), targetDir)}`);
3436
- if (options.sync !== true) {
3437
- logger.line();
3438
- logger.hint("Run synapsync sync to sync to your providers.");
3439
- }
3440
3435
  return true;
3441
3436
  }
3442
3437
  async function downloadAssets(client, name, _manifest) {
@@ -3516,10 +3511,6 @@ function installFromLocal(sourcePath, options, configManager) {
3516
3511
  logger.log(` ${pc9.dim("Category:")} ${category}`);
3517
3512
  logger.log(` ${pc9.dim("Source:")} local`);
3518
3513
  logger.log(` ${pc9.dim("Location:")} ${path10.relative(process.cwd(), targetDir)}`);
3519
- if (options.sync !== true) {
3520
- logger.line();
3521
- logger.hint("Run synapsync sync to sync to your providers.");
3522
- }
3523
3514
  return true;
3524
3515
  }
3525
3516
  function detectCognitiveType(dirPath) {
@@ -3577,7 +3568,7 @@ function parseMetadata(content) {
3577
3568
  function installFromGitHub(_source, _options, _configManager) {
3578
3569
  logger.line();
3579
3570
  logger.error("GitHub installation is not yet fully implemented.");
3580
- logger.hint("For now, clone the repo locally and use: synapsync install ./path/to/cognitive");
3571
+ logger.hint("For now, clone the repo locally and use: synapsync add ./path/to/cognitive");
3581
3572
  return false;
3582
3573
  }
3583
3574
  function getTargetDir(configManager, type, category, name) {
@@ -3626,9 +3617,9 @@ function updateProjectManifest(configManager, manifest, source) {
3626
3617
  projectManifest.lastUpdated = (/* @__PURE__ */ new Date()).toISOString();
3627
3618
  fs8.writeFileSync(manifestPath, JSON.stringify(projectManifest, null, 2), "utf-8");
3628
3619
  }
3629
- function registerInstallCommand(program) {
3630
- program.command("install <source>").description("Install a cognitive from registry, local path, or GitHub").option("-t, --type <type>", "Cognitive type (skill, agent, prompt, workflow, tool)").option("-c, --category <category>", "Category (overrides default)").option("-f, --force", "Overwrite if already installed").option("-s, --sync", "Sync to providers after installation").option("-g, --global", "Install globally (not yet implemented)").action(async (source, options) => {
3631
- await executeInstallCommand(source, options);
3620
+ function registerAddCommand(program) {
3621
+ program.command("add <source>").description("Add a cognitive from registry, local path, or GitHub").option("-t, --type <type>", "Cognitive type (skill, agent, prompt, workflow, tool)").option("-c, --category <category>", "Category (overrides default)").option("-f, --force", "Overwrite if already installed").action(async (source, options) => {
3622
+ await executeAddCommand(source, options);
3632
3623
  });
3633
3624
  }
3634
3625
 
@@ -3731,7 +3722,7 @@ function displayRemoteCognitives(cognitives) {
3731
3722
  }
3732
3723
  logger.log(` ${pc10.dim(`Total: ${cognitives.length} cognitive${cognitives.length === 1 ? "" : "s"} available`)}`);
3733
3724
  logger.line();
3734
- logger.hint("Run synapsync install <name> to install a cognitive.");
3725
+ logger.hint("Run synapsync add <name> to add a cognitive.");
3735
3726
  }
3736
3727
  function validateOptions2(options) {
3737
3728
  const validated = {};
@@ -3796,7 +3787,7 @@ function displayCognitives(manifest, options) {
3796
3787
  if (cognitives.length === 0) {
3797
3788
  logger.log(` ${pc10.dim("No cognitives installed yet.")}`);
3798
3789
  logger.line();
3799
- logger.hint("Run synapsync search to find cognitives to install.");
3790
+ logger.hint("Run synapsync search to find cognitives to add.");
3800
3791
  } else {
3801
3792
  logger.log(` ${pc10.dim("No cognitives match the specified filters.")}`);
3802
3793
  logger.line();
@@ -4366,7 +4357,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
4366
4357
  console.log(JSON.stringify({ message: "No cognitives installed" }));
4367
4358
  } else {
4368
4359
  logger.log(` ${pc13.dim("No cognitives installed.")}`);
4369
- logger.hint("Run synapsync install <name> to install a cognitive.");
4360
+ logger.hint("Run synapsync add <name> to add a cognitive.");
4370
4361
  }
4371
4362
  return;
4372
4363
  }
@@ -5428,6 +5419,140 @@ function registerCleanCommand(program) {
5428
5419
  });
5429
5420
  }
5430
5421
 
5422
+ // src/commands/purge.ts
5423
+ init_esm_shims();
5424
+ import * as fs14 from "fs";
5425
+ import * as path16 from "path";
5426
+ import pc16 from "picocolors";
5427
+ function executePurgeCommand(options) {
5428
+ logger.line();
5429
+ const configManager = ConfigManager.findConfig();
5430
+ if (configManager === null) {
5431
+ logger.error("No SynapSync project found.");
5432
+ return;
5433
+ }
5434
+ const projectRoot = configManager.getProjectRoot();
5435
+ const synapSyncDir = configManager.getSynapSyncDir();
5436
+ if (options.force !== true) {
5437
+ logger.log(` ${pc16.yellow("!")} This will completely remove SynapSync from your project:`);
5438
+ logger.line();
5439
+ const itemsToRemove = collectItemsToRemove(projectRoot, synapSyncDir);
5440
+ for (const item of itemsToRemove) {
5441
+ logger.log(` ${pc16.red("\u2717")} ${item}`);
5442
+ }
5443
+ logger.line();
5444
+ logger.hint("Use --force to confirm and remove everything.");
5445
+ logger.log(` ${pc16.dim("To confirm, run:")} synapsync purge --force`);
5446
+ return;
5447
+ }
5448
+ let removedCount = 0;
5449
+ try {
5450
+ removedCount += removeProviderSymlinks(projectRoot, synapSyncDir);
5451
+ if (fs14.existsSync(synapSyncDir)) {
5452
+ fs14.rmSync(synapSyncDir, { recursive: true, force: true });
5453
+ logger.log(` ${pc16.red("\u2717")} Removed ${path16.relative(projectRoot, synapSyncDir)}/`);
5454
+ removedCount++;
5455
+ }
5456
+ const configPath = path16.join(projectRoot, "synapsync.config.yaml");
5457
+ if (fs14.existsSync(configPath)) {
5458
+ fs14.unlinkSync(configPath);
5459
+ logger.log(` ${pc16.red("\u2717")} Removed synapsync.config.yaml`);
5460
+ removedCount++;
5461
+ }
5462
+ if (cleanGitignore(projectRoot)) {
5463
+ logger.log(` ${pc16.red("\u2717")} Cleaned SynapSync entries from .gitignore`);
5464
+ removedCount++;
5465
+ }
5466
+ logger.line();
5467
+ if (removedCount > 0) {
5468
+ logger.log(` ${pc16.green("\u2713")} SynapSync has been completely removed from this project.`);
5469
+ } else {
5470
+ logger.log(` ${pc16.green("\u2713")} Nothing to remove.`);
5471
+ }
5472
+ logger.line();
5473
+ } catch (error) {
5474
+ logger.line();
5475
+ if (error instanceof Error) {
5476
+ logger.error(`Purge failed: ${error.message}`);
5477
+ } else {
5478
+ logger.error("Purge failed with unknown error");
5479
+ }
5480
+ }
5481
+ }
5482
+ function collectItemsToRemove(projectRoot, synapSyncDir) {
5483
+ const items = [];
5484
+ const symlinks = findSynapSyncSymlinks(projectRoot, synapSyncDir);
5485
+ for (const link of symlinks) {
5486
+ items.push(`${path16.relative(projectRoot, link)} (symlink)`);
5487
+ }
5488
+ if (fs14.existsSync(synapSyncDir)) {
5489
+ items.push(path16.relative(projectRoot, synapSyncDir) + "/");
5490
+ }
5491
+ const configPath = path16.join(projectRoot, "synapsync.config.yaml");
5492
+ if (fs14.existsSync(configPath)) {
5493
+ items.push("synapsync.config.yaml");
5494
+ }
5495
+ const gitignorePath = path16.join(projectRoot, ".gitignore");
5496
+ if (fs14.existsSync(gitignorePath)) {
5497
+ const content = fs14.readFileSync(gitignorePath, "utf-8");
5498
+ if (content.includes("# SynapSync")) {
5499
+ items.push(".gitignore (SynapSync entries)");
5500
+ }
5501
+ }
5502
+ return items;
5503
+ }
5504
+ function findSynapSyncSymlinks(projectRoot, synapSyncDir) {
5505
+ const symlinks = [];
5506
+ const resolvedSynapSync = path16.resolve(synapSyncDir);
5507
+ for (const provider of SUPPORTED_PROVIDERS) {
5508
+ const providerPaths = PROVIDER_PATHS[provider];
5509
+ for (const type of COGNITIVE_TYPES) {
5510
+ const typePath = path16.join(projectRoot, providerPaths[type]);
5511
+ if (!fs14.existsSync(typePath)) continue;
5512
+ try {
5513
+ const entries = fs14.readdirSync(typePath, { withFileTypes: true });
5514
+ for (const entry of entries) {
5515
+ const fullPath = path16.join(typePath, entry.name);
5516
+ if (entry.isSymbolicLink()) {
5517
+ const target = path16.resolve(typePath, fs14.readlinkSync(fullPath));
5518
+ if (target.startsWith(resolvedSynapSync)) {
5519
+ symlinks.push(fullPath);
5520
+ }
5521
+ }
5522
+ }
5523
+ } catch {
5524
+ }
5525
+ }
5526
+ }
5527
+ return symlinks;
5528
+ }
5529
+ function removeProviderSymlinks(projectRoot, synapSyncDir) {
5530
+ const symlinks = findSynapSyncSymlinks(projectRoot, synapSyncDir);
5531
+ for (const link of symlinks) {
5532
+ fs14.unlinkSync(link);
5533
+ logger.log(` ${pc16.red("\u2717")} Removed symlink ${path16.relative(projectRoot, link)}`);
5534
+ }
5535
+ return symlinks.length;
5536
+ }
5537
+ function cleanGitignore(projectRoot) {
5538
+ const gitignorePath = path16.join(projectRoot, ".gitignore");
5539
+ if (!fs14.existsSync(gitignorePath)) return false;
5540
+ const content = fs14.readFileSync(gitignorePath, "utf-8");
5541
+ if (!content.includes("# SynapSync")) return false;
5542
+ const cleaned = content.replace(/\n?# SynapSync\n\.synapsync\/manifest\.json\n\*\.local\.yaml\n?/g, "").replace(/^\s*\n$/gm, "\n");
5543
+ if (cleaned.trim() === "") {
5544
+ fs14.unlinkSync(gitignorePath);
5545
+ } else {
5546
+ fs14.writeFileSync(gitignorePath, cleaned, "utf-8");
5547
+ }
5548
+ return true;
5549
+ }
5550
+ function registerPurgeCommand(program) {
5551
+ program.command("purge").description("Completely remove SynapSync from the project").option("-f, --force", "Skip confirmation and remove everything").action((options) => {
5552
+ executePurgeCommand(options);
5553
+ });
5554
+ }
5555
+
5431
5556
  // src/ui/repl.ts
5432
5557
  var COMMANDS = {};
5433
5558
  function registerInteractiveCommand(name, description, handler, options) {
@@ -5444,24 +5569,24 @@ function showCommandHelp(commandName) {
5444
5569
  return;
5445
5570
  }
5446
5571
  logger.line();
5447
- logger.log(pc16.bold(pc16.cyan(` /${commandName}`)) + pc16.dim(` - ${cmd.description}`));
5572
+ logger.log(pc17.bold(pc17.cyan(` /${commandName}`)) + pc17.dim(` - ${cmd.description}`));
5448
5573
  logger.line();
5449
5574
  if (cmd.usage) {
5450
- logger.log(pc16.bold(" Usage:"));
5451
- logger.log(` ${pc16.cyan(cmd.usage)}`);
5575
+ logger.log(pc17.bold(" Usage:"));
5576
+ logger.log(` ${pc17.cyan(cmd.usage)}`);
5452
5577
  logger.line();
5453
5578
  }
5454
5579
  if (cmd.options && cmd.options.length > 0) {
5455
- logger.log(pc16.bold(" Options:"));
5580
+ logger.log(pc17.bold(" Options:"));
5456
5581
  for (const opt of cmd.options) {
5457
- logger.log(` ${pc16.yellow(opt.flag.padEnd(16))} ${pc16.dim(opt.description)}`);
5582
+ logger.log(` ${pc17.yellow(opt.flag.padEnd(16))} ${pc17.dim(opt.description)}`);
5458
5583
  }
5459
5584
  logger.line();
5460
5585
  }
5461
5586
  if (cmd.examples && cmd.examples.length > 0) {
5462
- logger.log(pc16.bold(" Examples:"));
5587
+ logger.log(pc17.bold(" Examples:"));
5463
5588
  for (const example of cmd.examples) {
5464
- logger.log(` ${pc16.dim("$")} ${pc16.cyan(example)}`);
5589
+ logger.log(` ${pc17.dim("$")} ${pc17.cyan(example)}`);
5465
5590
  }
5466
5591
  logger.line();
5467
5592
  }
@@ -5478,17 +5603,17 @@ registerInteractiveCommand(
5478
5603
  logger.line();
5479
5604
  logger.bold(" Available Commands:");
5480
5605
  logger.line();
5481
- logger.log(` ${pc16.cyan("/help [command]")} ${pc16.dim("Show help (or help for a command)")}`);
5482
- logger.log(` ${pc16.cyan("/clear")} ${pc16.dim("Clear the screen")}`);
5483
- logger.log(` ${pc16.cyan("/exit")} ${pc16.dim("Exit interactive mode")}`);
5606
+ logger.log(` ${pc17.cyan("/help [command]")} ${pc17.dim("Show help (or help for a command)")}`);
5607
+ logger.log(` ${pc17.cyan("/clear")} ${pc17.dim("Clear the screen")}`);
5608
+ logger.log(` ${pc17.cyan("/exit")} ${pc17.dim("Exit interactive mode")}`);
5484
5609
  logger.line();
5485
5610
  const categories = {
5486
5611
  "Information": ["info", "version"],
5487
5612
  "Project": ["init", "config", "status"],
5488
5613
  "Providers": ["providers"],
5489
- "Cognitives": ["search", "install", "list", "uninstall", "create"],
5490
- "Sync": ["sync", "push", "pull"],
5491
- "Maintenance": ["update", "doctor", "clean"]
5614
+ "Cognitives": ["search", "add", "list", "uninstall"],
5615
+ "Sync": ["sync"],
5616
+ "Maintenance": ["update", "doctor", "clean", "purge"]
5492
5617
  };
5493
5618
  for (const [category, cmds] of Object.entries(categories)) {
5494
5619
  const availableCmds = cmds.filter((name) => COMMANDS[name]);
@@ -5498,8 +5623,8 @@ registerInteractiveCommand(
5498
5623
  const cmd = COMMANDS[name];
5499
5624
  const hasOptions = cmd?.options !== void 0 && cmd.options.length > 0;
5500
5625
  const paddedName = `/${name}`.padEnd(18);
5501
- const optionsHint = hasOptions ? pc16.yellow(" [options]") : "";
5502
- logger.log(` ${pc16.cyan(paddedName)} ${pc16.dim(cmd?.description ?? "")}${optionsHint}`);
5626
+ const optionsHint = hasOptions ? pc17.yellow(" [options]") : "";
5627
+ logger.log(` ${pc17.cyan(paddedName)} ${pc17.dim(cmd?.description ?? "")}${optionsHint}`);
5503
5628
  }
5504
5629
  logger.line();
5505
5630
  }
@@ -5509,7 +5634,7 @@ registerInteractiveCommand(
5509
5634
  },
5510
5635
  {
5511
5636
  usage: "/help [command]",
5512
- examples: ["/help", "/help info", "/help install"]
5637
+ examples: ["/help", "/help info", "/help add"]
5513
5638
  }
5514
5639
  );
5515
5640
  registerInteractiveCommand("clear", "Clear the screen", (_args) => {
@@ -5532,13 +5657,13 @@ registerInteractiveCommand(
5532
5657
  usage: "/info [--topic]",
5533
5658
  options: [
5534
5659
  { flag: "--cognitives", description: "Types of AI cognitives (skills, agents, etc.)" },
5535
- { flag: "--install", description: "How to install from registry, GitHub, local" },
5660
+ { flag: "--add", description: "How to add from registry, GitHub, local" },
5536
5661
  { flag: "--providers", description: "Supported AI providers" },
5537
5662
  { flag: "--categories", description: "Cognitive organization categories" },
5538
5663
  { flag: "--sync", description: "How synchronization works" },
5539
5664
  { flag: "--structure", description: "Project directory structure" }
5540
5665
  ],
5541
- examples: ["/info", "/info --cognitives", "/info --install"]
5666
+ examples: ["/info", "/info --cognitives", "/info --add"]
5542
5667
  }
5543
5668
  );
5544
5669
  registerInteractiveCommand(
@@ -5644,8 +5769,8 @@ registerInteractiveCommand(
5644
5769
  }
5645
5770
  );
5646
5771
  registerInteractiveCommand(
5647
- "install",
5648
- "Install a cognitive from registry, local path, or GitHub",
5772
+ "add",
5773
+ "Add a cognitive from registry, local path, or GitHub",
5649
5774
  async (args) => {
5650
5775
  const parts = args.split(/\s+/);
5651
5776
  let source;
@@ -5659,33 +5784,29 @@ registerInteractiveCommand(
5659
5784
  options["category"] = parts[++i] ?? "";
5660
5785
  } else if (part === "--force" || part === "-f") {
5661
5786
  options["force"] = true;
5662
- } else if (part === "--sync" || part === "-s") {
5663
- options["sync"] = true;
5664
5787
  } else if (!part.startsWith("-")) {
5665
5788
  source = part;
5666
5789
  }
5667
5790
  }
5668
5791
  if (source === void 0 || source === "") {
5669
- logger.error("Please specify a cognitive to install.");
5670
- logger.hint("Usage: /install <name|path|github:user/repo>");
5792
+ logger.error("Please specify a cognitive to add.");
5793
+ logger.hint("Usage: /add <name|path|github:user/repo>");
5671
5794
  return;
5672
5795
  }
5673
- await executeInstallCommand(source, options);
5796
+ await executeAddCommand(source, options);
5674
5797
  },
5675
5798
  {
5676
- usage: "/install <source> [options]",
5799
+ usage: "/add <source> [options]",
5677
5800
  options: [
5678
5801
  { flag: "-t, --type <type>", description: "Cognitive type (skill, agent, etc.)" },
5679
5802
  { flag: "-c, --category <cat>", description: "Category (overrides default)" },
5680
- { flag: "-f, --force", description: "Overwrite if already installed" },
5681
- { flag: "-s, --sync", description: "Sync to providers after installation" }
5803
+ { flag: "-f, --force", description: "Overwrite if already installed" }
5682
5804
  ],
5683
5805
  examples: [
5684
- "/install skill-creator",
5685
- "/install skill-creator --sync",
5686
- "/install ./my-skill",
5687
- "/install github:user/repo",
5688
- "/install skill-creator --force"
5806
+ "/add skill-creator",
5807
+ "/add ./my-skill",
5808
+ "/add github:user/repo",
5809
+ "/add skill-creator --force"
5689
5810
  ]
5690
5811
  }
5691
5812
  );
@@ -5755,9 +5876,6 @@ registerInteractiveCommand(
5755
5876
  examples: ["/uninstall skill-creator", "/uninstall my-agent --force"]
5756
5877
  }
5757
5878
  );
5758
- registerInteractiveCommand("create", "Create a new asset", (_args) => {
5759
- showInfo("Command not yet implemented. Coming in Phase 2.");
5760
- });
5761
5879
  registerInteractiveCommand(
5762
5880
  "sync",
5763
5881
  "Sync cognitives to providers",
@@ -5810,12 +5928,6 @@ registerInteractiveCommand(
5810
5928
  examples: ["/sync", "/sync status", "/sync --dry-run", "/sync --provider claude"]
5811
5929
  }
5812
5930
  );
5813
- registerInteractiveCommand("push", "Push local cognitives to registry", (_args) => {
5814
- showInfo("Command not yet implemented. Coming in Phase 3.");
5815
- });
5816
- registerInteractiveCommand("pull", "Pull latest cognitives from registry", (_args) => {
5817
- showInfo("Command not yet implemented. Coming in Phase 3.");
5818
- });
5819
5931
  registerInteractiveCommand(
5820
5932
  "update",
5821
5933
  "Update installed cognitives",
@@ -5912,10 +6024,31 @@ registerInteractiveCommand(
5912
6024
  examples: ["/clean", "/clean --dry-run", "/clean --force"]
5913
6025
  }
5914
6026
  );
6027
+ registerInteractiveCommand(
6028
+ "purge",
6029
+ "Completely remove SynapSync from the project",
6030
+ (args) => {
6031
+ const parts = args.split(/\s+/);
6032
+ const options = {};
6033
+ for (const part of parts) {
6034
+ if (part === "--force" || part === "-f") {
6035
+ options["force"] = true;
6036
+ }
6037
+ }
6038
+ executePurgeCommand(options);
6039
+ },
6040
+ {
6041
+ usage: "/purge [options]",
6042
+ options: [
6043
+ { flag: "-f, --force", description: "Skip confirmation and remove everything" }
6044
+ ],
6045
+ examples: ["/purge", "/purge --force"]
6046
+ }
6047
+ );
5915
6048
  registerInteractiveCommand("version", "Show version information", async (_args) => {
5916
6049
  const { version: version2 } = await Promise.resolve().then(() => (init_version(), version_exports));
5917
6050
  logger.line();
5918
- logger.log(`${pc16.bold("SynapSync CLI")} ${pc16.cyan(`v${version2}`)}`);
6051
+ logger.log(`${pc17.bold("SynapSync CLI")} ${pc17.cyan(`v${version2}`)}`);
5919
6052
  logger.line();
5920
6053
  logger.label("Node.js", process.version);
5921
6054
  logger.label("Platform", `${process.platform} ${process.arch}`);
@@ -5928,7 +6061,7 @@ async function executeCommand(input) {
5928
6061
  }
5929
6062
  if (!trimmed.startsWith("/")) {
5930
6063
  showError(`Unknown input. Commands must start with /`);
5931
- logger.log(`${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for available commands.")}`);
6064
+ logger.log(`${pc17.dim("Type")} ${pc17.cyan("/help")} ${pc17.dim("for available commands.")}`);
5932
6065
  return;
5933
6066
  }
5934
6067
  const parts = trimmed.slice(1).split(/\s+/);
@@ -5940,7 +6073,7 @@ async function executeCommand(input) {
5940
6073
  const command = COMMANDS[commandName];
5941
6074
  if (!command) {
5942
6075
  showError(`Unknown command: /${commandName}`);
5943
- logger.log(`${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for available commands.")}`);
6076
+ logger.log(`${pc17.dim("Type")} ${pc17.cyan("/help")} ${pc17.dim("for available commands.")}`);
5944
6077
  return;
5945
6078
  }
5946
6079
  try {
@@ -5956,13 +6089,13 @@ async function executeCommand(input) {
5956
6089
  function startInteractiveMode() {
5957
6090
  showBanner();
5958
6091
  logger.log(
5959
- `${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for commands,")} ${pc16.cyan("/exit")} ${pc16.dim("to quit.")}`
6092
+ `${pc17.dim("Type")} ${pc17.cyan("/help")} ${pc17.dim("for commands,")} ${pc17.cyan("/exit")} ${pc17.dim("to quit.")}`
5960
6093
  );
5961
6094
  logger.line();
5962
6095
  const rl = readline.createInterface({
5963
6096
  input: process.stdin,
5964
6097
  output: process.stdout,
5965
- prompt: `${pc16.green(CLI_NAME)} ${pc16.dim(">")} `,
6098
+ prompt: `${pc17.green(CLI_NAME)} ${pc17.dim(">")} `,
5966
6099
  terminal: true
5967
6100
  });
5968
6101
  rl.on("line", (line) => {
@@ -5988,7 +6121,7 @@ init_version();
5988
6121
 
5989
6122
  // src/commands/help.ts
5990
6123
  init_esm_shims();
5991
- import pc17 from "picocolors";
6124
+ import pc18 from "picocolors";
5992
6125
  function registerHelpCommand(program) {
5993
6126
  program.command("help [command]").description("Display help for a command").action((commandName) => {
5994
6127
  if (commandName) {
@@ -5998,7 +6131,7 @@ function registerHelpCommand(program) {
5998
6131
  } else {
5999
6132
  logger.error(`Unknown command: ${commandName}`);
6000
6133
  logger.line();
6001
- logger.log(`Run ${pc17.cyan("synapsync --help")} to see available commands.`);
6134
+ logger.log(`Run ${pc18.cyan("synapsync --help")} to see available commands.`);
6002
6135
  }
6003
6136
  } else {
6004
6137
  program.outputHelp();
@@ -6009,7 +6142,7 @@ function registerHelpCommand(program) {
6009
6142
  // src/commands/version.ts
6010
6143
  init_esm_shims();
6011
6144
  init_version();
6012
- import pc18 from "picocolors";
6145
+ import pc19 from "picocolors";
6013
6146
  var PACKAGE_NAME = "synapsync";
6014
6147
  function compareVersions(a, b) {
6015
6148
  const partsA = a.split(".").map(Number);
@@ -6050,12 +6183,12 @@ async function checkForUpdates() {
6050
6183
  const comparison = compareVersions(version, latestVersion);
6051
6184
  if (comparison < 0) {
6052
6185
  logger.line();
6053
- logger.warning(`Update available: ${pc18.cyan(`v${version}`)} \u2192 ${pc18.green(`v${latestVersion}`)}`);
6186
+ logger.warning(`Update available: ${pc19.cyan(`v${version}`)} \u2192 ${pc19.green(`v${latestVersion}`)}`);
6054
6187
  logger.line();
6055
- logger.log(` Run ${pc18.cyan("npm install -g synapsync")} to update`);
6188
+ logger.log(` Run ${pc19.cyan("npm install -g synapsync")} to update`);
6056
6189
  } else if (comparison > 0) {
6057
- logger.info(`You are running a development version (${pc18.cyan(`v${version}`)})`);
6058
- logger.log(` Latest published: ${pc18.dim(`v${latestVersion}`)}`);
6190
+ logger.info(`You are running a development version (${pc19.cyan(`v${version}`)})`);
6191
+ logger.log(` Latest published: ${pc19.dim(`v${latestVersion}`)}`);
6059
6192
  } else {
6060
6193
  logger.success("You are using the latest version");
6061
6194
  }
@@ -6063,7 +6196,7 @@ async function checkForUpdates() {
6063
6196
  function registerVersionCommand(program) {
6064
6197
  program.command("version").description("Show detailed version information").option("--check", "Check for available updates").action(async (options) => {
6065
6198
  logger.line();
6066
- logger.log(`${pc18.bold("SynapSync CLI")} ${pc18.cyan(`v${version}`)}`);
6199
+ logger.log(`${pc19.bold("SynapSync CLI")} ${pc19.cyan(`v${version}`)}`);
6067
6200
  logger.line();
6068
6201
  logger.label("Node.js", process.version);
6069
6202
  logger.label("Platform", `${process.platform} ${process.arch}`);
@@ -6091,13 +6224,14 @@ function createCLI() {
6091
6224
  registerStatusCommand(program);
6092
6225
  registerProvidersCommand(program);
6093
6226
  registerSearchCommand(program);
6094
- registerInstallCommand(program);
6227
+ registerAddCommand(program);
6095
6228
  registerListCommand(program);
6096
6229
  registerUninstallCommand(program);
6097
6230
  registerSyncCommand(program);
6098
6231
  registerUpdateCommand(program);
6099
6232
  registerDoctorCommand(program);
6100
6233
  registerCleanCommand(program);
6234
+ registerPurgeCommand(program);
6101
6235
  return program;
6102
6236
  }
6103
6237
  async function runCLI(args = process.argv) {