@tommy-ca/lazypi 0.6.4 → 0.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.
package/README.md CHANGED
@@ -54,6 +54,12 @@ There is nothing to "uninstall" for LazyPi itself — `npx` doesn't leave it aro
54
54
 
55
55
  Run the built-in health check with `npx @tommy-ca/lazypi doctor`.
56
56
 
57
+ **Stale `bunx` after a release?** bun caches resolved package versions, so a
58
+ bare `bunx @tommy-ca/lazypi` can keep serving the previous release until the
59
+ cache is cleared. Run `bun pm cache rm`, pin `@tommy-ca/lazypi@latest`, and
60
+ check `npx @tommy-ca/lazypi --version` to see which release is actually
61
+ running.
62
+
57
63
  ## Site / docs
58
64
 
59
65
  The site at [lazypi.org](https://lazypi.org) lives in `docs/` and is a Jekyll site compiled by GitHub Pages automatically on push to `master`.
package/bin/lazypi.mjs CHANGED
@@ -95,6 +95,8 @@ function parseArgs(args) {
95
95
  local: false,
96
96
  yes: false,
97
97
  help: false,
98
+ badArg: false,
99
+ version: false,
98
100
  only: null,
99
101
  except: null,
100
102
  targets: [],
@@ -110,6 +112,7 @@ function parseArgs(args) {
110
112
  const arg = args[i];
111
113
  if (arg === "-l" || arg === "--local") flags.local = true;
112
114
  else if (arg === "-y" || arg === "--yes") flags.yes = true;
115
+ else if (arg === "-V" || arg === "--version") flags.version = true;
113
116
  else if (arg === "-h" || arg === "--help") flags.help = true;
114
117
  else if (arg === "--only") flags.only = parseList(args[++i]);
115
118
  else if (arg.startsWith("--only=")) flags.only = parseList(arg.slice("--only=".length));
@@ -119,6 +122,7 @@ function parseArgs(args) {
119
122
  else {
120
123
  console.error(red(`Unknown argument: ${arg}`));
121
124
  flags.help = true;
125
+ flags.badArg = true;
122
126
  break;
123
127
  }
124
128
  }
@@ -183,6 +187,7 @@ ${bold("Install options:")}
183
187
  -l, --local Install into the current project (.pi/settings.json)
184
188
  -y, --yes Skip the picker and any confirmation prompt
185
189
  -h, --help Show this help
190
+ -V, --version Show the installed version
186
191
 
187
192
  ${bold("Default behaviour:")}
188
193
  - Every catalog package is installed (lazy on purpose).
@@ -208,6 +213,7 @@ ${bold("Examples:")}
208
213
  // ---------------------------------------------------------------------------
209
214
  // Pi / settings plumbing
210
215
  // ---------------------------------------------------------------------------
216
+ const VERSION = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
211
217
  // On Windows, package-manager CLIs and global Node bins are usually `.cmd`
212
218
  // shims. Node's child_process docs note that those need to be launched via a
213
219
  // shell, so we route spawned commands through the platform shell there while
@@ -338,7 +344,7 @@ function removeLegacy(pkg, installedPiSources, local, interactive) {
338
344
  const action = `pi remove ${legacySource}`;
339
345
  if (interactive) log.step(action);
340
346
  else console.log(`\n→ ${action}`);
341
- status = spawnCommand("pi", local ? ["remove", "-l", legacySource] : ["remove", legacySource], { stdio: "inherit" }).status ?? 1;
347
+ status = spawnCommand("pi", local ? ["remove", "-l", "--approve", legacySource] : ["remove", legacySource], { stdio: "inherit" }).status ?? 1;
342
348
  if (status !== 0) break;
343
349
  }
344
350
  return status;
@@ -595,7 +601,7 @@ async function cmdInstall(flags) {
595
601
  return 0;
596
602
  }
597
603
 
598
- const piArgs = flags.local ? ["install", "-l"] : ["install"];
604
+ const piArgs = flags.local ? ["install", "-l", "--approve"] : ["install"];
599
605
 
600
606
  for (const pkg of toInstall) {
601
607
  const migrationStatus = removeLegacy(pkg, installedSources, flags.local, interactive);
@@ -853,7 +859,7 @@ async function cmdRemove(flags, targets) {
853
859
  : [source];
854
860
  const uniqueSources = [...new Set(sourcesToRemove.length > 0 ? sourcesToRemove : [source])];
855
861
  for (const resolvedSource of uniqueSources) {
856
- const piArgs = flags.local ? ["remove", "-l", resolvedSource] : ["remove", resolvedSource];
862
+ const piArgs = flags.local ? ["remove", "-l", "--approve", resolvedSource] : ["remove", resolvedSource];
857
863
  const result = spawnCommand("pi", piArgs, { stdio: "inherit" });
858
864
  if (result.status !== 0) {
859
865
  console.error(red(`Failed to remove ${target}`));
@@ -870,9 +876,13 @@ async function cmdRemove(flags, targets) {
870
876
  // ---------------------------------------------------------------------------
871
877
  async function main() {
872
878
  const flags = parseArgs(argv.slice(2));
879
+ if (flags.version) {
880
+ console.log(`@tommy-ca/lazypi ${VERSION}`);
881
+ return 0;
882
+ }
873
883
  if (flags.help) {
874
884
  printHelp();
875
- return 0;
885
+ return flags.badArg ? 2 : 0;
876
886
  }
877
887
  switch (flags.command) {
878
888
  case "install":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tommy-ca/lazypi",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "description": "Opinionated one-shot installer for a full-featured Pi coding agent setup.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,5 +41,8 @@
41
41
  ],
42
42
  "devDependencies": {
43
43
  "@fission-ai/openspec": "^1.11.0"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
44
47
  }
45
48
  }