@codebakers/cli 3.8.7 → 3.8.8

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.
@@ -1,5 +1,9 @@
1
1
  interface GoOptions {
2
2
  verbose?: boolean;
3
+ type?: 'personal' | 'client' | 'business';
4
+ name?: string;
5
+ describe?: 'guided' | 'template' | 'paste' | 'chat' | 'files';
6
+ skipReview?: boolean;
3
7
  }
4
8
  /**
5
9
  * Zero-friction entry point - start using CodeBakers instantly
@@ -1113,19 +1113,29 @@ async function setupProject(options = {}, auth) {
1113
1113
  }
1114
1114
  async function setupNewProject(cwd, options = {}, auth) {
1115
1115
  console.log(chalk_1.default.cyan('\n ━━━ New Project Setup ━━━\n'));
1116
- // Get project info
1117
- console.log(chalk_1.default.white(' What kind of project is this?\n'));
1118
- console.log(chalk_1.default.gray(' 1. ') + chalk_1.default.cyan('PERSONAL') + chalk_1.default.gray(' - Just building for myself'));
1119
- console.log(chalk_1.default.gray(' 2. ') + chalk_1.default.cyan('CLIENT') + chalk_1.default.gray(' - Building for someone else'));
1120
- console.log(chalk_1.default.gray(' 3. ') + chalk_1.default.cyan('BUSINESS') + chalk_1.default.gray(' - My own product/startup\n'));
1121
- let typeChoice = '';
1122
- while (!['1', '2', '3'].includes(typeChoice)) {
1123
- typeChoice = await prompt(' Enter 1, 2, or 3: ');
1124
- }
1125
- const typeMap = { '1': 'personal', '2': 'client', '3': 'business' };
1126
- const projectType = typeMap[typeChoice];
1116
+ let projectType;
1117
+ let projectName;
1127
1118
  const defaultName = cwd.split(/[\\/]/).pop() || 'my-project';
1128
- const projectName = await prompt(` Project name (${defaultName}): `) || defaultName;
1119
+ // Use flags if provided (non-interactive mode for AI)
1120
+ if (options.type) {
1121
+ projectType = options.type;
1122
+ projectName = options.name || defaultName;
1123
+ console.log(chalk_1.default.green(` Using: ${projectType.toUpperCase()} project named "${projectName}"\n`));
1124
+ }
1125
+ else {
1126
+ // Interactive mode - ask questions
1127
+ console.log(chalk_1.default.white(' What kind of project is this?\n'));
1128
+ console.log(chalk_1.default.gray(' 1. ') + chalk_1.default.cyan('PERSONAL') + chalk_1.default.gray(' - Just building for myself'));
1129
+ console.log(chalk_1.default.gray(' 2. ') + chalk_1.default.cyan('CLIENT') + chalk_1.default.gray(' - Building for someone else'));
1130
+ console.log(chalk_1.default.gray(' 3. ') + chalk_1.default.cyan('BUSINESS') + chalk_1.default.gray(' - My own product/startup\n'));
1131
+ let typeChoice = '';
1132
+ while (!['1', '2', '3'].includes(typeChoice)) {
1133
+ typeChoice = await prompt(' Enter 1, 2, or 3: ');
1134
+ }
1135
+ const typeMap = { '1': 'personal', '2': 'client', '3': 'business' };
1136
+ projectType = typeMap[typeChoice];
1137
+ projectName = await prompt(` Project name (${defaultName}): `) || defaultName;
1138
+ }
1129
1139
  console.log(chalk_1.default.green(`\n ✓ Setting up "${projectName}" as ${projectType.toUpperCase()} project\n`));
1130
1140
  // Install bootstrap files
1131
1141
  console.log(chalk_1.default.white(' Installing CodeBakers...\n'));
@@ -1140,15 +1150,26 @@ async function setupNewProject(cwd, options = {}, auth) {
1140
1150
  // Update .gitignore
1141
1151
  updateGitignore(cwd);
1142
1152
  // How to describe project
1143
- console.log(chalk_1.default.white('\n 📝 How would you like to describe your project?\n'));
1144
- console.log(chalk_1.default.gray(' 1. ') + chalk_1.default.cyan('GUIDED QUESTIONS') + chalk_1.default.gray(' - I\'ll ask you step by step'));
1145
- console.log(chalk_1.default.gray(' 2. ') + chalk_1.default.cyan('WRITE A PRD') + chalk_1.default.gray(' - Create a blank template to fill out'));
1146
- console.log(chalk_1.default.gray(' 3. ') + chalk_1.default.cyan('PASTE/UPLOAD PRD') + chalk_1.default.gray(' - I already have requirements written'));
1147
- console.log(chalk_1.default.gray(' 4. ') + chalk_1.default.cyan('DESCRIBE IN CHAT') + chalk_1.default.gray(' - Just tell the AI what you want'));
1148
- console.log(chalk_1.default.gray(' 5. ') + chalk_1.default.cyan('SHARE FILES') + chalk_1.default.gray(' - I\'ll share docs/mockups/screenshots\n'));
1149
1153
  let describeChoice = '';
1150
- while (!['1', '2', '3', '4', '5'].includes(describeChoice)) {
1151
- describeChoice = await prompt(' Enter 1-5: ');
1154
+ // Use flag if provided (non-interactive mode for AI)
1155
+ if (options.describe) {
1156
+ const describeMap = {
1157
+ 'guided': '1', 'template': '2', 'paste': '3', 'chat': '4', 'files': '5'
1158
+ };
1159
+ describeChoice = describeMap[options.describe] || '4';
1160
+ console.log(chalk_1.default.green(` Using: ${options.describe} mode for project description\n`));
1161
+ }
1162
+ else {
1163
+ // Interactive mode
1164
+ console.log(chalk_1.default.white('\n 📝 How would you like to describe your project?\n'));
1165
+ console.log(chalk_1.default.gray(' 1. ') + chalk_1.default.cyan('GUIDED QUESTIONS') + chalk_1.default.gray(' - I\'ll ask you step by step'));
1166
+ console.log(chalk_1.default.gray(' 2. ') + chalk_1.default.cyan('WRITE A PRD') + chalk_1.default.gray(' - Create a blank template to fill out'));
1167
+ console.log(chalk_1.default.gray(' 3. ') + chalk_1.default.cyan('PASTE/UPLOAD PRD') + chalk_1.default.gray(' - I already have requirements written'));
1168
+ console.log(chalk_1.default.gray(' 4. ') + chalk_1.default.cyan('DESCRIBE IN CHAT') + chalk_1.default.gray(' - Just tell the AI what you want'));
1169
+ console.log(chalk_1.default.gray(' 5. ') + chalk_1.default.cyan('SHARE FILES') + chalk_1.default.gray(' - I\'ll share docs/mockups/screenshots\n'));
1170
+ while (!['1', '2', '3', '4', '5'].includes(describeChoice)) {
1171
+ describeChoice = await prompt(' Enter 1-5: ');
1172
+ }
1152
1173
  }
1153
1174
  let prdCreated = false;
1154
1175
  if (describeChoice === '1') {
@@ -1244,15 +1265,36 @@ async function setupExistingProject(cwd, projectInfo, options = {}, auth) {
1244
1265
  }
1245
1266
  // Get project name
1246
1267
  const defaultName = cwd.split(/[\\/]/).pop() || 'my-project';
1247
- const projectName = await prompt(`\n Project name (${defaultName}): `) || defaultName;
1248
- // Code review offer
1249
- console.log(chalk_1.default.white('\n Want me to review your code and bring it up to CodeBakers standards?\n'));
1250
- console.log(chalk_1.default.gray(' 1. ') + chalk_1.default.cyan('YES, REVIEW & FIX') + chalk_1.default.gray(' - Run audit, then auto-fix issues'));
1251
- console.log(chalk_1.default.gray(' 2. ') + chalk_1.default.cyan('REVIEW ONLY') + chalk_1.default.gray(' - Just show me the issues'));
1252
- console.log(chalk_1.default.gray(' 3. ') + chalk_1.default.cyan('SKIP') + chalk_1.default.gray(' - Just install CodeBakers\n'));
1253
- let reviewChoice = '';
1254
- while (!['1', '2', '3'].includes(reviewChoice)) {
1255
- reviewChoice = await prompt(' Enter 1, 2, or 3: ');
1268
+ let projectName;
1269
+ let reviewChoice;
1270
+ // Use flags if provided (non-interactive mode for AI)
1271
+ if (options.name) {
1272
+ projectName = options.name;
1273
+ console.log(chalk_1.default.green(`\n Using project name: "${projectName}"\n`));
1274
+ }
1275
+ else {
1276
+ projectName = await prompt(`\n Project name (${defaultName}): `) || defaultName;
1277
+ }
1278
+ // Use skipReview flag or ask
1279
+ if (options.skipReview) {
1280
+ reviewChoice = '3';
1281
+ console.log(chalk_1.default.gray(' Skipping code review (--skip-review flag)\n'));
1282
+ }
1283
+ else if (options.type) {
1284
+ // If running in non-interactive mode, default to skip review
1285
+ reviewChoice = '3';
1286
+ console.log(chalk_1.default.gray(' Skipping code review (non-interactive mode)\n'));
1287
+ }
1288
+ else {
1289
+ // Interactive mode - ask about code review
1290
+ console.log(chalk_1.default.white('\n Want me to review your code and bring it up to CodeBakers standards?\n'));
1291
+ console.log(chalk_1.default.gray(' 1. ') + chalk_1.default.cyan('YES, REVIEW & FIX') + chalk_1.default.gray(' - Run audit, then auto-fix issues'));
1292
+ console.log(chalk_1.default.gray(' 2. ') + chalk_1.default.cyan('REVIEW ONLY') + chalk_1.default.gray(' - Just show me the issues'));
1293
+ console.log(chalk_1.default.gray(' 3. ') + chalk_1.default.cyan('SKIP') + chalk_1.default.gray(' - Just install CodeBakers\n'));
1294
+ reviewChoice = '';
1295
+ while (!['1', '2', '3'].includes(reviewChoice)) {
1296
+ reviewChoice = await prompt(' Enter 1, 2, or 3: ');
1297
+ }
1256
1298
  }
1257
1299
  let auditScore;
1258
1300
  if (reviewChoice !== '3') {
package/dist/index.js CHANGED
@@ -202,7 +202,18 @@ program
202
202
  .alias('start')
203
203
  .description('Start using CodeBakers instantly (no signup required)')
204
204
  .option('-v, --verbose', 'Show detailed debug output for troubleshooting')
205
- .action((options) => (0, go_js_1.go)({ verbose: options.verbose }));
205
+ // Non-interactive flags for programmatic use (e.g., by AI assistants)
206
+ .option('-t, --type <type>', 'Project type: personal, client, or business')
207
+ .option('-n, --name <name>', 'Project name')
208
+ .option('-d, --describe <mode>', 'Description mode: guided, template, paste, chat, or files')
209
+ .option('--skip-review', 'Skip the review question for existing projects')
210
+ .action((options) => (0, go_js_1.go)({
211
+ verbose: options.verbose,
212
+ type: options.type,
213
+ name: options.name,
214
+ describe: options.describe,
215
+ skipReview: options.skipReview,
216
+ }));
206
217
  program
207
218
  .command('extend')
208
219
  .description('Extend your free trial with GitHub')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebakers/cli",
3
- "version": "3.8.7",
3
+ "version": "3.8.8",
4
4
  "description": "CodeBakers CLI - Production patterns for AI-assisted development",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -771,6 +771,11 @@ function updateGitignore(cwd: string): void {
771
771
 
772
772
  interface GoOptions {
773
773
  verbose?: boolean;
774
+ // Non-interactive flags for programmatic use (e.g., by AI assistants)
775
+ type?: 'personal' | 'client' | 'business';
776
+ name?: string;
777
+ describe?: 'guided' | 'template' | 'paste' | 'chat' | 'files';
778
+ skipReview?: boolean;
774
779
  }
775
780
 
776
781
  interface ConfirmData {
@@ -1240,22 +1245,31 @@ async function setupProject(options: GoOptions = {}, auth?: AuthInfo): Promise<v
1240
1245
  async function setupNewProject(cwd: string, options: GoOptions = {}, auth?: AuthInfo): Promise<void> {
1241
1246
  console.log(chalk.cyan('\n ━━━ New Project Setup ━━━\n'));
1242
1247
 
1243
- // Get project info
1244
- console.log(chalk.white(' What kind of project is this?\n'));
1245
- console.log(chalk.gray(' 1. ') + chalk.cyan('PERSONAL') + chalk.gray(' - Just building for myself'));
1246
- console.log(chalk.gray(' 2. ') + chalk.cyan('CLIENT') + chalk.gray(' - Building for someone else'));
1247
- console.log(chalk.gray(' 3. ') + chalk.cyan('BUSINESS') + chalk.gray(' - My own product/startup\n'));
1248
-
1249
- let typeChoice = '';
1250
- while (!['1', '2', '3'].includes(typeChoice)) {
1251
- typeChoice = await prompt(' Enter 1, 2, or 3: ');
1252
- }
1248
+ let projectType: string;
1249
+ let projectName: string;
1250
+ const defaultName = cwd.split(/[\\/]/).pop() || 'my-project';
1253
1251
 
1254
- const typeMap: Record<string, string> = { '1': 'personal', '2': 'client', '3': 'business' };
1255
- const projectType = typeMap[typeChoice];
1252
+ // Use flags if provided (non-interactive mode for AI)
1253
+ if (options.type) {
1254
+ projectType = options.type;
1255
+ projectName = options.name || defaultName;
1256
+ console.log(chalk.green(` Using: ${projectType.toUpperCase()} project named "${projectName}"\n`));
1257
+ } else {
1258
+ // Interactive mode - ask questions
1259
+ console.log(chalk.white(' What kind of project is this?\n'));
1260
+ console.log(chalk.gray(' 1. ') + chalk.cyan('PERSONAL') + chalk.gray(' - Just building for myself'));
1261
+ console.log(chalk.gray(' 2. ') + chalk.cyan('CLIENT') + chalk.gray(' - Building for someone else'));
1262
+ console.log(chalk.gray(' 3. ') + chalk.cyan('BUSINESS') + chalk.gray(' - My own product/startup\n'));
1263
+
1264
+ let typeChoice = '';
1265
+ while (!['1', '2', '3'].includes(typeChoice)) {
1266
+ typeChoice = await prompt(' Enter 1, 2, or 3: ');
1267
+ }
1256
1268
 
1257
- const defaultName = cwd.split(/[\\/]/).pop() || 'my-project';
1258
- const projectName = await prompt(` Project name (${defaultName}): `) || defaultName;
1269
+ const typeMap: Record<string, string> = { '1': 'personal', '2': 'client', '3': 'business' };
1270
+ projectType = typeMap[typeChoice];
1271
+ projectName = await prompt(` Project name (${defaultName}): `) || defaultName;
1272
+ }
1259
1273
 
1260
1274
  console.log(chalk.green(`\n ✓ Setting up "${projectName}" as ${projectType.toUpperCase()} project\n`));
1261
1275
 
@@ -1276,16 +1290,27 @@ async function setupNewProject(cwd: string, options: GoOptions = {}, auth?: Auth
1276
1290
  updateGitignore(cwd);
1277
1291
 
1278
1292
  // How to describe project
1279
- console.log(chalk.white('\n 📝 How would you like to describe your project?\n'));
1280
- console.log(chalk.gray(' 1. ') + chalk.cyan('GUIDED QUESTIONS') + chalk.gray(' - I\'ll ask you step by step'));
1281
- console.log(chalk.gray(' 2. ') + chalk.cyan('WRITE A PRD') + chalk.gray(' - Create a blank template to fill out'));
1282
- console.log(chalk.gray(' 3. ') + chalk.cyan('PASTE/UPLOAD PRD') + chalk.gray(' - I already have requirements written'));
1283
- console.log(chalk.gray(' 4. ') + chalk.cyan('DESCRIBE IN CHAT') + chalk.gray(' - Just tell the AI what you want'));
1284
- console.log(chalk.gray(' 5. ') + chalk.cyan('SHARE FILES') + chalk.gray(' - I\'ll share docs/mockups/screenshots\n'));
1285
-
1286
1293
  let describeChoice = '';
1287
- while (!['1', '2', '3', '4', '5'].includes(describeChoice)) {
1288
- describeChoice = await prompt(' Enter 1-5: ');
1294
+
1295
+ // Use flag if provided (non-interactive mode for AI)
1296
+ if (options.describe) {
1297
+ const describeMap: Record<string, string> = {
1298
+ 'guided': '1', 'template': '2', 'paste': '3', 'chat': '4', 'files': '5'
1299
+ };
1300
+ describeChoice = describeMap[options.describe] || '4';
1301
+ console.log(chalk.green(` Using: ${options.describe} mode for project description\n`));
1302
+ } else {
1303
+ // Interactive mode
1304
+ console.log(chalk.white('\n 📝 How would you like to describe your project?\n'));
1305
+ console.log(chalk.gray(' 1. ') + chalk.cyan('GUIDED QUESTIONS') + chalk.gray(' - I\'ll ask you step by step'));
1306
+ console.log(chalk.gray(' 2. ') + chalk.cyan('WRITE A PRD') + chalk.gray(' - Create a blank template to fill out'));
1307
+ console.log(chalk.gray(' 3. ') + chalk.cyan('PASTE/UPLOAD PRD') + chalk.gray(' - I already have requirements written'));
1308
+ console.log(chalk.gray(' 4. ') + chalk.cyan('DESCRIBE IN CHAT') + chalk.gray(' - Just tell the AI what you want'));
1309
+ console.log(chalk.gray(' 5. ') + chalk.cyan('SHARE FILES') + chalk.gray(' - I\'ll share docs/mockups/screenshots\n'));
1310
+
1311
+ while (!['1', '2', '3', '4', '5'].includes(describeChoice)) {
1312
+ describeChoice = await prompt(' Enter 1-5: ');
1313
+ }
1289
1314
  }
1290
1315
 
1291
1316
  let prdCreated = false;
@@ -1384,17 +1409,36 @@ async function setupExistingProject(cwd: string, projectInfo: ProjectInfo, optio
1384
1409
 
1385
1410
  // Get project name
1386
1411
  const defaultName = cwd.split(/[\\/]/).pop() || 'my-project';
1387
- const projectName = await prompt(`\n Project name (${defaultName}): `) || defaultName;
1412
+ let projectName: string;
1413
+ let reviewChoice: string;
1388
1414
 
1389
- // Code review offer
1390
- console.log(chalk.white('\n Want me to review your code and bring it up to CodeBakers standards?\n'));
1391
- console.log(chalk.gray(' 1. ') + chalk.cyan('YES, REVIEW & FIX') + chalk.gray(' - Run audit, then auto-fix issues'));
1392
- console.log(chalk.gray(' 2. ') + chalk.cyan('REVIEW ONLY') + chalk.gray(' - Just show me the issues'));
1393
- console.log(chalk.gray(' 3. ') + chalk.cyan('SKIP') + chalk.gray(' - Just install CodeBakers\n'));
1415
+ // Use flags if provided (non-interactive mode for AI)
1416
+ if (options.name) {
1417
+ projectName = options.name;
1418
+ console.log(chalk.green(`\n Using project name: "${projectName}"\n`));
1419
+ } else {
1420
+ projectName = await prompt(`\n Project name (${defaultName}): `) || defaultName;
1421
+ }
1394
1422
 
1395
- let reviewChoice = '';
1396
- while (!['1', '2', '3'].includes(reviewChoice)) {
1397
- reviewChoice = await prompt(' Enter 1, 2, or 3: ');
1423
+ // Use skipReview flag or ask
1424
+ if (options.skipReview) {
1425
+ reviewChoice = '3';
1426
+ console.log(chalk.gray(' Skipping code review (--skip-review flag)\n'));
1427
+ } else if (options.type) {
1428
+ // If running in non-interactive mode, default to skip review
1429
+ reviewChoice = '3';
1430
+ console.log(chalk.gray(' Skipping code review (non-interactive mode)\n'));
1431
+ } else {
1432
+ // Interactive mode - ask about code review
1433
+ console.log(chalk.white('\n Want me to review your code and bring it up to CodeBakers standards?\n'));
1434
+ console.log(chalk.gray(' 1. ') + chalk.cyan('YES, REVIEW & FIX') + chalk.gray(' - Run audit, then auto-fix issues'));
1435
+ console.log(chalk.gray(' 2. ') + chalk.cyan('REVIEW ONLY') + chalk.gray(' - Just show me the issues'));
1436
+ console.log(chalk.gray(' 3. ') + chalk.cyan('SKIP') + chalk.gray(' - Just install CodeBakers\n'));
1437
+
1438
+ reviewChoice = '';
1439
+ while (!['1', '2', '3'].includes(reviewChoice)) {
1440
+ reviewChoice = await prompt(' Enter 1, 2, or 3: ');
1441
+ }
1398
1442
  }
1399
1443
 
1400
1444
  let auditScore: number | undefined;
package/src/index.ts CHANGED
@@ -224,7 +224,18 @@ program
224
224
  .alias('start')
225
225
  .description('Start using CodeBakers instantly (no signup required)')
226
226
  .option('-v, --verbose', 'Show detailed debug output for troubleshooting')
227
- .action((options) => go({ verbose: options.verbose }));
227
+ // Non-interactive flags for programmatic use (e.g., by AI assistants)
228
+ .option('-t, --type <type>', 'Project type: personal, client, or business')
229
+ .option('-n, --name <name>', 'Project name')
230
+ .option('-d, --describe <mode>', 'Description mode: guided, template, paste, chat, or files')
231
+ .option('--skip-review', 'Skip the review question for existing projects')
232
+ .action((options) => go({
233
+ verbose: options.verbose,
234
+ type: options.type,
235
+ name: options.name,
236
+ describe: options.describe,
237
+ skipReview: options.skipReview,
238
+ }));
228
239
 
229
240
  program
230
241
  .command('extend')