@codebakers/cli 3.9.29 → 3.9.30
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/package.json +1 -1
- package/src/commands/go.ts +44 -11
package/package.json
CHANGED
package/src/commands/go.ts
CHANGED
|
@@ -1615,7 +1615,7 @@ const V6_CURSORRULES = `# CodeBakers v6.15
|
|
|
1615
1615
|
|
|
1616
1616
|
/**
|
|
1617
1617
|
* Complete project setup - handles everything:
|
|
1618
|
-
* -
|
|
1618
|
+
* - Ask user if existing or new project
|
|
1619
1619
|
* - Set up all tracking files
|
|
1620
1620
|
* - Configure Cursor and Claude Code MCP
|
|
1621
1621
|
* - Run guided questions for new projects
|
|
@@ -1624,11 +1624,40 @@ const V6_CURSORRULES = `# CodeBakers v6.15
|
|
|
1624
1624
|
async function setupProject(options: GoOptions = {}, auth?: AuthInfo): Promise<void> {
|
|
1625
1625
|
const cwd = process.cwd();
|
|
1626
1626
|
|
|
1627
|
-
//
|
|
1627
|
+
// Auto-detect non-interactive mode (e.g., running from Claude Code)
|
|
1628
|
+
const isNonInteractive = !process.stdin.isTTY;
|
|
1629
|
+
|
|
1630
|
+
// Detect if this looks like an existing project
|
|
1628
1631
|
const projectInfo = detectExistingProject(cwd);
|
|
1629
1632
|
|
|
1630
|
-
|
|
1631
|
-
|
|
1633
|
+
let isExistingProject: boolean;
|
|
1634
|
+
|
|
1635
|
+
if (isNonInteractive) {
|
|
1636
|
+
// Non-interactive: use auto-detection
|
|
1637
|
+
isExistingProject = projectInfo.exists;
|
|
1638
|
+
} else {
|
|
1639
|
+
// Interactive: ASK the user
|
|
1640
|
+
console.log(chalk.cyan('\n ━━━ CodeBakers Setup ━━━\n'));
|
|
1641
|
+
|
|
1642
|
+
if (projectInfo.exists) {
|
|
1643
|
+
// We detected existing code, but still ask
|
|
1644
|
+
console.log(chalk.gray(` Detected: ${projectInfo.files} files, ${projectInfo.stack.framework || 'unknown framework'}\n`));
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
console.log(chalk.white(' Is this an existing project or are you starting fresh?\n'));
|
|
1648
|
+
console.log(chalk.gray(' 1. ') + chalk.cyan('EXISTING PROJECT') + chalk.gray(' - I already have code here'));
|
|
1649
|
+
console.log(chalk.gray(' 2. ') + chalk.cyan('NEW PROJECT') + chalk.gray(' - Starting from scratch\n'));
|
|
1650
|
+
|
|
1651
|
+
let projectChoice = '';
|
|
1652
|
+
while (!['1', '2'].includes(projectChoice)) {
|
|
1653
|
+
projectChoice = await prompt(' Enter 1 or 2: ');
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
isExistingProject = projectChoice === '1';
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
if (isExistingProject) {
|
|
1660
|
+
// Existing project
|
|
1632
1661
|
await setupExistingProject(cwd, projectInfo, options, auth);
|
|
1633
1662
|
} else {
|
|
1634
1663
|
// New project
|
|
@@ -1637,15 +1666,19 @@ async function setupProject(options: GoOptions = {}, auth?: AuthInfo): Promise<v
|
|
|
1637
1666
|
}
|
|
1638
1667
|
|
|
1639
1668
|
async function setupNewProject(cwd: string, options: GoOptions = {}, auth?: AuthInfo): Promise<void> {
|
|
1640
|
-
console.log(chalk.cyan('\n ━━━ New Project Setup ━━━\n'));
|
|
1641
|
-
|
|
1642
1669
|
// Auto-detect non-interactive mode (e.g., running from Claude Code)
|
|
1643
1670
|
const isNonInteractive = !process.stdin.isTTY;
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1671
|
+
|
|
1672
|
+
if (isNonInteractive) {
|
|
1673
|
+
console.log(chalk.cyan('\n ━━━ New Project Setup ━━━\n'));
|
|
1674
|
+
if (!options.type) {
|
|
1675
|
+
console.log(chalk.yellow(' ⚡ Non-interactive mode detected - using defaults\n'));
|
|
1676
|
+
options.type = 'personal';
|
|
1677
|
+
options.describe = options.describe || 'chat';
|
|
1678
|
+
options.skipReview = true;
|
|
1679
|
+
}
|
|
1680
|
+
} else {
|
|
1681
|
+
console.log(chalk.green('\n ✓ Setting up as NEW PROJECT\n'));
|
|
1649
1682
|
}
|
|
1650
1683
|
|
|
1651
1684
|
let projectType: string;
|