@codebakers/cli 3.9.11 → 3.9.13

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.
@@ -608,25 +608,11 @@ function setupCursorIDE(cwd) {
608
608
  spinner.warn('Could not configure Cursor IDE (continuing anyway)');
609
609
  }
610
610
  }
611
- function setupClaudeCodeMCP() {
611
+ function setupClaudeCodeMCP(cwd) {
612
612
  const spinner = (0, ora_1.default)(' Setting up Claude Code MCP...').start();
613
613
  try {
614
- const homeDir = process.env.USERPROFILE || process.env.HOME || '';
615
- let configPath;
616
614
  const isWindows = process.platform === 'win32';
617
- if (isWindows) {
618
- configPath = (0, path_1.join)(homeDir, 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
619
- }
620
- else if (process.platform === 'darwin') {
621
- configPath = (0, path_1.join)(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
622
- }
623
- else {
624
- configPath = (0, path_1.join)(homeDir, '.config', 'claude', 'claude_desktop_config.json');
625
- }
626
- const configDir = (0, path_1.join)(configPath, '..');
627
- if (!(0, fs_1.existsSync)(configDir)) {
628
- (0, fs_1.mkdirSync)(configDir, { recursive: true });
629
- }
615
+ // Create project-level .mcp.json (Claude Code reads this automatically)
630
616
  const mcpConfig = {
631
617
  mcpServers: {
632
618
  codebakers: isWindows
@@ -634,23 +620,24 @@ function setupClaudeCodeMCP() {
634
620
  : { command: 'npx', args: ['-y', '@codebakers/cli', 'serve'] }
635
621
  }
636
622
  };
637
- if ((0, fs_1.existsSync)(configPath)) {
623
+ const mcpJsonPath = (0, path_1.join)(cwd, '.mcp.json');
624
+ if ((0, fs_1.existsSync)(mcpJsonPath)) {
638
625
  try {
639
- const existing = JSON.parse((0, fs_1.readFileSync)(configPath, 'utf-8'));
626
+ const existing = JSON.parse((0, fs_1.readFileSync)(mcpJsonPath, 'utf-8'));
640
627
  if (!existing.mcpServers) {
641
628
  existing.mcpServers = {};
642
629
  }
643
630
  existing.mcpServers.codebakers = mcpConfig.mcpServers.codebakers;
644
- (0, fs_1.writeFileSync)(configPath, JSON.stringify(existing, null, 2));
631
+ (0, fs_1.writeFileSync)(mcpJsonPath, JSON.stringify(existing, null, 2));
645
632
  }
646
633
  catch {
647
- (0, fs_1.writeFileSync)(configPath, JSON.stringify(mcpConfig, null, 2));
634
+ (0, fs_1.writeFileSync)(mcpJsonPath, JSON.stringify(mcpConfig, null, 2));
648
635
  }
649
636
  }
650
637
  else {
651
- (0, fs_1.writeFileSync)(configPath, JSON.stringify(mcpConfig, null, 2));
638
+ (0, fs_1.writeFileSync)(mcpJsonPath, JSON.stringify(mcpConfig, null, 2));
652
639
  }
653
- spinner.succeed('Claude Code MCP configured!');
640
+ spinner.succeed('Claude Code MCP configured (.mcp.json created)');
654
641
  }
655
642
  catch {
656
643
  spinner.warn('Could not configure Claude Code MCP (continuing anyway)');
@@ -1074,11 +1061,16 @@ async function go(options = {}) {
1074
1061
  console.log(chalk_1.default.white(' What was set up:'));
1075
1062
  console.log(chalk_1.default.gray(' • CLAUDE.md - AI instructions for this project'));
1076
1063
  console.log(chalk_1.default.gray(' • .codebakers.json - Project configuration'));
1077
- console.log(chalk_1.default.gray(' • MCP server - Registered with Claude Code\n'));
1078
- console.log(chalk_1.default.yellow(' ⚠️ To activate your trial or login:\n'));
1079
- console.log(chalk_1.default.white(' Open a terminal and run:'));
1080
- console.log(chalk_1.default.cyan(' codebakers go\n'));
1081
- console.log(chalk_1.default.gray(' This requires an interactive terminal for authentication.\n'));
1064
+ console.log(chalk_1.default.gray(' • .mcp.json - MCP server configuration for Claude Code\n'));
1065
+ console.log(chalk_1.default.yellow(' ⚠️ RELOAD REQUIRED to load MCP tools\n'));
1066
+ console.log(chalk_1.default.white(' Claude Code needs to reload to detect the new .mcp.json file.\n'));
1067
+ console.log(chalk_1.default.cyan(' To reload:\n'));
1068
+ console.log(chalk_1.default.gray(' VS Code: ') + chalk_1.default.white('Press ') + chalk_1.default.cyan('Cmd/Ctrl+Shift+P') + chalk_1.default.white(' → type ') + chalk_1.default.cyan('"Reload Window"'));
1069
+ console.log(chalk_1.default.gray(' CLI: ') + chalk_1.default.white('Press ') + chalk_1.default.cyan('Ctrl+C') + chalk_1.default.white(' and run ') + chalk_1.default.cyan('claude') + chalk_1.default.white(' again\n'));
1070
+ console.log(chalk_1.default.white(' After reload, MCP tools (discover_patterns, validate_complete)'));
1071
+ console.log(chalk_1.default.white(' will be available automatically.\n'));
1072
+ console.log(chalk_1.default.gray(' ─────────────────────────────────────────────────────────\n'));
1073
+ console.log(chalk_1.default.gray(' Optional: To activate trial, run ') + chalk_1.default.cyan('codebakers go') + chalk_1.default.gray(' in a terminal.\n'));
1082
1074
  return;
1083
1075
  }
1084
1076
  console.log(chalk_1.default.blue(`
@@ -1461,7 +1453,7 @@ async function setupNewProject(cwd, options = {}, auth) {
1461
1453
  // Setup IDEs and MCP
1462
1454
  console.log('');
1463
1455
  setupCursorIDE(cwd);
1464
- setupClaudeCodeMCP();
1456
+ setupClaudeCodeMCP(cwd);
1465
1457
  // Update .gitignore
1466
1458
  updateGitignore(cwd);
1467
1459
  // How to describe project
@@ -1653,7 +1645,7 @@ async function setupExistingProject(cwd, projectInfo, options = {}, auth) {
1653
1645
  // Setup IDEs and MCP
1654
1646
  console.log('');
1655
1647
  setupCursorIDE(cwd);
1656
- setupClaudeCodeMCP();
1648
+ setupClaudeCodeMCP(cwd);
1657
1649
  // Update .gitignore
1658
1650
  updateGitignore(cwd);
1659
1651
  // Confirm to server
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ const api_js_1 = require("./lib/api.js");
34
34
  // ============================================
35
35
  // Automatic Update Notification
36
36
  // ============================================
37
- const CURRENT_VERSION = '3.9.11';
37
+ const CURRENT_VERSION = '3.9.13';
38
38
  // Simple semver comparison: returns true if v1 > v2
39
39
  function isNewerVersion(v1, v2) {
40
40
  const parts1 = v1.split('.').map(Number);
@@ -210,7 +210,7 @@ const program = new commander_1.Command();
210
210
  program
211
211
  .name('codebakers')
212
212
  .description('CodeBakers CLI - Production patterns for AI-assisted development')
213
- .version('3.9.11');
213
+ .version('3.9.13');
214
214
  // Zero-friction trial entry (no signup required)
215
215
  program
216
216
  .command('go')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebakers/cli",
3
- "version": "3.9.11",
3
+ "version": "3.9.13",
4
4
  "description": "CodeBakers CLI - Production patterns for AI-assisted development",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -659,27 +659,13 @@ function setupCursorIDE(cwd: string): void {
659
659
  }
660
660
  }
661
661
 
662
- function setupClaudeCodeMCP(): void {
662
+ function setupClaudeCodeMCP(cwd: string): void {
663
663
  const spinner = ora(' Setting up Claude Code MCP...').start();
664
664
 
665
665
  try {
666
- const homeDir = process.env.USERPROFILE || process.env.HOME || '';
667
- let configPath: string;
668
666
  const isWindows = process.platform === 'win32';
669
667
 
670
- if (isWindows) {
671
- configPath = join(homeDir, 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
672
- } else if (process.platform === 'darwin') {
673
- configPath = join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
674
- } else {
675
- configPath = join(homeDir, '.config', 'claude', 'claude_desktop_config.json');
676
- }
677
-
678
- const configDir = join(configPath, '..');
679
- if (!existsSync(configDir)) {
680
- mkdirSync(configDir, { recursive: true });
681
- }
682
-
668
+ // Create project-level .mcp.json (Claude Code reads this automatically)
683
669
  const mcpConfig = {
684
670
  mcpServers: {
685
671
  codebakers: isWindows
@@ -688,22 +674,24 @@ function setupClaudeCodeMCP(): void {
688
674
  }
689
675
  };
690
676
 
691
- if (existsSync(configPath)) {
677
+ const mcpJsonPath = join(cwd, '.mcp.json');
678
+
679
+ if (existsSync(mcpJsonPath)) {
692
680
  try {
693
- const existing = JSON.parse(readFileSync(configPath, 'utf-8'));
681
+ const existing = JSON.parse(readFileSync(mcpJsonPath, 'utf-8'));
694
682
  if (!existing.mcpServers) {
695
683
  existing.mcpServers = {};
696
684
  }
697
685
  existing.mcpServers.codebakers = mcpConfig.mcpServers.codebakers;
698
- writeFileSync(configPath, JSON.stringify(existing, null, 2));
686
+ writeFileSync(mcpJsonPath, JSON.stringify(existing, null, 2));
699
687
  } catch {
700
- writeFileSync(configPath, JSON.stringify(mcpConfig, null, 2));
688
+ writeFileSync(mcpJsonPath, JSON.stringify(mcpConfig, null, 2));
701
689
  }
702
690
  } else {
703
- writeFileSync(configPath, JSON.stringify(mcpConfig, null, 2));
691
+ writeFileSync(mcpJsonPath, JSON.stringify(mcpConfig, null, 2));
704
692
  }
705
693
 
706
- spinner.succeed('Claude Code MCP configured!');
694
+ spinner.succeed('Claude Code MCP configured (.mcp.json created)');
707
695
  } catch {
708
696
  spinner.warn('Could not configure Claude Code MCP (continuing anyway)');
709
697
  }
@@ -1210,12 +1198,17 @@ export async function go(options: GoOptions = {}): Promise<void> {
1210
1198
  console.log(chalk.white(' What was set up:'));
1211
1199
  console.log(chalk.gray(' • CLAUDE.md - AI instructions for this project'));
1212
1200
  console.log(chalk.gray(' • .codebakers.json - Project configuration'));
1213
- console.log(chalk.gray(' • MCP server - Registered with Claude Code\n'));
1214
-
1215
- console.log(chalk.yellow(' ⚠️ To activate your trial or login:\n'));
1216
- console.log(chalk.white(' Open a terminal and run:'));
1217
- console.log(chalk.cyan(' codebakers go\n'));
1218
- console.log(chalk.gray(' This requires an interactive terminal for authentication.\n'));
1201
+ console.log(chalk.gray(' • .mcp.json - MCP server configuration for Claude Code\n'));
1202
+
1203
+ console.log(chalk.yellow(' ⚠️ RELOAD REQUIRED to load MCP tools\n'));
1204
+ console.log(chalk.white(' Claude Code needs to reload to detect the new .mcp.json file.\n'));
1205
+ console.log(chalk.cyan(' To reload:\n'));
1206
+ console.log(chalk.gray(' VS Code: ') + chalk.white('Press ') + chalk.cyan('Cmd/Ctrl+Shift+P') + chalk.white(' → type ') + chalk.cyan('"Reload Window"'));
1207
+ console.log(chalk.gray(' CLI: ') + chalk.white('Press ') + chalk.cyan('Ctrl+C') + chalk.white(' and run ') + chalk.cyan('claude') + chalk.white(' again\n'));
1208
+ console.log(chalk.white(' After reload, MCP tools (discover_patterns, validate_complete)'));
1209
+ console.log(chalk.white(' will be available automatically.\n'));
1210
+ console.log(chalk.gray(' ─────────────────────────────────────────────────────────\n'));
1211
+ console.log(chalk.gray(' Optional: To activate trial, run ') + chalk.cyan('codebakers go') + chalk.gray(' in a terminal.\n'));
1219
1212
  return;
1220
1213
  }
1221
1214
 
@@ -1650,7 +1643,7 @@ async function setupNewProject(cwd: string, options: GoOptions = {}, auth?: Auth
1650
1643
  // Setup IDEs and MCP
1651
1644
  console.log('');
1652
1645
  setupCursorIDE(cwd);
1653
- setupClaudeCodeMCP();
1646
+ setupClaudeCodeMCP(cwd);
1654
1647
 
1655
1648
  // Update .gitignore
1656
1649
  updateGitignore(cwd);
@@ -1854,7 +1847,7 @@ async function setupExistingProject(cwd: string, projectInfo: ProjectInfo, optio
1854
1847
  // Setup IDEs and MCP
1855
1848
  console.log('');
1856
1849
  setupCursorIDE(cwd);
1857
- setupClaudeCodeMCP();
1850
+ setupClaudeCodeMCP(cwd);
1858
1851
 
1859
1852
  // Update .gitignore
1860
1853
  updateGitignore(cwd);
package/src/index.ts CHANGED
@@ -34,7 +34,7 @@ import { join } from 'path';
34
34
  // Automatic Update Notification
35
35
  // ============================================
36
36
 
37
- const CURRENT_VERSION = '3.9.11';
37
+ const CURRENT_VERSION = '3.9.13';
38
38
 
39
39
  // Simple semver comparison: returns true if v1 > v2
40
40
  function isNewerVersion(v1: string, v2: string): boolean {
@@ -230,7 +230,7 @@ const program = new Command();
230
230
  program
231
231
  .name('codebakers')
232
232
  .description('CodeBakers CLI - Production patterns for AI-assisted development')
233
- .version('3.9.11');
233
+ .version('3.9.13');
234
234
 
235
235
  // Zero-friction trial entry (no signup required)
236
236
  program