codebakers 2.3.0 → 2.3.5

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.5';
34
34
 
35
35
  // ASCII art logo
36
36
  const logo = `
@@ -100,33 +100,53 @@ 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
- }
103
+ // Show helpful context message
104
+ console.log(chalk.cyan('\n â„šī¸ This folder doesn\'t have a project yet.'));
105
+ console.log(chalk.dim(' Use the arrow keys to select an option, then press Enter.\n'));
122
106
 
123
- // Handle divider - show menu again
124
- if (action === 'divider1') {
125
- await showStartMenu(config);
126
- return;
127
- }
107
+ let keepRunning = true;
108
+
109
+ while (keepRunning) {
110
+ const action = await p.select({
111
+ message: 'What would you like to do?',
112
+ options: [
113
+ { value: 'website', label: '🌐 Build a website', hint: 'Describe it, AI builds it' },
114
+ { value: 'new', label: '🆕 Create new project', hint: 'Start with Next.js, React, etc.' },
115
+ { value: 'prd-maker', label: 'âœī¸ Plan my project', hint: 'Create a detailed plan first' },
116
+ { value: 'build', label: 'đŸ—ī¸ Build from plan', hint: 'I already have a PRD file' },
117
+ { value: 'advisors', label: '🌟 Get expert advice', hint: 'AI consultants help you decide' },
118
+ { value: 'integrate', label: '🔌 Add a service', hint: 'Stripe, Supabase, Auth, etc.' },
119
+ { value: 'settings', label: 'âš™ī¸ Settings', hint: 'API keys & preferences' },
120
+ { value: 'help', label: '❓ Help', hint: 'Learn how CodeBakers works' },
121
+ { value: 'exit', label: 'đŸšĒ Return to terminal', hint: 'Go back to command line' },
122
+ ],
123
+ });
124
+
125
+ // User pressed Ctrl+C or selected exit
126
+ if (p.isCancel(action) || action === 'exit') {
127
+ console.log('');
128
+ console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
129
+ console.log(chalk.white(' You\'re back in the terminal.'));
130
+ console.log('');
131
+ console.log(chalk.dim(' To start CodeBakers again, type:'));
132
+ console.log(chalk.green(' codebakers'));
133
+ console.log('');
134
+ console.log(chalk.dim(' Quick commands you can run directly:'));
135
+ console.log(chalk.dim(' codebakers website') + chalk.gray(' - Build a website'));
136
+ console.log(chalk.dim(' codebakers code') + chalk.gray(' - Code with AI'));
137
+ console.log(chalk.dim(' codebakers help') + chalk.gray(' - See all commands'));
138
+ console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
139
+ console.log('');
140
+ keepRunning = false;
141
+ break;
142
+ }
128
143
 
129
- await handleAction(action as string, config);
144
+ // Handle the selected action
145
+ await handleAction(action as string, config);
146
+
147
+ // Show a brief pause before showing menu again
148
+ console.log('');
149
+ }
130
150
  }
131
151
 
132
152
  // ============================================================================
@@ -134,34 +154,54 @@ async function showStartMenu(config: Config): Promise<void> {
134
154
  // ============================================================================
135
155
 
136
156
  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
+ // Show helpful context message
158
+ console.log(chalk.cyan('\n â„šī¸ I found an existing project in this folder.'));
159
+ console.log(chalk.dim(' Use the arrow keys to select an option, then press Enter.\n'));
157
160
 
158
- // Handle divider - show menu again
159
- if (action === 'divider1') {
160
- await showProjectMenu(config);
161
- return;
162
- }
161
+ let keepRunning = true;
162
+
163
+ while (keepRunning) {
164
+ const action = await p.select({
165
+ message: 'What would you like to do with this project?',
166
+ options: [
167
+ { value: 'code', label: 'đŸ’Ŧ Code with AI', hint: 'Tell AI what to build or fix' },
168
+ { value: 'deploy', label: '🚀 Deploy to production', hint: 'Make your site live' },
169
+ { value: 'check', label: '🔍 Check my code', hint: 'Find issues & improvements' },
170
+ { value: 'fix', label: '🔧 Fix errors for me', hint: 'AI repairs broken code' },
171
+ { value: 'integrate', label: '🔌 Add a service', hint: 'Stripe, Supabase, Auth, etc.' },
172
+ { value: 'generate', label: '⚡ Create new files', hint: 'Components, pages, APIs' },
173
+ { value: 'new', label: '🆕 Start fresh project', hint: 'Begin something new' },
174
+ { value: 'settings', label: 'âš™ī¸ Settings', hint: 'API keys & preferences' },
175
+ { value: 'help', label: '❓ Help', hint: 'Learn how CodeBakers works' },
176
+ { value: 'exit', label: 'đŸšĒ Return to terminal', hint: 'Go back to command line' },
177
+ ],
178
+ });
179
+
180
+ // User pressed Ctrl+C or selected exit
181
+ if (p.isCancel(action) || action === 'exit') {
182
+ console.log('');
183
+ console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
184
+ console.log(chalk.white(' You\'re back in the terminal.'));
185
+ console.log('');
186
+ console.log(chalk.dim(' To start CodeBakers again, type:'));
187
+ console.log(chalk.green(' codebakers'));
188
+ console.log('');
189
+ console.log(chalk.dim(' Quick commands you can run directly:'));
190
+ console.log(chalk.dim(' codebakers code') + chalk.gray(' - Code with AI'));
191
+ console.log(chalk.dim(' codebakers deploy') + chalk.gray(' - Deploy your project'));
192
+ console.log(chalk.dim(' codebakers help') + chalk.gray(' - See all commands'));
193
+ console.log(chalk.cyan(' ─────────────────────────────────────────────────'));
194
+ console.log('');
195
+ keepRunning = false;
196
+ break;
197
+ }
163
198
 
164
- await handleAction(action as string, config);
199
+ // Handle the selected action
200
+ await handleAction(action as string, config);
201
+
202
+ // Show a brief pause before showing menu again
203
+ console.log('');
204
+ }
165
205
  }
166
206
 
167
207
  // ============================================================================