codebakers 2.3.0 → 2.3.4

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/src/index.ts CHANGED
@@ -30,7 +30,7 @@ import { integrateCommand, INTEGRATIONS } from './commands/integrate.js';
30
30
  import { websiteCommand } from './commands/website.js';
31
31
  import { parseNaturalLanguage } from './utils/nlp.js';
32
32
 
33
- const VERSION = '2.3.0';
33
+ const VERSION = '2.3.4';
34
34
 
35
35
  // ASCII art logo
36
36
  const logo = `
@@ -100,33 +100,52 @@ async function showMainMenu(): Promise<void> {
100
100
  // ============================================================================
101
101
 
102
102
  async function showStartMenu(config: Config): Promise<void> {
103
- const action = await p.select({
104
- message: 'What would you like to do?',
105
- options: [
106
- { value: 'website', label: '🌐 Build a website', hint: 'Describe it → AI builds it' },
107
- { value: 'new', label: '🆕 Create new project', hint: 'From scratch with options' },
108
- { value: 'prd-maker', label: '✏️ Create a PRD', hint: 'Plan before building' },
109
- { value: 'build', label: '🏗️ Build from PRD', hint: 'Have a PRD? Build it now' },
110
- { value: 'advisors', label: '🌟 Consult advisors', hint: 'AI experts help you plan' },
111
- { value: 'divider1', label: chalk.dim('─────────────────────────────') },
112
- { value: 'integrate', label: '🔌 Add integration', hint: 'Stripe, Supabase, etc.' },
113
- { value: 'settings', label: '⚙️ Settings', hint: 'API keys & preferences' },
114
- { value: 'help', label: ' Help' },
115
- ],
116
- });
117
-
118
- if (p.isCancel(action)) {
119
- p.cancel('Goodbye!');
120
- process.exit(0);
121
- }
122
-
123
- // Handle divider - show menu again
124
- if (action === 'divider1') {
125
- await showStartMenu(config);
126
- return;
103
+ while (true) {
104
+ const action = await p.select({
105
+ message: 'What would you like to do?',
106
+ options: [
107
+ { value: 'website', label: '🌐 Build a website', hint: 'Describe it AI builds it' },
108
+ { value: 'new', label: '🆕 Create new project', hint: 'Start fresh with Next.js, React, etc.' },
109
+ { value: 'prd-maker', label: '✏️ Create a PRD', hint: 'Plan your project first' },
110
+ { value: 'build', label: '🏗️ Build from PRD', hint: 'Have a PRD file? Build it now' },
111
+ { value: 'advisors', label: '🌟 Consult advisors', hint: 'Get advice from AI experts' },
112
+ { value: 'divider1', label: chalk.dim('─────────────────────────────') },
113
+ { value: 'integrate', label: '🔌 Add integration', hint: 'Stripe, Supabase, Twilio, etc.' },
114
+ { value: 'settings', label: '⚙️ Settings', hint: 'API keys & preferences' },
115
+ { value: 'help', label: '❓ Help', hint: 'Learn how to use CodeBakers' },
116
+ { value: 'divider2', label: chalk.dim('─────────────────────────────') },
117
+ { value: 'exit', label: '🚪 Return to terminal', hint: 'Exit CodeBakers' },
118
+ ],
119
+ });
120
+
121
+ // User pressed Ctrl+C or selected exit
122
+ if (p.isCancel(action) || action === 'exit') {
123
+ console.log('');
124
+ console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
125
+ console.log(chalk.white(' You\'re back in the terminal.'));
126
+ console.log('');
127
+ console.log(chalk.dim(' To start CodeBakers again, type:'));
128
+ console.log(chalk.green(' codebakers'));
129
+ console.log('');
130
+ console.log(chalk.dim(' Quick commands you can run directly:'));
131
+ console.log(chalk.dim(' codebakers website') + chalk.gray(' - Build a website'));
132
+ console.log(chalk.dim(' codebakers code') + chalk.gray(' - Code with AI'));
133
+ console.log(chalk.dim(' codebakers help') + chalk.gray(' - See all commands'));
134
+ console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
135
+ console.log('');
136
+ process.exit(0);
137
+ }
138
+
139
+ // Handle dividers - just continue the loop
140
+ if (action === 'divider1' || action === 'divider2') {
141
+ continue;
142
+ }
143
+
144
+ // Handle the selected action
145
+ await handleAction(action as string, config);
146
+
147
+ // After action completes, loop back to show menu again
127
148
  }
128
-
129
- await handleAction(action as string, config);
130
149
  }
131
150
 
132
151
  // ============================================================================
@@ -134,34 +153,53 @@ async function showStartMenu(config: Config): Promise<void> {
134
153
  // ============================================================================
135
154
 
136
155
  async function showProjectMenu(config: Config): Promise<void> {
137
- const action = await p.select({
138
- message: 'What would you like to do?',
139
- options: [
140
- { value: 'code', label: '💬 Code with AI', hint: 'Build features, fix bugs' },
141
- { value: 'deploy', label: '🚀 Deploy', hint: 'Push to production' },
142
- { value: 'check', label: '🔍 Check code', hint: 'Quality & patterns' },
143
- { value: 'fix', label: '🔧 Fix errors', hint: 'Auto-fix with AI' },
144
- { value: 'integrate', label: '🔌 Add integration', hint: 'Stripe, Supabase, etc.' },
145
- { value: 'generate', label: ' Generate', hint: 'Components, pages' },
146
- { value: 'divider1', label: chalk.dim('─────────────────────────────') },
147
- { value: 'new', label: '🆕 Start new project', hint: 'Create something else' },
148
- { value: 'settings', label: '⚙️ Settings' },
149
- { value: 'help', label: ' Help' },
150
- ],
151
- });
152
-
153
- if (p.isCancel(action)) {
154
- p.cancel('Goodbye!');
155
- process.exit(0);
156
- }
157
-
158
- // Handle divider - show menu again
159
- if (action === 'divider1') {
160
- await showProjectMenu(config);
161
- return;
156
+ while (true) {
157
+ const action = await p.select({
158
+ message: 'What would you like to do?',
159
+ options: [
160
+ { value: 'code', label: '💬 Code with AI', hint: 'Ask AI to build features or fix bugs' },
161
+ { value: 'deploy', label: '🚀 Deploy', hint: 'Push your project live' },
162
+ { value: 'check', label: '🔍 Check code', hint: 'Review quality & patterns' },
163
+ { value: 'fix', label: '🔧 Fix errors', hint: 'AI automatically fixes issues' },
164
+ { value: 'integrate', label: '🔌 Add integration', hint: 'Stripe, Supabase, Twilio, etc.' },
165
+ { value: 'generate', label: '⚡ Generate', hint: 'Create components, pages, APIs' },
166
+ { value: 'divider1', label: chalk.dim('─────────────────────────────') },
167
+ { value: 'new', label: '🆕 Start new project', hint: 'Create a different project' },
168
+ { value: 'settings', label: '⚙️ Settings', hint: 'API keys & preferences' },
169
+ { value: 'help', label: '❓ Help', hint: 'Learn how to use CodeBakers' },
170
+ { value: 'divider2', label: chalk.dim('─────────────────────────────') },
171
+ { value: 'exit', label: '🚪 Return to terminal', hint: 'Exit CodeBakers' },
172
+ ],
173
+ });
174
+
175
+ // User pressed Ctrl+C or selected exit
176
+ if (p.isCancel(action) || action === 'exit') {
177
+ console.log('');
178
+ console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
179
+ console.log(chalk.white(' You\'re back in the terminal.'));
180
+ console.log('');
181
+ console.log(chalk.dim(' To start CodeBakers again, type:'));
182
+ console.log(chalk.green(' codebakers'));
183
+ console.log('');
184
+ console.log(chalk.dim(' Quick commands you can run directly:'));
185
+ console.log(chalk.dim(' codebakers code') + chalk.gray(' - Code with AI'));
186
+ console.log(chalk.dim(' codebakers deploy') + chalk.gray(' - Deploy your project'));
187
+ console.log(chalk.dim(' codebakers help') + chalk.gray(' - See all commands'));
188
+ console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
189
+ console.log('');
190
+ process.exit(0);
191
+ }
192
+
193
+ // Handle dividers - just continue the loop
194
+ if (action === 'divider1' || action === 'divider2') {
195
+ continue;
196
+ }
197
+
198
+ // Handle the selected action
199
+ await handleAction(action as string, config);
200
+
201
+ // After action completes, loop back to show menu again
162
202
  }
163
-
164
- await handleAction(action as string, config);
165
203
  }
166
204
 
167
205
  // ============================================================================