great-cto 1.0.156 → 1.0.157

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/main.js +66 -1
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -19,6 +19,8 @@ import { bootstrap } from "./bootstrap.js";
19
19
  function parseArgs(argv) {
20
20
  const args = {
21
21
  command: "init",
22
+ boardPort: 3141,
23
+ boardNoOpen: false,
22
24
  dir: process.cwd(),
23
25
  yes: false,
24
26
  dryRun: false,
@@ -43,6 +45,12 @@ function parseArgs(argv) {
43
45
  args.archetype = argv[++i] ?? null;
44
46
  else if (a === "--version-tag")
45
47
  args.version = argv[++i] ?? null;
48
+ else if (a === "--port")
49
+ args.boardPort = parseInt(argv[++i] ?? "3141", 10);
50
+ else if (a === "--no-open")
51
+ args.boardNoOpen = true;
52
+ else if (a === "board")
53
+ args.command = "board";
46
54
  else if (a.startsWith("--dir="))
47
55
  args.dir = a.slice("--dir=".length);
48
56
  else if (a === "--dir")
@@ -56,14 +64,61 @@ function parseArgs(argv) {
56
64
  args.dir = resolve(args.dir);
57
65
  return args;
58
66
  }
67
+ async function runBoard(args) {
68
+ const { join, dirname } = await import("node:path");
69
+ const { fileURLToPath } = await import("node:url");
70
+ const { existsSync } = await import("node:fs");
71
+ const { spawn } = await import("node:child_process");
72
+ // Find board server: relative to this file (dist/) → packages/board/server.mjs
73
+ const { homedir } = await import("node:os");
74
+ const { readdirSync } = await import("node:fs");
75
+ const here = dirname(fileURLToPath(import.meta.url));
76
+ const candidates = [
77
+ join(here, "..", "..", "board", "server.mjs"), // from packages/cli/dist (dev)
78
+ join(here, "..", "board", "server.mjs"), // alt dev layout
79
+ join(here, "board", "server.mjs"), // flat layout
80
+ ];
81
+ // Also search plugin cache (installed via npx great-cto)
82
+ const pluginBase = join(homedir(), ".claude", "plugins", "cache", "local", "great_cto");
83
+ if (existsSync(pluginBase)) {
84
+ try {
85
+ const versions = readdirSync(pluginBase).filter(v => /^\d/.test(v)).sort().reverse();
86
+ for (const v of versions.slice(0, 5)) {
87
+ candidates.push(join(pluginBase, v, "packages", "board", "server.mjs"));
88
+ }
89
+ }
90
+ catch { /* ignore */ }
91
+ }
92
+ const serverPath = candidates.find(existsSync);
93
+ if (!serverPath) {
94
+ error("Board server not found. Try reinstalling: npx great-cto@latest");
95
+ return 1;
96
+ }
97
+ const nodeArgs = [serverPath];
98
+ if (args.boardNoOpen)
99
+ nodeArgs.push("--no-open");
100
+ const child = spawn(process.execPath, nodeArgs, {
101
+ env: { ...process.env, BOARD_PORT: String(args.boardPort) },
102
+ stdio: "inherit",
103
+ detached: false,
104
+ });
105
+ child.on("exit", code => process.exit(code ?? 0));
106
+ return 0;
107
+ }
59
108
  function printHelp() {
60
109
  log(`${bold("great-cto")} — one-command install for the great_cto Claude Code plugin
61
110
 
62
111
  ${bold("Usage:")}
63
- npx great-cto init [options]
112
+ npx great-cto [init] [options]
113
+ npx great-cto board [--port 3141] [--no-open]
64
114
  npx great-cto help
65
115
  npx great-cto version
66
116
 
117
+ ${bold("Board:")}
118
+ great-cto board Open Kanban + CTO Dashboard at localhost:3141
119
+ great-cto board --port 4000 Use a different port
120
+ great-cto board --no-open Start server without opening browser
121
+
67
122
  ${bold("Options:")}
68
123
  -y, --yes Skip confirmation prompts (non-interactive)
69
124
  --dry-run Show what would be done without doing it
@@ -345,6 +400,16 @@ async function main() {
345
400
  printHelp();
346
401
  process.exit(0);
347
402
  }
403
+ if (args.command === "board") {
404
+ try {
405
+ const code = await runBoard(args);
406
+ process.exit(code);
407
+ }
408
+ catch (e) {
409
+ error(e.message);
410
+ process.exit(1);
411
+ }
412
+ }
348
413
  if (args.command === "version") {
349
414
  // Version resolved in index.mjs or from package.json at runtime
350
415
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "great-cto",
3
- "version": "1.0.156",
3
+ "version": "1.0.157",
4
4
  "description": "One command install for the great_cto Claude Code plugin. Auto-detects your stack, picks the right archetype, bootstraps PROJECT.md.",
5
5
  "keywords": [
6
6
  "claude-code",