forgecraft 1.2.0 → 1.3.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/dist/cli/index.js
CHANGED
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
parseAttachments,
|
|
14
14
|
stageAttachments,
|
|
15
15
|
stateManager
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-YP5E2NQR.js";
|
|
17
17
|
|
|
18
18
|
// src/cli/index.ts
|
|
19
19
|
import { Command } from "commander";
|
|
20
|
-
import
|
|
20
|
+
import chalk21 from "chalk";
|
|
21
21
|
|
|
22
22
|
// src/cli/commands/init.ts
|
|
23
23
|
import fs from "fs/promises";
|
|
@@ -662,7 +662,8 @@ import { homedir } from "os";
|
|
|
662
662
|
import path3 from "path";
|
|
663
663
|
function checkClaudeAuth() {
|
|
664
664
|
try {
|
|
665
|
-
|
|
665
|
+
const finder = process.platform === "win32" ? "where" : "which";
|
|
666
|
+
execSync(`${finder} claude`, { stdio: "ignore" });
|
|
666
667
|
} catch {
|
|
667
668
|
return { ok: false, reason: "Claude Code CLI is not installed." };
|
|
668
669
|
}
|
|
@@ -982,7 +983,8 @@ import { homedir as homedir2 } from "os";
|
|
|
982
983
|
import path4 from "path";
|
|
983
984
|
function checkCommand(cmd) {
|
|
984
985
|
try {
|
|
985
|
-
|
|
986
|
+
const finder = process.platform === "win32" ? "where" : "which";
|
|
987
|
+
execSync2(`${finder} ${cmd}`, { stdio: "ignore" });
|
|
986
988
|
return true;
|
|
987
989
|
} catch {
|
|
988
990
|
return false;
|
|
@@ -1433,11 +1435,66 @@ async function pushCommand() {
|
|
|
1433
1435
|
}
|
|
1434
1436
|
}
|
|
1435
1437
|
|
|
1438
|
+
// src/cli/commands/upgrade.ts
|
|
1439
|
+
import chalk20 from "chalk";
|
|
1440
|
+
import ora5 from "ora";
|
|
1441
|
+
import { execSync as execSync3 } from "child_process";
|
|
1442
|
+
async function upgradeCommand() {
|
|
1443
|
+
const currentVersion = getCurrentVersion();
|
|
1444
|
+
console.log(chalk20.bold("\n forge") + chalk20.dim(" upgrade\n"));
|
|
1445
|
+
const checkSpinner = ora5({ text: "Checking for updates...", indent: 2 }).start();
|
|
1446
|
+
let latestVersion;
|
|
1447
|
+
try {
|
|
1448
|
+
latestVersion = execSync3("npm view forgecraft version", { encoding: "utf-8" }).trim();
|
|
1449
|
+
} catch {
|
|
1450
|
+
checkSpinner.fail("Could not check for updates");
|
|
1451
|
+
console.log(chalk20.dim(" Check your internet connection and try again.\n"));
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
if (currentVersion === latestVersion) {
|
|
1455
|
+
checkSpinner.succeed(`Already on latest version (${currentVersion})`);
|
|
1456
|
+
console.log("");
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
checkSpinner.succeed(`Update available: ${chalk20.dim(currentVersion)} \u2192 ${chalk20.green(latestVersion)}`);
|
|
1460
|
+
const upgradeSpinner = ora5({ text: `Installing forgecraft@${latestVersion}...`, indent: 2 }).start();
|
|
1461
|
+
try {
|
|
1462
|
+
execSync3("npm install -g forgecraft@latest", {
|
|
1463
|
+
stdio: "pipe",
|
|
1464
|
+
encoding: "utf-8"
|
|
1465
|
+
});
|
|
1466
|
+
upgradeSpinner.succeed(`Upgraded to ${chalk20.green(latestVersion)}`);
|
|
1467
|
+
console.log(chalk20.dim(`
|
|
1468
|
+
Run ${chalk20.white("forge --version")} to verify.
|
|
1469
|
+
`));
|
|
1470
|
+
} catch (err) {
|
|
1471
|
+
upgradeSpinner.fail("Upgrade failed");
|
|
1472
|
+
const msg = err instanceof Error ? err.stderr || err.message : String(err);
|
|
1473
|
+
if (msg.includes("EACCES") || msg.includes("permission")) {
|
|
1474
|
+
console.log(chalk20.dim(" Try running with sudo:\n"));
|
|
1475
|
+
console.log(chalk20.white(" sudo npm install -g forgecraft@latest\n"));
|
|
1476
|
+
} else {
|
|
1477
|
+
console.log(chalk20.dim(` ${msg.split("\n")[0]}
|
|
1478
|
+
`));
|
|
1479
|
+
console.log(chalk20.dim(" Manual upgrade:\n"));
|
|
1480
|
+
console.log(chalk20.white(" npm install -g forgecraft@latest\n"));
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
function getCurrentVersion() {
|
|
1485
|
+
try {
|
|
1486
|
+
const output = execSync3("forge --version", { encoding: "utf-8" }).trim();
|
|
1487
|
+
return output;
|
|
1488
|
+
} catch {
|
|
1489
|
+
return "unknown";
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1436
1493
|
// src/cli/index.ts
|
|
1437
1494
|
var program = new Command();
|
|
1438
1495
|
program.name("forge").description(
|
|
1439
|
-
|
|
1440
|
-
).version("1.
|
|
1496
|
+
chalk21.bold("Forge") + " \u2014 AI Development Orchestration Framework\n Structured multi-agent pipeline: plan \u2192 design \u2192 build \u2192 review"
|
|
1497
|
+
).version("1.3.0");
|
|
1441
1498
|
program.command("auto [description]").description("Fully autonomous mode \u2014 plan, build, and review in one command").option("--no-sandbox", "Disable sandbox (not recommended)").option("-y, --yes", "Skip all confirmation prompts (auto-approve everything)").option("-q, --quiet", "Hide live agent output, show spinners only").option("--allow-network <domains>", "Comma-separated allowed network domains").option("--mute", "Suppress notification sounds").option("--deploy", "Configure GitHub Pages deployment after build").option("--skip-design", "Skip design phase (faster, no Storybook previews)").action(autoCommand);
|
|
1442
1499
|
program.command("resume").description("Resume an interrupted sprint from where it left off").option("--no-sandbox", "Disable sandbox").option("-y, --yes", "Skip all confirmation prompts (auto-approve everything)").option("-q, --quiet", "Spinners only").option("--mute", "Suppress sounds").option("--skip-design", "Skip design phase").action(resumeCommand);
|
|
1443
1500
|
program.command("sprint [description]").description("Run full pipeline with human gates between phases").action(sprintCommand);
|
|
@@ -1458,5 +1515,6 @@ program.command("checkout <version>").description("Jump to a specific version or
|
|
|
1458
1515
|
program.command("export").description("Export sprint plan as markdown").option("-o, --output <path>", "Output file path", "sprint-plan.md").action(exportCommand);
|
|
1459
1516
|
program.command("clean").description("Reset sprint state (keeps config)").option("-f, --force", "Skip confirmation prompt").option("--snapshots", "Only clean snapshots").action(cleanCommand);
|
|
1460
1517
|
program.command("doctor").description("Diagnose setup issues and check system requirements").action(doctorCommand);
|
|
1518
|
+
program.command("upgrade").description("Upgrade Forge to the latest version").action(upgradeCommand);
|
|
1461
1519
|
program.parse();
|
|
1462
1520
|
//# sourceMappingURL=index.js.map
|