@1mancompany/onemancompany 0.2.399 → 0.2.403

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/bin/cli.js +18 -4
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -392,10 +392,22 @@ ${green("What gets installed automatically:")}
392
392
  if (isInitCmd || !initComplete) {
393
393
  if (isAutoInit) {
394
394
  // ── Auto-init: read .env, confirm with user, then run ──────────
395
- const envPath = path.join(installDir, ".env");
396
- if (!fs.existsSync(envPath)) {
395
+ // Search .env: user CWD first, then installDir
396
+ const cwdEnvPath = path.join(process.cwd(), ".env");
397
+ const installEnvPath = path.join(installDir, ".env");
398
+ let envPath;
399
+ if (fs.existsSync(cwdEnvPath)) {
400
+ envPath = cwdEnvPath;
401
+ // Copy to installDir so Python onboard.py can find it
402
+ if (cwdEnvPath !== installEnvPath) {
403
+ fs.copyFileSync(cwdEnvPath, installEnvPath);
404
+ info(`Copied .env from ${process.cwd()} to ${installDir}`);
405
+ }
406
+ } else if (fs.existsSync(installEnvPath)) {
407
+ envPath = installEnvPath;
408
+ } else {
397
409
  fail(
398
- `.env file not found at ${envPath}\n` +
410
+ `.env file not found in ${process.cwd()} or ${installDir}\n` +
399
411
  " Auto-init requires a .env file with your configuration.\n" +
400
412
  " Run interactive setup instead: npx @1mancompany/onemancompany init"
401
413
  );
@@ -461,7 +473,9 @@ ${green("What gets installed automatically:")}
461
473
  }
462
474
 
463
475
  info("Running auto-init from .env...\n");
464
- const initResult = spawnSync(pythonBin, ["-m", "onemancompany.onboard", "--auto"], {
476
+ // Always pass -y: JS already handled confirmation (or user passed -y)
477
+ const initArgs = ["-m", "onemancompany.onboard", "--auto", "-y"];
478
+ const initResult = spawnSync(pythonBin, initArgs, {
465
479
  cwd: installDir,
466
480
  stdio: "inherit",
467
481
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1mancompany/onemancompany",
3
- "version": "0.2.399",
3
+ "version": "0.2.403",
4
4
  "description": "The AI Operating System for One-Person Companies",
5
5
  "bin": {
6
6
  "onemancompany": "bin/cli.js"