@1mancompany/onemancompany 0.2.521 → 0.2.522
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/bin/cli.js +22 -4
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -283,9 +283,19 @@ ${green("What gets installed automatically:")}
|
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
+
// Read version from package.json (bundled with npm package)
|
|
287
|
+
let cliVersion = "unknown";
|
|
288
|
+
try {
|
|
289
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf-8"));
|
|
290
|
+
if (pkg.version) cliVersion = pkg.version;
|
|
291
|
+
} catch {}
|
|
292
|
+
|
|
286
293
|
console.log();
|
|
294
|
+
const verTag = `v${cliVersion}`;
|
|
295
|
+
const title = `OneManCompany — AI Company OS ${verTag}`;
|
|
296
|
+
const pad = Math.max(0, 45 - title.length);
|
|
287
297
|
console.log(cyan("╔═══════════════════════════════════════════════╗"));
|
|
288
|
-
console.log(cyan("
|
|
298
|
+
console.log(cyan(`║ ${title}${" ".repeat(pad)}║`));
|
|
289
299
|
console.log(cyan("╚═══════════════════════════════════════════════╝"));
|
|
290
300
|
console.log();
|
|
291
301
|
|
|
@@ -334,6 +344,14 @@ ${green("What gets installed automatically:")}
|
|
|
334
344
|
run(`git clone --depth 1 ${REPO_URL} "${installDir}"`, { env: cloneEnv });
|
|
335
345
|
}
|
|
336
346
|
|
|
347
|
+
// ── Read actual version from repo (may differ from npm package) ──────
|
|
348
|
+
let appVersion = cliVersion;
|
|
349
|
+
try {
|
|
350
|
+
const pyproject = fs.readFileSync(path.join(installDir, "pyproject.toml"), "utf-8");
|
|
351
|
+
const verMatch = pyproject.match(/^version\s*=\s*"([^"]+)"/m);
|
|
352
|
+
if (verMatch) appVersion = verMatch[1];
|
|
353
|
+
} catch {}
|
|
354
|
+
|
|
337
355
|
// ── Check if already running ─────────────────────────────────────────
|
|
338
356
|
const existingPid = readPidFile(installDir);
|
|
339
357
|
if (existingPid && isProcessRunning(existingPid)) {
|
|
@@ -505,7 +523,7 @@ ${green("What gets installed automatically:")}
|
|
|
505
523
|
|
|
506
524
|
if (debugMode) {
|
|
507
525
|
// ── Foreground mode: show logs, Ctrl+C to kill ──────────────────
|
|
508
|
-
info(
|
|
526
|
+
info(`Starting OneManCompany v${appVersion} in debug mode (Ctrl+C to stop)...\n`);
|
|
509
527
|
const child = spawn(pythonBin, ["-m", "onemancompany.main", ...launchArgs], {
|
|
510
528
|
cwd: installDir,
|
|
511
529
|
stdio: "inherit",
|
|
@@ -521,7 +539,7 @@ ${green("What gets installed automatically:")}
|
|
|
521
539
|
process.on("SIGTERM", () => { child.kill("SIGTERM"); });
|
|
522
540
|
} else {
|
|
523
541
|
// ── Background mode: detach and exit CLI ────────────────────────
|
|
524
|
-
info(
|
|
542
|
+
info(`Starting OneManCompany v${appVersion} in background...`);
|
|
525
543
|
const logFile = path.join(installDir, ".onemancompany", "server.log");
|
|
526
544
|
// Ensure log directory exists
|
|
527
545
|
const logDir = path.dirname(logFile);
|
|
@@ -544,7 +562,7 @@ ${green("What gets installed automatically:")}
|
|
|
544
562
|
await new Promise((r) => setTimeout(r, 5000));
|
|
545
563
|
if (isProcessRunning(child.pid)) {
|
|
546
564
|
console.log();
|
|
547
|
-
console.log(green(
|
|
565
|
+
console.log(green(` ✓ OneManCompany v${appVersion} is running!`));
|
|
548
566
|
console.log();
|
|
549
567
|
console.log(` ${cyan("→")} Open ${cyan("http://localhost:8000")} in your browser`);
|
|
550
568
|
console.log(` ${dim(" Logs:")} ${logFile}`);
|