codebakers 2.5.3 → 3.0.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.
Files changed (60) hide show
  1. package/README.md +54 -255
  2. package/dist/chunk-HOWR3YTF.js +146 -0
  3. package/dist/index.d.ts +0 -3
  4. package/dist/index.js +10489 -7994
  5. package/dist/terminal-6ZQVP6R7.js +10 -0
  6. package/package.json +26 -41
  7. package/AUDIT_REPORT.md +0 -138
  8. package/dist/advisors-RWRTSJRR.js +0 -7
  9. package/dist/chunk-ASIJIQYC.js +0 -320
  10. package/dist/chunk-D44U3IEA.js +0 -565
  11. package/dist/chunk-LANM5XQW.js +0 -326
  12. package/dist/prd-RYITSL6Q.js +0 -7
  13. package/install.bat +0 -9
  14. package/installers/CodeBakers-Install.bat +0 -207
  15. package/installers/CodeBakers-Install.command +0 -232
  16. package/installers/README.md +0 -157
  17. package/installers/mac/assets/README.txt +0 -31
  18. package/installers/mac/build-mac-installer.sh +0 -240
  19. package/installers/windows/CodeBakers.iss +0 -256
  20. package/installers/windows/assets/README.txt +0 -16
  21. package/installers/windows/scripts/post-install.bat +0 -15
  22. package/src/channels/discord.ts +0 -5
  23. package/src/channels/slack.ts +0 -5
  24. package/src/channels/sms.ts +0 -4
  25. package/src/channels/telegram.ts +0 -5
  26. package/src/channels/whatsapp.ts +0 -7
  27. package/src/commands/advisors.ts +0 -699
  28. package/src/commands/build.ts +0 -1025
  29. package/src/commands/check.ts +0 -365
  30. package/src/commands/code.ts +0 -806
  31. package/src/commands/connect.ts +0 -12
  32. package/src/commands/deploy.ts +0 -448
  33. package/src/commands/design.ts +0 -298
  34. package/src/commands/fix.ts +0 -20
  35. package/src/commands/gateway.ts +0 -604
  36. package/src/commands/generate.ts +0 -178
  37. package/src/commands/init.ts +0 -634
  38. package/src/commands/integrate.ts +0 -884
  39. package/src/commands/learn.ts +0 -36
  40. package/src/commands/migrate.ts +0 -419
  41. package/src/commands/prd-maker.ts +0 -588
  42. package/src/commands/prd.ts +0 -419
  43. package/src/commands/security.ts +0 -102
  44. package/src/commands/setup.ts +0 -600
  45. package/src/commands/status.ts +0 -56
  46. package/src/commands/website.ts +0 -741
  47. package/src/index.ts +0 -627
  48. package/src/patterns/loader.ts +0 -337
  49. package/src/services/github.ts +0 -61
  50. package/src/services/supabase.ts +0 -147
  51. package/src/services/vercel.ts +0 -61
  52. package/src/utils/claude-md.ts +0 -287
  53. package/src/utils/config.ts +0 -375
  54. package/src/utils/display.ts +0 -338
  55. package/src/utils/files.ts +0 -418
  56. package/src/utils/nlp.ts +0 -312
  57. package/src/utils/ui.ts +0 -441
  58. package/src/utils/updates.ts +0 -8
  59. package/src/utils/voice.ts +0 -323
  60. package/tsconfig.json +0 -26
package/src/index.ts DELETED
@@ -1,627 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command } from 'commander';
4
- import * as p from '@clack/prompts';
5
- import chalk from 'chalk';
6
- import boxen from 'boxen';
7
- import gradient from 'gradient-string';
8
- import * as path from 'path';
9
- import { Config } from './utils/config.js';
10
- import { checkForUpdates } from './utils/updates.js';
11
- import { setupCommand } from './commands/setup.js';
12
- import { initCommand } from './commands/init.js';
13
- import { codeCommand } from './commands/code.js';
14
- import { checkCommand } from './commands/check.js';
15
- import { deployCommand } from './commands/deploy.js';
16
- import { connectCommand } from './commands/connect.js';
17
- import { statusCommand } from './commands/status.js';
18
- import { gatewayCommand } from './commands/gateway.js';
19
- import { learnCommand } from './commands/learn.js';
20
- import { securityCommand } from './commands/security.js';
21
- import { generateCommand } from './commands/generate.js';
22
- import { fixCommand } from './commands/fix.js';
23
- import { designCommand } from './commands/design.js';
24
- import { prdCommand } from './commands/prd.js';
25
- import { advisorsCommand } from './commands/advisors.js';
26
- import { migrateCommand } from './commands/migrate.js';
27
- import { prdMakerCommand } from './commands/prd-maker.js';
28
- import { buildCommand } from './commands/build.js';
29
- import { integrateCommand, INTEGRATIONS } from './commands/integrate.js';
30
- import { websiteCommand } from './commands/website.js';
31
- import { parseNaturalLanguage } from './utils/nlp.js';
32
- import {
33
- showLogo,
34
- showMiniLogo,
35
- showMenuCards,
36
- showSuccessScreen,
37
- showErrorScreen,
38
- box,
39
- doubleBox,
40
- divider,
41
- sectionHeader,
42
- colors,
43
- headerGradient
44
- } from './utils/ui.js';
45
-
46
- const VERSION = '2.5.3';
47
-
48
- // ============================================================================
49
- // MAIN MENU
50
- // ============================================================================
51
-
52
- async function showMainMenu(): Promise<void> {
53
- const config = new Config();
54
-
55
- // Clear screen and show beautiful logo
56
- console.clear();
57
- showLogo();
58
- console.log(colors.muted(` v${VERSION}`));
59
- console.log('');
60
-
61
- // Check setup status
62
- const hasAnthropic = !!config.getCredentials('anthropic')?.apiKey;
63
-
64
- // STEP 1: First time? Run setup
65
- if (!hasAnthropic) {
66
- doubleBox([
67
- colors.warning('👋 Welcome to CodeBakers!'),
68
- '',
69
- colors.white("Let's connect your Anthropic API key so the AI can work."),
70
- colors.muted('(Takes about 1 minute)'),
71
- ], 'default');
72
-
73
- await setupCommand();
74
-
75
- // After setup, show next steps
76
- showPostSetupInstructions();
77
- return;
78
- }
79
-
80
- // STEP 2: Detect context
81
- const inProject = config.isInProject();
82
- const projectConfig = config.getProjectConfig();
83
- const cwd = process.cwd();
84
- const folderName = path.basename(cwd);
85
-
86
- // Show context
87
- if (inProject && projectConfig) {
88
- const framework = projectConfig.framework || 'detected';
89
- box([
90
- colors.secondary('📁 ') + colors.white(folderName),
91
- colors.muted(` ${framework} project`),
92
- ]);
93
-
94
- // SHOW PROJECT MENU
95
- await showProjectMenu(config);
96
- } else {
97
- box([
98
- colors.secondary('📁 ') + colors.white(cwd),
99
- colors.muted(' Not a project folder'),
100
- ]);
101
-
102
- // SHOW START MENU
103
- await showStartMenu(config);
104
- }
105
- }
106
-
107
- // ============================================================================
108
- // START MENU (Not in a project)
109
- // ============================================================================
110
-
111
- async function showStartMenu(config: Config): Promise<void> {
112
- console.log(colors.muted(' This folder doesn\'t have a project yet.'));
113
- console.log('');
114
-
115
- let keepRunning = true;
116
-
117
- while (keepRunning) {
118
- sectionHeader('What would you like to do?');
119
-
120
- showMenuCards([
121
- { key: '1', icon: '🌐', label: 'Build a Website', description: 'Describe it, AI builds it' },
122
- { key: '2', icon: '🆕', label: 'Create New Project', description: 'Start with Next.js, React' },
123
- { key: '3', icon: '✏️', label: 'Plan My Project', description: 'Create a detailed plan' },
124
- { key: '4', icon: '🏗️', label: 'Build from Plan', description: 'I have a PRD file' },
125
- { key: '5', icon: '🌟', label: 'Get Expert Advice', description: 'AI consultants help' },
126
- { key: '6', icon: '🔌', label: 'Add a Service', description: 'Stripe, Supabase, Auth' },
127
- { key: '7', icon: '⚙️', label: 'Settings', description: 'API keys & preferences' },
128
- { key: '8', icon: '❓', label: 'Help', description: 'Learn how it works' },
129
- { key: '0', icon: '🚪', label: 'Exit', description: 'Return to terminal' },
130
- ]);
131
-
132
- const choice = await p.text({
133
- message: colors.primary('Enter a number (0-8):'),
134
- placeholder: '1',
135
- validate: (value) => {
136
- if (!/^[0-8]$/.test(value) && value !== '') return 'Please enter a number 0-8';
137
- }
138
- });
139
-
140
- if (p.isCancel(choice)) {
141
- keepRunning = false;
142
- showExitMessage();
143
- break;
144
- }
145
-
146
- const num = choice === '' ? '1' : choice;
147
-
148
- switch (num) {
149
- case '0':
150
- keepRunning = false;
151
- showExitMessage();
152
- break;
153
- case '1':
154
- await handleAction('website', config);
155
- break;
156
- case '2':
157
- await handleAction('new', config);
158
- break;
159
- case '3':
160
- await handleAction('prd-maker', config);
161
- break;
162
- case '4':
163
- await handleAction('build', config);
164
- break;
165
- case '5':
166
- await handleAction('advisors', config);
167
- break;
168
- case '6':
169
- await handleAction('integrate', config);
170
- break;
171
- case '7':
172
- await handleAction('settings', config);
173
- break;
174
- case '8':
175
- await handleAction('help', config);
176
- break;
177
- }
178
-
179
- if (keepRunning) {
180
- console.log('\n');
181
- }
182
- }
183
- }
184
-
185
- function showExitMessage(): void {
186
- console.log('');
187
- divider();
188
- console.log(colors.white(' You\'re back in the terminal.'));
189
- console.log('');
190
- console.log(colors.muted(' To start CodeBakers again, type:'));
191
- console.log(colors.success(' codebakers'));
192
- console.log('');
193
- console.log(chalk.dim(' Quick commands you can run directly:'));
194
- console.log(chalk.dim(' codebakers website') + chalk.gray(' - Build a website'));
195
- console.log(chalk.dim(' codebakers code') + chalk.gray(' - Code with AI'));
196
- console.log(chalk.dim(' codebakers help') + chalk.gray(' - See all commands'));
197
- console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
198
- console.log('');
199
- }
200
-
201
- // ============================================================================
202
- // PROJECT MENU (In a project)
203
- // ============================================================================
204
-
205
- async function showProjectMenu(config: Config): Promise<void> {
206
- console.log(chalk.cyan('\n ℹ️ I found an existing project in this folder.\n'));
207
-
208
- let keepRunning = true;
209
-
210
- while (keepRunning) {
211
- console.log(chalk.white(' What would you like to do with this project?\n'));
212
- console.log(chalk.green(' 1.') + ' 💬 Code with AI ' + chalk.dim('- Tell AI what to build or fix'));
213
- console.log(chalk.green(' 2.') + ' 🚀 Deploy to production ' + chalk.dim('- Make your site live'));
214
- console.log(chalk.green(' 3.') + ' 🔍 Check my code ' + chalk.dim('- Find issues & improvements'));
215
- console.log(chalk.green(' 4.') + ' 🔧 Fix errors for me ' + chalk.dim('- AI repairs broken code'));
216
- console.log(chalk.green(' 5.') + ' 🔌 Add a service ' + chalk.dim('- Stripe, Supabase, Auth, etc.'));
217
- console.log(chalk.green(' 6.') + ' ⚡ Create new files ' + chalk.dim('- Components, pages, APIs'));
218
- console.log(chalk.green(' 7.') + ' 🆕 Start fresh project ' + chalk.dim('- Begin something new'));
219
- console.log(chalk.green(' 8.') + ' ⚙️ Settings ' + chalk.dim('- API keys & preferences'));
220
- console.log(chalk.green(' 9.') + ' ❓ Help ' + chalk.dim('- Learn how CodeBakers works'));
221
- console.log(chalk.green(' 0.') + ' 🚪 Return to terminal ' + chalk.dim('- Go back to command line'));
222
- console.log('');
223
-
224
- const choice = await p.text({
225
- message: 'Enter a number (0-9):',
226
- placeholder: '1',
227
- validate: (value) => {
228
- if (!/^[0-9]$/.test(value) && value !== '') return 'Please enter a number 0-9';
229
- }
230
- });
231
-
232
- if (p.isCancel(choice)) {
233
- keepRunning = false;
234
- showExitMessage();
235
- break;
236
- }
237
-
238
- const num = choice === '' ? '1' : choice;
239
-
240
- switch (num) {
241
- case '0':
242
- keepRunning = false;
243
- showExitMessage();
244
- break;
245
- case '1':
246
- await handleAction('code', config);
247
- break;
248
- case '2':
249
- await handleAction('deploy', config);
250
- break;
251
- case '3':
252
- await handleAction('check', config);
253
- break;
254
- case '4':
255
- await handleAction('fix', config);
256
- break;
257
- case '5':
258
- await handleAction('integrate', config);
259
- break;
260
- case '6':
261
- await handleAction('generate', config);
262
- break;
263
- case '7':
264
- await handleAction('new', config);
265
- break;
266
- case '8':
267
- await handleAction('settings', config);
268
- break;
269
- case '9':
270
- await handleAction('help', config);
271
- break;
272
- }
273
-
274
- if (keepRunning) {
275
- console.log('\n');
276
- }
277
- }
278
- }
279
-
280
- // ============================================================================
281
- // ACTION HANDLER
282
- // ============================================================================
283
-
284
- async function handleAction(action: string, config: Config): Promise<void> {
285
- switch (action) {
286
- case 'website':
287
- await websiteCommand();
288
- break;
289
- case 'new':
290
- await initCommand();
291
- break;
292
- case 'code':
293
- await codeCommand();
294
- break;
295
- case 'check':
296
- await checkCommand();
297
- break;
298
- case 'deploy':
299
- await deployCommand();
300
- break;
301
- case 'fix':
302
- await fixCommand();
303
- break;
304
- case 'generate':
305
- await generateCommand();
306
- break;
307
- case 'integrate':
308
- await integrateCommand();
309
- break;
310
- case 'build':
311
- await buildCommand();
312
- break;
313
- case 'prd':
314
- await prdCommand();
315
- break;
316
- case 'prd-maker':
317
- await prdMakerCommand();
318
- break;
319
- case 'advisors':
320
- await advisorsCommand();
321
- break;
322
- case 'gateway':
323
- await gatewayCommand();
324
- break;
325
- case 'migrate':
326
- await migrateCommand();
327
- break;
328
- case 'settings':
329
- await setupCommand();
330
- break;
331
- case 'help':
332
- showHelp();
333
- break;
334
- default:
335
- console.log(chalk.yellow('Coming soon!'));
336
- }
337
- }
338
-
339
- // ============================================================================
340
- // POST-SETUP INSTRUCTIONS
341
- // ============================================================================
342
-
343
- function showPostSetupInstructions(): void {
344
- console.log(boxen(
345
- chalk.green.bold('✓ Setup complete!\n\n') +
346
- chalk.white('What\'s next?\n\n') +
347
- chalk.cyan('1. ') + 'Navigate to where you want to build:\n' +
348
- chalk.dim(' cd C:\\dev\\my-project\n\n') +
349
- chalk.cyan('2. ') + 'Run CodeBakers:\n' +
350
- chalk.dim(' codebakers\n\n') +
351
- chalk.white('Or build a website right now:\n') +
352
- chalk.dim(' codebakers website'),
353
- { padding: 1, borderColor: 'green', borderStyle: 'round' }
354
- ));
355
- }
356
-
357
- // ============================================================================
358
- // POST-BUILD INSTRUCTIONS (exported for other commands to use)
359
- // ============================================================================
360
-
361
- export function showPostBuildInstructions(projectName: string, projectPath?: string): void {
362
- const displayPath = projectPath || projectName;
363
-
364
- console.log(boxen(
365
- chalk.green.bold(`✓ ${projectName} created!\n\n`) +
366
- chalk.white('Next steps:\n\n') +
367
- chalk.cyan('1. ') + 'Go to your project:\n' +
368
- chalk.dim(` cd ${displayPath}\n\n`) +
369
- chalk.cyan('2. ') + 'Install dependencies:\n' +
370
- chalk.dim(' npm install\n\n') +
371
- chalk.cyan('3. ') + 'Start the dev server:\n' +
372
- chalk.dim(' npm run dev\n\n') +
373
- chalk.cyan('4. ') + 'Open in browser:\n' +
374
- chalk.dim(' http://localhost:3000\n\n') +
375
- chalk.white('Ready to deploy?\n') +
376
- chalk.dim(' codebakers deploy'),
377
- { padding: 1, borderColor: 'green', borderStyle: 'round' }
378
- ));
379
- }
380
-
381
- // ============================================================================
382
- // HELP
383
- // ============================================================================
384
-
385
- function showHelp(): void {
386
- console.log(boxen(`
387
- ${chalk.bold('CodeBakers CLI v' + VERSION)} — AI dev team that follows the rules
388
-
389
- ${chalk.bold.cyan('Getting Started:')}
390
- ${chalk.cyan('codebakers')} Interactive menu
391
- ${chalk.cyan('codebakers setup')} Connect API keys
392
- ${chalk.cyan('codebakers website')} Build website by describing it
393
- ${chalk.cyan('codebakers init')} Create new project
394
-
395
- ${chalk.bold.cyan('In a Project:')}
396
- ${chalk.cyan('codebakers code')} Chat with AI to build features
397
- ${chalk.cyan('codebakers deploy')} Deploy to Vercel
398
- ${chalk.cyan('codebakers check')} Check code quality
399
- ${chalk.cyan('codebakers fix')} Auto-fix errors
400
-
401
- ${chalk.bold.cyan('Planning:')}
402
- ${chalk.cyan('codebakers prd-maker')} Create PRD through interview
403
- ${chalk.cyan('codebakers build')} Build from PRD (parallel agents)
404
- ${chalk.cyan('codebakers advisors')} Consult AI experts
405
-
406
- ${chalk.bold.cyan('Integrations:')}
407
- ${chalk.cyan('codebakers integrate')} 50+ one-click integrations
408
- ${chalk.cyan('codebakers gateway')} WhatsApp, Telegram, Discord
409
-
410
- ${chalk.bold('Docs:')} ${chalk.dim('https://codebakers.dev/docs')}
411
- `, { padding: 1, borderColor: 'cyan', borderStyle: 'round' }));
412
- }
413
-
414
- // ============================================================================
415
- // CLI COMMANDS (Commander)
416
- // ============================================================================
417
-
418
- const program = new Command();
419
-
420
- program
421
- .name('codebakers')
422
- .description('AI dev team that follows the rules')
423
- .version(VERSION)
424
- .action(showMainMenu);
425
-
426
- program
427
- .command('setup')
428
- .description('Configure CodeBakers (API keys)')
429
- .action(setupCommand);
430
-
431
- program
432
- .command('init')
433
- .description('Create a new project')
434
- .option('-n, --name <n>', 'Project name')
435
- .option('-t, --template <t>', 'Template')
436
- .action(initCommand);
437
-
438
- program
439
- .command('code [prompt]')
440
- .description('Start AI coding session')
441
- .option('-w, --watch', 'Watch mode')
442
- .action(codeCommand);
443
-
444
- program
445
- .command('check')
446
- .description('Run code quality checks')
447
- .action(checkCommand);
448
-
449
- program
450
- .command('deploy')
451
- .description('Deploy to production')
452
- .option('-p, --preview', 'Preview deployment')
453
- .option('--no-check', 'Skip quality check')
454
- .action(deployCommand);
455
-
456
- program
457
- .command('fix')
458
- .description('Auto-fix errors with AI')
459
- .action(fixCommand);
460
-
461
- program
462
- .command('generate')
463
- .alias('gen')
464
- .description('Generate components, pages, etc.')
465
- .action(generateCommand);
466
-
467
- program
468
- .command('status')
469
- .description('View project status')
470
- .action(statusCommand);
471
-
472
- program
473
- .command('connect')
474
- .description('Connect external services')
475
- .action(connectCommand);
476
-
477
- program
478
- .command('gateway')
479
- .description('Manage messaging channels (WhatsApp, Telegram, etc.)')
480
- .option('--start', 'Start gateway')
481
- .option('--stop', 'Stop gateway')
482
- .option('--status', 'Show status')
483
- .action(gatewayCommand);
484
-
485
- program
486
- .command('security')
487
- .description('Run security audit')
488
- .action(securityCommand);
489
-
490
- program
491
- .command('learn')
492
- .description('View/manage what CodeBakers has learned')
493
- .action(learnCommand);
494
-
495
- program
496
- .command('design')
497
- .description('Manage design system')
498
- .action(designCommand);
499
-
500
- program
501
- .command('prd [file]')
502
- .description('Build project from PRD')
503
- .action(prdCommand);
504
-
505
- program
506
- .command('advisors')
507
- .alias('dream-team')
508
- .description('Consult AI expert advisors')
509
- .action(advisorsCommand);
510
-
511
- program
512
- .command('migrate')
513
- .alias('db')
514
- .description('Database migrations')
515
- .option('--push', 'Push migrations')
516
- .option('--generate', 'Generate migration')
517
- .option('--status', 'Check status')
518
- .action(migrateCommand);
519
-
520
- program
521
- .command('prd-maker')
522
- .alias('create-prd')
523
- .description('Create PRD through guided interview')
524
- .action(prdMakerCommand);
525
-
526
- program
527
- .command('build [prd-file]')
528
- .alias('swarm')
529
- .description('Parallel build with AI agents')
530
- .option('--sequential', 'Disable parallel')
531
- .action(buildCommand);
532
-
533
- program
534
- .command('integrate [integration]')
535
- .alias('add')
536
- .description('One-click integrations (50+ services)')
537
- .action(integrateCommand);
538
-
539
- program
540
- .command('website')
541
- .alias('site')
542
- .description('Build website by describing it')
543
- .action(websiteCommand);
544
-
545
- program
546
- .command('help')
547
- .description('Show help')
548
- .action(showHelp);
549
-
550
- // ============================================================================
551
- // NATURAL LANGUAGE HANDLER
552
- // ============================================================================
553
-
554
- async function handleNaturalLanguage(input: string): Promise<void> {
555
- const config = new Config();
556
-
557
- console.log(chalk.dim('\n Understanding your request...\n'));
558
-
559
- const parsed = await parseNaturalLanguage(input, config);
560
-
561
- if (!parsed) {
562
- // Fall back to code command with the input as prompt
563
- await codeCommand(input);
564
- return;
565
- }
566
-
567
- // Handle recognized commands
568
- switch (parsed.command) {
569
- case 'deploy':
570
- await deployCommand();
571
- break;
572
- case 'build':
573
- await buildCommand();
574
- break;
575
- case 'code':
576
- await codeCommand(input);
577
- break;
578
- case 'init':
579
- await initCommand();
580
- break;
581
- case 'website':
582
- await websiteCommand();
583
- break;
584
- case 'check':
585
- await checkCommand();
586
- break;
587
- case 'fix':
588
- await fixCommand();
589
- break;
590
- default:
591
- // Fall back to code command
592
- await codeCommand(input);
593
- }
594
- }
595
-
596
- // ============================================================================
597
- // ENTRY POINT
598
- // ============================================================================
599
-
600
- const args = process.argv.slice(2);
601
-
602
- if (args.length === 0) {
603
- // No args - show interactive menu
604
- checkForUpdates().catch(() => {});
605
- showMainMenu().catch(console.error);
606
- } else if (args.length > 0 && args[0] && !args[0].startsWith('-')) {
607
- // Check if it's a known command
608
- const knownCommands = [
609
- 'setup', 'init', 'code', 'check', 'deploy', 'fix', 'generate', 'gen',
610
- 'connect', 'status', 'gateway', 'security', 'learn', 'design',
611
- 'prd', 'advisors', 'dream-team', 'migrate', 'db', 'prd-maker', 'create-prd',
612
- 'build', 'swarm', 'integrate', 'add', 'website', 'site', 'help'
613
- ];
614
-
615
- const firstArg = args[0] as string;
616
-
617
- if (knownCommands.includes(firstArg)) {
618
- program.parse();
619
- } else {
620
- // Natural language input
621
- const input = args.join(' ');
622
- checkForUpdates().catch(() => {});
623
- handleNaturalLanguage(input).catch(console.error);
624
- }
625
- } else {
626
- program.parse();
627
- }