chiefwiggum 1.3.44 → 1.3.47

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.cjs +40 -23
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -1073,9 +1073,13 @@ async function setupProjectConfig() {
1073
1073
  console.log("Run this command to log in:");
1074
1074
  console.log(import_picocolors7.default.cyan(" gh auth login"));
1075
1075
  } else if (ghCheck.reason === "not_github_repo") {
1076
- console.log(import_picocolors7.default.yellow("This doesn't appear to be a GitHub repository."));
1076
+ console.log(import_picocolors7.default.yellow("Not in a GitHub repository."));
1077
1077
  console.log();
1078
- console.log("Make sure you're in a git repo with a GitHub remote.");
1078
+ console.log("Run chiefwiggum from inside a project directory:");
1079
+ console.log(import_picocolors7.default.cyan(" cd your-project && chiefwiggum new"));
1080
+ console.log();
1081
+ console.log("Or create a new repo here:");
1082
+ console.log(import_picocolors7.default.cyan(" gh repo create"));
1079
1083
  }
1080
1084
  console.log();
1081
1085
  let exitHint = "Then run chiefwiggum new again";
@@ -1087,8 +1091,8 @@ async function setupProjectConfig() {
1087
1091
  exitHint = "gh auth login";
1088
1092
  exitCommand = "gh auth login";
1089
1093
  } else if (ghCheck.reason === "not_github_repo") {
1090
- exitHint = "Initialize repo with GitHub remote";
1091
- exitCommand = "git init && git remote add origin https://github.com/you/repo.git";
1094
+ exitHint = "cd your-project && chiefwiggum new";
1095
+ exitCommand = "cd your-project && chiefwiggum new";
1092
1096
  }
1093
1097
  const fallback = await select2({
1094
1098
  message: "What would you like to do?",
@@ -1419,6 +1423,17 @@ Create 5-15 issues.${projectName ? ` Add each to project "${projectName}".` : ""
1419
1423
  if (!usedFallback) {
1420
1424
  const total = issues.length;
1421
1425
  const owner = repoName.split("/")[0];
1426
+ try {
1427
+ (0, import_node_child_process6.execSync)(
1428
+ `gh label create chiefwiggum --description "Created by Chief Wiggum CLI" --color "FFA500" 2>/dev/null || true`,
1429
+ { stdio: ["pipe", "pipe", "pipe"] }
1430
+ );
1431
+ (0, import_node_child_process6.execSync)(
1432
+ `gh label create epic --description "Parent tracking issue" --color "6366F1" 2>/dev/null || true`,
1433
+ { stdio: ["pipe", "pipe", "pipe"] }
1434
+ );
1435
+ } catch {
1436
+ }
1422
1437
  console.log(import_picocolors7.default.dim(" Creating epic from PRD..."));
1423
1438
  const prdTitleMatch = prdGenerated.match(/^#\s+(.+)$/m);
1424
1439
  const epicTitle = prdTitleMatch ? `Epic: ${prdTitleMatch[1]}` : "Epic: Project Implementation";
@@ -1433,21 +1448,34 @@ _Creating issues..._
1433
1448
  let epicNumber = null;
1434
1449
  let epicUrl = null;
1435
1450
  try {
1436
- const escapeForShell = (str) => {
1437
- return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/`/g, "\\`").replace(/\$/g, "\\$").replace(/!/g, "\\!").replace(/\n/g, "\\n");
1438
- };
1439
- const epicCmd = `gh issue create --title "${escapeForShell(epicTitle)}" --body "${escapeForShell(epicBodyInitial)}" --label "epic,chiefwiggum"`;
1440
- epicUrl = (0, import_node_child_process6.execSync)(epicCmd, {
1451
+ const result2 = (0, import_node_child_process6.spawnSync)("gh", [
1452
+ "issue",
1453
+ "create",
1454
+ "--title",
1455
+ epicTitle,
1456
+ "--body",
1457
+ epicBodyInitial,
1458
+ "--label",
1459
+ "epic,chiefwiggum"
1460
+ ], {
1441
1461
  encoding: "utf-8",
1442
1462
  stdio: ["pipe", "pipe", "pipe"]
1443
- }).trim();
1463
+ });
1464
+ if (result2.status !== 0) {
1465
+ throw new Error(result2.stderr || "Failed to create epic");
1466
+ }
1467
+ epicUrl = result2.stdout.trim();
1444
1468
  const epicNumMatch = epicUrl.match(/\/issues\/(\d+)$/);
1445
1469
  epicNumber = epicNumMatch ? parseInt(epicNumMatch[1], 10) : null;
1446
1470
  if (epicNumber) {
1447
1471
  console.log(import_picocolors7.default.green(` \u2713 Created epic #${epicNumber}`));
1448
1472
  }
1449
- } catch {
1473
+ } catch (err) {
1450
1474
  console.log(import_picocolors7.default.yellow(" Could not create epic issue. Continuing without parent tracking..."));
1475
+ const errMsg = err instanceof Error ? err.message : String(err);
1476
+ if (errMsg) {
1477
+ console.log(import_picocolors7.default.dim(` ${errMsg.slice(0, 100)}`));
1478
+ }
1451
1479
  }
1452
1480
  console.log(import_picocolors7.default.dim(` Creating ${total} child issues...`));
1453
1481
  let projectNumber = null;
@@ -1517,17 +1545,6 @@ _Creating issues..._
1517
1545
  availableLabels = new Set(labelsOutput.trim().split("\n").filter(Boolean));
1518
1546
  } catch {
1519
1547
  }
1520
- try {
1521
- (0, import_node_child_process6.execSync)(
1522
- `gh label create chiefwiggum --description "Created by Chief Wiggum CLI" --color "FFA500" 2>/dev/null || true`,
1523
- { stdio: ["pipe", "pipe", "pipe"] }
1524
- );
1525
- (0, import_node_child_process6.execSync)(
1526
- `gh label create epic --description "Parent tracking issue" --color "6366F1" 2>/dev/null || true`,
1527
- { stdio: ["pipe", "pipe", "pipe"] }
1528
- );
1529
- } catch {
1530
- }
1531
1548
  let created = 0;
1532
1549
  let failed = 0;
1533
1550
  const failedIssues = [];
@@ -1539,7 +1556,7 @@ _Creating issues..._
1539
1556
  const filled = Math.round(progress / 100 * barWidth);
1540
1557
  const empty = barWidth - filled;
1541
1558
  const bar = import_picocolors7.default.green("\u2588".repeat(filled)) + import_picocolors7.default.dim("\u2591".repeat(empty));
1542
- process.stdout.write(`\r ${bar} ${progress}% (${i + 1}/${total}) Creating: ${issue.title.slice(0, 40)}...`.padEnd(100));
1559
+ process.stdout.write(`\x1B[2K\r ${bar} ${progress}% (${i + 1}/${total}) Creating: ${issue.title.slice(0, 40)}...`);
1543
1560
  try {
1544
1561
  const validLabels = issue.labels.filter((label) => availableLabels.size === 0 || availableLabels.has(label));
1545
1562
  const allLabels = ["chiefwiggum", ...validLabels];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chiefwiggum",
3
- "version": "1.3.44",
3
+ "version": "1.3.47",
4
4
  "description": "Autonomous coding agent CLI. Point it at a plan, watch it build.",
5
5
  "type": "module",
6
6
  "bin": {