@codebakers/cli 1.1.2 → 1.1.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.
Files changed (2) hide show
  1. package/dist/index.js +60 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -194,33 +194,74 @@ Validation failed: ${validation.error || "Unknown error"}`));
194
194
  await configureIDE(ide, options.force);
195
195
  }
196
196
  await installClaudeMd(apiKey, options.force);
197
+ const isExistingProject = detectExistingProject();
197
198
  const firstName = userName?.split(" ")[0];
198
199
  const greeting = firstName ? `${firstName}, you're` : "You're";
199
200
  console.log(chalk.bold.green("\n\u{1F389} Setup complete!\n"));
200
- if (ide) {
201
+ if (isExistingProject) {
202
+ console.log(chalk.green(`\u2713 ${greeting} ready to upgrade this project!
203
+ `));
204
+ console.log(chalk.bold.yellow("\u{1F4CB} Existing Project Detected\n"));
205
+ console.log(chalk.white("We recommend starting with an audit to see how your code"));
206
+ console.log(chalk.white("compares to CodeBakers production standards.\n"));
207
+ console.log(chalk.bold("Recommended First Step:"));
208
+ console.log(chalk.cyan(" /audit\n"));
209
+ console.log(chalk.dim(" This will scan your codebase and generate a report showing:"));
210
+ console.log(chalk.dim(" \u2022 Security issues (SQL injection, XSS, etc.)"));
211
+ console.log(chalk.dim(" \u2022 Missing validation and error handling"));
212
+ console.log(chalk.dim(" \u2022 Performance opportunities"));
213
+ console.log(chalk.dim(" \u2022 Test coverage gaps"));
214
+ console.log(chalk.dim(" \u2022 Overall score out of 100\n"));
215
+ console.log(chalk.dim("After reviewing the report, you decide what to fix."));
216
+ console.log(chalk.dim("The AI will use CodeBakers patterns for any changes.\n"));
217
+ console.log(chalk.bold("Other Commands:\n"));
218
+ console.log(chalk.cyan(" /feature [idea]") + chalk.dim(" - Add new functionality"));
219
+ console.log(chalk.cyan(" /status") + chalk.dim(" - View project progress\n"));
220
+ } else {
201
221
  console.log(chalk.green(`\u2713 ${greeting} ready to build!
202
222
  `));
203
- console.log(chalk.bold("How it works:"));
204
- console.log(chalk.dim(" 1. Patterns are fetched securely from CodeBakers API"));
205
- console.log(chalk.dim(" 2. No files stored locally - your subscription is protected"));
206
- console.log(chalk.dim(" 3. Always get the latest patterns automatically\n"));
207
- console.log(chalk.bold("You say:"));
208
- console.log(chalk.cyan(' "Add a contact form"\n'));
209
- console.log(chalk.bold("CodeBakers generates:"));
210
- console.log(chalk.dim(" \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
211
- console.log(chalk.dim(" \u2502 ") + chalk.white("ContactForm component with:") + chalk.dim(" \u2502"));
212
- console.log(chalk.dim(" \u2502 ") + chalk.green("\u2713") + chalk.dim(" Zod schema validation (name, email, message) \u2502"));
213
- console.log(chalk.dim(" \u2502 ") + chalk.green("\u2713") + chalk.dim(" React Hook Form with proper error display \u2502"));
214
- console.log(chalk.dim(" \u2502 ") + chalk.green("\u2713") + chalk.dim(" Loading spinner during submission \u2502"));
215
- console.log(chalk.dim(" \u2502 ") + chalk.green("\u2713") + chalk.dim(" Success/error toast notifications \u2502"));
216
- console.log(chalk.dim(" \u2502 ") + chalk.green("\u2713") + chalk.dim(" API route with rate limiting \u2502"));
217
- console.log(chalk.dim(" \u2502 ") + chalk.green("\u2713") + chalk.dim(" Email integration (Resend) \u2502"));
218
- console.log(chalk.dim(" \u2502 ") + chalk.green("\u2713") + chalk.dim(" Accessible, responsive design \u2502"));
219
- console.log(chalk.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"));
220
- console.log(chalk.dim("Start building: just describe what you need.\n"));
223
+ console.log(chalk.bold("4 Commands to Know:\n"));
224
+ console.log(chalk.cyan(" /build [idea]"));
225
+ console.log(chalk.dim(" Start a new project. AI asks questions, plans everything,"));
226
+ console.log(chalk.dim(" then builds phase by phase with tests.\n"));
227
+ console.log(chalk.cyan(" /feature [idea]"));
228
+ console.log(chalk.dim(" Add to an existing project. AI analyzes your codebase"));
229
+ console.log(chalk.dim(" and integrates the new feature properly.\n"));
230
+ console.log(chalk.cyan(" /status"));
231
+ console.log(chalk.dim(" See project progress, what's built, what's next.\n"));
232
+ console.log(chalk.cyan(" /audit"));
233
+ console.log(chalk.dim(" Review code quality, security, and get a score.\n"));
234
+ console.log(chalk.bold("Example:"));
235
+ console.log(chalk.white(" /build a project management tool for remote teams\n"));
236
+ console.log(chalk.dim("The AI will ask discovery questions, create a PRD, and"));
237
+ console.log(chalk.dim("build your app with production patterns + tests.\n"));
221
238
  }
222
239
  });
223
240
  }
241
+ function detectExistingProject() {
242
+ const cwd = process.cwd();
243
+ const indicators = [
244
+ "package.json",
245
+ "src",
246
+ "app",
247
+ "pages",
248
+ "components",
249
+ "lib",
250
+ "tsconfig.json",
251
+ "next.config.js",
252
+ "next.config.mjs",
253
+ "vite.config.ts",
254
+ "tailwind.config.js",
255
+ "tailwind.config.ts"
256
+ ];
257
+ let score = 0;
258
+ for (const indicator of indicators) {
259
+ if (existsSync(join(cwd, indicator))) {
260
+ score++;
261
+ }
262
+ }
263
+ return score >= 2;
264
+ }
224
265
  async function configureIDE(ide, force = false) {
225
266
  const config = IDE_CONFIGS[ide];
226
267
  const spinner = ora(`Configuring ${config.description}...`).start();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebakers/cli",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "CodeBakers CLI - AI prompt patterns for production-ready code",
5
5
  "main": "dist/index.js",
6
6
  "bin": {