nlos 1.6.0 → 1.7.0

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.
Files changed (2) hide show
  1. package/bin/nlos.js +70 -0
  2. package/package.json +1 -1
package/bin/nlos.js CHANGED
@@ -477,6 +477,69 @@ function payload(options = {}) {
477
477
  }
478
478
  }
479
479
 
480
+ function clean(options = {}) {
481
+ const { local = false, all = false } = options;
482
+
483
+ log('blue', 'Cleaning NL-OS...\n');
484
+
485
+ // Remove Ollama model
486
+ log('yellow', 'Removing Ollama model...');
487
+ try {
488
+ execSync('ollama rm nlos-kernel:latest', { stdio: 'pipe' });
489
+ log('green', ' [removed] nlos-kernel:latest');
490
+ } catch {
491
+ log('cyan', ' [skip] nlos-kernel:latest not found');
492
+ }
493
+
494
+ // Clean local workspace files if --local or --all
495
+ if (local || all) {
496
+ const targetDir = process.cwd();
497
+ const localFiles = [
498
+ 'KERNEL.md',
499
+ 'memory.md',
500
+ 'AGENTS.md',
501
+ 'axioms.yaml',
502
+ 'personalities.md',
503
+ '.nlos.yaml',
504
+ ];
505
+ const localDirs = ['commands'];
506
+
507
+ log('yellow', 'Removing local workspace files...');
508
+ for (const file of localFiles) {
509
+ const filePath = path.join(targetDir, file);
510
+ if (fs.existsSync(filePath)) {
511
+ fs.unlinkSync(filePath);
512
+ log('green', ` [removed] ${file}`);
513
+ }
514
+ }
515
+ for (const dir of localDirs) {
516
+ const dirPath = path.join(targetDir, dir);
517
+ if (fs.existsSync(dirPath)) {
518
+ fs.rmSync(dirPath, { recursive: true });
519
+ log('green', ` [removed] ${dir}/`);
520
+ }
521
+ }
522
+ }
523
+
524
+ // Uninstall global package if --all
525
+ if (all) {
526
+ log('yellow', 'Uninstalling global package...');
527
+ console.log();
528
+ log('cyan', 'Run this command to complete uninstall:');
529
+ console.log(` npm uninstall -g nlos\n`);
530
+ log('yellow', '(Cannot self-uninstall while running)');
531
+ }
532
+
533
+ console.log();
534
+ log('green', 'Clean complete!\n');
535
+
536
+ if (!local && !all) {
537
+ console.log(`${colors.yellow}Options:${colors.reset}`);
538
+ console.log(` nlos clean --local Also remove local workspace files`);
539
+ console.log(` nlos clean --all Remove everything (local + instructions for global)`);
540
+ }
541
+ }
542
+
480
543
  function init(options = {}) {
481
544
  const targetDir = process.cwd();
482
545
 
@@ -604,6 +667,7 @@ ${colors.yellow}Usage:${colors.reset}
604
667
  ${colors.yellow}Commands:${colors.reset}
605
668
  init Initialize NL-OS workspace in current directory
606
669
  chat Interactive NL-OS chat session (recommended)
670
+ clean Remove Ollama model and optionally local files
607
671
  boot Boot NL-OS and verify kernel loads
608
672
  payload Generate portable kernel payloads
609
673
  verify Verify kernel files exist
@@ -669,6 +733,8 @@ function parseArgs(args) {
669
733
  options.dryRun = true;
670
734
  } else if (arg === '--all') {
671
735
  options.all = true;
736
+ } else if (arg === '--local') {
737
+ options.local = true;
672
738
  }
673
739
 
674
740
  i++;
@@ -687,6 +753,10 @@ switch (command) {
687
753
  init(options);
688
754
  break;
689
755
 
756
+ case 'clean':
757
+ clean(options);
758
+ break;
759
+
690
760
  case 'chat':
691
761
  chat(options);
692
762
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nlos",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Natural Language Operating System - A model-agnostic kernel for any LLM",
5
5
  "main": "bin/nlos.js",
6
6
  "bin": {