@codebakers/cli 1.3.1 → 1.4.1

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
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { Command } from 'commander';
4
+ import chalk from 'chalk';
4
5
  import { login } from './commands/login.js';
5
6
  import { install } from './commands/install.js';
6
7
  import { status } from './commands/status.js';
@@ -12,13 +13,51 @@ import { serve } from './commands/serve.js';
12
13
  import { mcpConfig, mcpUninstall } from './commands/mcp-config.js';
13
14
  import { setup } from './commands/setup.js';
14
15
  import { scaffold } from './commands/scaffold.js';
16
+ import { generate } from './commands/generate.js';
17
+
18
+ // Show welcome message when no command is provided
19
+ function showWelcome(): void {
20
+ console.log(chalk.blue(`
21
+ ╔═══════════════════════════════════════════════════════════╗
22
+ ║ ║
23
+ ║ ${chalk.bold.white('Welcome to CodeBakers!')} ║
24
+ ║ ║
25
+ ║ AI-assisted development with production patterns ║
26
+ ║ ║
27
+ ╚═══════════════════════════════════════════════════════════╝
28
+ `));
29
+
30
+ console.log(chalk.white(' Getting Started:\n'));
31
+ console.log(chalk.cyan(' codebakers setup') + chalk.gray(' One-time setup (recommended first step)'));
32
+ console.log(chalk.cyan(' codebakers scaffold') + chalk.gray(' Create a new project from scratch'));
33
+ console.log(chalk.cyan(' codebakers init') + chalk.gray(' Add patterns to existing project\n'));
34
+
35
+ console.log(chalk.white(' Development:\n'));
36
+ console.log(chalk.cyan(' codebakers generate') + chalk.gray(' Generate components, APIs, services'));
37
+ console.log(chalk.cyan(' codebakers status') + chalk.gray(' Check what\'s installed\n'));
38
+
39
+ console.log(chalk.white(' Examples:\n'));
40
+ console.log(chalk.gray(' $ ') + chalk.cyan('codebakers scaffold'));
41
+ console.log(chalk.gray(' Create a new Next.js + Supabase + Drizzle project\n'));
42
+ console.log(chalk.gray(' $ ') + chalk.cyan('codebakers generate component Button'));
43
+ console.log(chalk.gray(' Generate a React component with TypeScript\n'));
44
+ console.log(chalk.gray(' $ ') + chalk.cyan('codebakers g api users'));
45
+ console.log(chalk.gray(' Generate a Next.js API route with validation\n'));
46
+
47
+ console.log(chalk.white(' All Commands:\n'));
48
+ console.log(chalk.gray(' setup, scaffold, init, generate, status, doctor, login'));
49
+ console.log(chalk.gray(' install, uninstall, install-hook, uninstall-hook'));
50
+ console.log(chalk.gray(' serve, mcp-config, mcp-uninstall\n'));
51
+
52
+ console.log(chalk.gray(' Run ') + chalk.cyan('codebakers <command> --help') + chalk.gray(' for more info\n'));
53
+ }
15
54
 
16
55
  const program = new Command();
17
56
 
18
57
  program
19
58
  .name('codebakers')
20
59
  .description('CodeBakers CLI - Production patterns for AI-assisted development')
21
- .version('1.0.0');
60
+ .version('1.4.0');
22
61
 
23
62
  // Primary command - one-time setup
24
63
  program
@@ -37,6 +76,12 @@ program
37
76
  .description('Create a new project with full stack scaffolding (Next.js + Supabase + Drizzle)')
38
77
  .action(scaffold);
39
78
 
79
+ program
80
+ .command('generate [type] [name]')
81
+ .alias('g')
82
+ .description('Generate code from templates (component, api, service, hook, page, schema, form)')
83
+ .action((type, name) => generate({ type, name }));
84
+
40
85
  program
41
86
  .command('login')
42
87
  .description('Login with your API key')
@@ -91,4 +136,9 @@ program
91
136
  .description('Remove MCP configuration from Claude Code')
92
137
  .action(mcpUninstall);
93
138
 
94
- program.parse();
139
+ // Show welcome if no command provided
140
+ if (process.argv.length <= 2) {
141
+ showWelcome();
142
+ } else {
143
+ program.parse();
144
+ }