akili-specs 2.4.0 → 2.4.2

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/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@ The format is inspired by Keep a Changelog and the repository follows semantic v
10
10
 
11
11
  - No unreleased changes yet.
12
12
 
13
+ ## [2.4.2] - 2026-07-19
14
+
15
+ ### Changed
16
+ - **Update banner now suggests `akili update`:** The auto-update checker banner now recommends running `akili update` instead of `npm install -g akili-specs`, since `akili update` handles both the npm package update and file reinstallation.
17
+ ## [2.4.1] - 2026-07-19
18
+
19
+ ### Fixed
20
+ - **`akili update` now updates the npm package:** Previously `akili update` only reinstalled files from the already-installed version. Now it detects the installation type (global, local, or npx), runs `npm install -g akili-specs@latest` or `npm install akili-specs@latest` accordingly, and then reinstalls files with `--force`.
13
21
  ## [2.4.0] - 2026-07-19
14
22
 
15
23
  ### Added
package/bin/akili.js CHANGED
@@ -5,6 +5,8 @@ const os = require("os");
5
5
  const path = require("path");
6
6
  const { parseArgs } = require("util");
7
7
 
8
+ const { execSync } = require("child_process");
9
+
8
10
  const PACKAGE_ROOT = path.resolve(__dirname, "..");
9
11
  const SOURCE_CLAUDE = path.join(PACKAGE_ROOT, ".claude");
10
12
  const SOURCE_COMMANDS = path.join(SOURCE_CLAUDE, "commands");
@@ -76,7 +78,7 @@ Usage:
76
78
 
77
79
  Commands:
78
80
  install Install commands, skills, and helper resources
79
- update Reinstall commands, skills, and helper resources
81
+ update Update npm package to latest version and reinstall files
80
82
  doctor Check whether expected files are installed
81
83
  list List packaged commands, skills, and helper resources
82
84
  help Show this help
@@ -382,6 +384,52 @@ function installTool(tool, args) {
382
384
  return { installed, skipped };
383
385
  }
384
386
 
387
+ function detectInstallType() {
388
+ try {
389
+ const globalList = execSync("npm list -g akili-specs --depth=0 2>/dev/null", { encoding: "utf8" });
390
+ if (globalList.includes("akili-specs")) return "global";
391
+ } catch (e) {}
392
+
393
+ try {
394
+ const localList = execSync("npm list akili-specs --depth=0 2>/dev/null", { encoding: "utf8" });
395
+ if (localList.includes("akili-specs")) return "local";
396
+ } catch (e) {}
397
+
398
+ return "npx";
399
+ }
400
+
401
+ function runUpdate(args) {
402
+ const installType = detectInstallType();
403
+
404
+ console.log(`\n${colors.cyan}Detected installation type: ${installType}${colors.reset}`);
405
+
406
+ if (installType === "npx") {
407
+ console.log(`\n${colors.yellow}You are running via npx. No persistent installation to update.${colors.reset}`);
408
+ console.log(`To install globally: ${colors.cyan}npm install -g akili-specs${colors.reset}`);
409
+ console.log(`To install locally: ${colors.cyan}npm install akili-specs${colors.reset}`);
410
+ return;
411
+ }
412
+
413
+ console.log(`\n${colors.yellow}Updating npm package...${colors.reset}`);
414
+
415
+ try {
416
+ if (installType === "global") {
417
+ execSync("npm install -g akili-specs@latest", { stdio: "inherit" });
418
+ } else {
419
+ execSync("npm install akili-specs@latest", { stdio: "inherit" });
420
+ }
421
+
422
+ console.log(`\n${colors.green}npm package updated successfully.${colors.reset}`);
423
+ } catch (e) {
424
+ console.error(`\n${colors.red}Failed to update npm package.${colors.reset}`);
425
+ process.exit(1);
426
+ }
427
+
428
+ console.log(`\n${colors.yellow}Reinstalling files with --force...${colors.reset}`);
429
+ args.force = true;
430
+ runInstall(args);
431
+ }
432
+
385
433
  function runInstall(args) {
386
434
  let installed = 0;
387
435
  let skipped = 0;
@@ -541,22 +589,16 @@ function checkForUpdates() {
541
589
  if (isNewer) {
542
590
  const border = `╭─────────────────────────────────────────────────────────────╮`;
543
591
  const emptyLine = `│ │`;
544
- const msgLine1 = `│ ${colors.yellow}Update available!${colors.reset} ${colors.red}${currentVersion}${colors.reset} → ${colors.green}${latestVersion}${colors.reset}`;
545
- const msgLine2 = `│ Run ${colors.cyan}npm install -g akili-specs${colors.reset} to update.`;
546
592
 
547
- // Pad to keep the box neat (very rudimentary padding, assumes specific length of colors)
548
- // Just manually aligning for aesthetic since console length with escape codes is tricky
549
593
  console.log(`\n${colors.yellow}${border}`);
550
594
  console.log(`${emptyLine}`);
551
- // 61 total chars inside.
552
- // "Update available! x.x.x -> y.y.y"
553
595
  const rawStr1 = ` Update available! ${currentVersion} -> ${latestVersion}`;
554
596
  const pad1 = " ".repeat(Math.max(0, 61 - rawStr1.length));
555
597
  console.log(`│ ${colors.yellow}Update available!${colors.reset} ${colors.red}${currentVersion}${colors.reset} → ${colors.green}${latestVersion}${colors.reset}${pad1}│`);
556
598
 
557
- const rawStr2 = ` Run npm install -g akili-specs to update.`;
599
+ const rawStr2 = ` Run akili update to upgrade.`;
558
600
  const pad2 = " ".repeat(Math.max(0, 61 - rawStr2.length));
559
- console.log(`│ Run ${colors.cyan}npm install -g akili-specs${colors.reset} to update.${pad2}│`);
601
+ console.log(`│ Run ${colors.cyan}akili update${colors.reset} to upgrade.${pad2}│`);
560
602
  console.log(`${emptyLine}`);
561
603
  console.log(`╰─────────────────────────────────────────────────────────────╯${colors.reset}\n`);
562
604
  }
@@ -656,9 +698,11 @@ async function main() {
656
698
 
657
699
  switch (args.command) {
658
700
  case "install":
659
- case "update":
660
701
  runInstall(args);
661
702
  break;
703
+ case "update":
704
+ runUpdate(args);
705
+ break;
662
706
  case "doctor":
663
707
  runDoctor(args);
664
708
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akili-specs",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "Portable AKILI-SPECS methodology commands and skills for AI-assisted development.",
5
5
  "homepage": "https://github.com/JuankCadavid/akili-specs#readme",
6
6
  "repository": {