lytos-cli 0.3.0 → 0.3.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.
Files changed (2) hide show
  1. package/dist/cli.js +20 -3
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  // src/cli.ts
4
4
  import { Command as Command3 } from "commander";
5
+ import { execSync } from "child_process";
6
+ import { createRequire } from "module";
5
7
 
6
8
  // src/commands/init.ts
7
9
  import { Command } from "commander";
@@ -1245,17 +1247,19 @@ async function checkForUpdates(currentVersion) {
1245
1247
  ` ${yellow("\u26A0")} Update available: ${dim(currentVersion)} \u2192 ${bold(latest)}`
1246
1248
  );
1247
1249
  console.error(
1248
- ` Run ${bold("npm install -g lytos-cli")} to update`
1250
+ ` Run ${bold("lyt update")} to update`
1249
1251
  );
1250
1252
  console.error("");
1251
1253
  }
1252
1254
  }
1253
1255
 
1254
1256
  // src/cli.ts
1257
+ var require2 = createRequire(import.meta.url);
1258
+ var { version: VERSION } = require2("../package.json");
1255
1259
  var program = new Command3();
1256
1260
  program.name("lyt").description(
1257
1261
  "CLI tool for Lytos \u2014 a human-first method for working with AI agents"
1258
- ).version("0.2.1");
1262
+ ).version(VERSION);
1259
1263
  program.addCommand(initCommand);
1260
1264
  program.addCommand(boardCommand);
1261
1265
  program.command("lint").description("Validate .lytos/ structure and content (coming soon)").action(() => {
@@ -1270,6 +1274,19 @@ program.command("status").description("Display sprint DAG in terminal (coming so
1270
1274
  console.error("Coming soon. Follow https://github.com/getlytos/lytos-cli for updates.");
1271
1275
  process.exit(0);
1272
1276
  });
1273
- var VERSION = "0.2.1";
1277
+ program.command("update").description("Update lytos-cli to the latest version").action(() => {
1278
+ console.error(`
1279
+ ${bold("Updating lytos-cli...")}
1280
+ `);
1281
+ try {
1282
+ execSync("npm install -g lytos-cli@latest", { stdio: "inherit" });
1283
+ const newVersion = execSync("lyt --version", { encoding: "utf-8" }).trim();
1284
+ console.error("");
1285
+ ok(`Updated to ${green(newVersion)}`);
1286
+ } catch {
1287
+ error("Update failed. Try manually: npm install -g lytos-cli@latest");
1288
+ process.exit(1);
1289
+ }
1290
+ });
1274
1291
  program.parse();
1275
1292
  checkForUpdates(VERSION);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lytos-cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "CLI tool for Lytos — a human-first method for working with AI agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  "type": "git",
40
40
  "url": "git+https://github.com/getlytos/lytos-cli.git"
41
41
  },
42
- "homepage": "https://github.com/getlytos/lytos-method",
42
+ "homepage": "https://lytos.org",
43
43
  "bugs": {
44
44
  "url": "https://github.com/getlytos/lytos-cli/issues"
45
45
  },