@codebakers/cli 1.1.3 → 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 +62 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -194,28 +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
- console.log(chalk.green(`\u2713 ${greeting} ready to build!
201
+ if (isExistingProject) {
202
+ console.log(chalk.green(`\u2713 ${greeting} ready to upgrade this project!
201
203
  `));
202
- console.log(chalk.bold("4 Commands to Know:\n"));
203
- console.log(chalk.cyan(" /build [idea]"));
204
- console.log(chalk.dim(" Start a new project. AI asks questions, plans everything,"));
205
- console.log(chalk.dim(" then builds phase by phase with tests.\n"));
206
- console.log(chalk.cyan(" /feature [idea]"));
207
- console.log(chalk.dim(" Add to an existing project. AI analyzes your codebase"));
208
- console.log(chalk.dim(" and integrates the new feature properly.\n"));
209
- console.log(chalk.cyan(" /status"));
210
- console.log(chalk.dim(" See project progress, what's built, what's next.\n"));
211
- console.log(chalk.cyan(" /audit"));
212
- console.log(chalk.dim(" Review code quality, security, and get a score.\n"));
213
- console.log(chalk.bold("Example:"));
214
- console.log(chalk.white(" /build a project management tool for remote teams\n"));
215
- console.log(chalk.dim("The AI will ask discovery questions, create a PRD, and"));
216
- console.log(chalk.dim("build your app with production patterns + tests.\n"));
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 {
221
+ console.log(chalk.green(`\u2713 ${greeting} ready to build!
222
+ `));
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"));
238
+ }
217
239
  });
218
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
+ }
219
265
  async function configureIDE(ide, force = false) {
220
266
  const config = IDE_CONFIGS[ide];
221
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.3",
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": {