@codebakers/cli 3.5.0 → 3.6.0

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.
@@ -1,10 +1,15 @@
1
1
  import chalk from 'chalk';
2
- import { existsSync } from 'fs';
2
+ import { existsSync, readFileSync } from 'fs';
3
3
  import { join } from 'path';
4
4
  import { getApiKey } from '../config.js';
5
+ import { getCliVersion } from '../lib/api.js';
5
6
 
6
7
  export async function status(): Promise<void> {
7
- console.log(chalk.blue('\n CodeBakers Status\n'));
8
+ console.log(chalk.blue('\n CodeBakers Status (v6.0)\n'));
9
+
10
+ // Show version
11
+ const version = getCliVersion();
12
+ console.log(chalk.gray(` CLI Version: ${version}\n`));
8
13
 
9
14
  // Check login status
10
15
  const apiKey = getApiKey();
@@ -13,7 +18,7 @@ export async function status(): Promise<void> {
13
18
  console.log(chalk.gray(` Key: ${apiKey.slice(0, 10)}...`));
14
19
  } else {
15
20
  console.log(chalk.red(' ✗ Not logged in'));
16
- console.log(chalk.gray(' Run `codebakers login` to authenticate'));
21
+ console.log(chalk.gray(' Run `codebakers setup` to authenticate'));
17
22
  }
18
23
 
19
24
  console.log('');
@@ -28,20 +33,45 @@ export async function status(): Promise<void> {
28
33
  const hasClaudeMd = existsSync(claudemd);
29
34
  const hasClaudeDir = existsSync(claudeDir);
30
35
 
31
- if (hasCursorRules || hasClaudeMd || hasClaudeDir) {
32
- console.log(chalk.green(' Patterns installed in this directory'));
33
- if (hasCursorRules) {
34
- console.log(chalk.gray(' - .cursorrules (Cursor IDE)'));
35
- }
36
- if (hasClaudeMd) {
37
- console.log(chalk.gray(' - CLAUDE.md (Claude Code)'));
38
- }
39
- if (hasClaudeDir) {
40
- console.log(chalk.gray(' - .claude/ (Pattern modules)'));
36
+ // Check version of installed files
37
+ let isV6 = false;
38
+ if (hasClaudeMd) {
39
+ const content = readFileSync(claudemd, 'utf-8');
40
+ isV6 = content.includes('discover_patterns') || content.includes('v6.0');
41
+ }
42
+
43
+ if (hasCursorRules || hasClaudeMd) {
44
+ if (isV6) {
45
+ console.log(chalk.green(' CodeBakers v6.0 installed'));
46
+ console.log(chalk.gray(' - CLAUDE.md (Claude Code gateway)'));
47
+ console.log(chalk.gray(' - .cursorrules (Cursor IDE gateway)'));
48
+ console.log(chalk.cyan('\n v6.0 Features:'));
49
+ console.log(chalk.gray(' - Server-side patterns (always up-to-date)'));
50
+ console.log(chalk.gray(' - AI calls discover_patterns before coding'));
51
+ console.log(chalk.gray(' - Usage tracking & compliance'));
52
+ } else {
53
+ console.log(chalk.yellow(' ⚠ CodeBakers v5 installed (legacy)'));
54
+ if (hasCursorRules) {
55
+ console.log(chalk.gray(' - .cursorrules'));
56
+ }
57
+ if (hasClaudeMd) {
58
+ console.log(chalk.gray(' - CLAUDE.md'));
59
+ }
60
+ if (hasClaudeDir) {
61
+ console.log(chalk.gray(' - .claude/ (local modules)'));
62
+ }
63
+ console.log(chalk.yellow('\n Upgrade to v6.0:'));
64
+ console.log(chalk.gray(' Run `codebakers go` to upgrade'));
41
65
  }
42
66
  } else {
43
- console.log(chalk.yellow(' ○ Patterns not installed in this directory'));
44
- console.log(chalk.gray(' Run `codebakers install` to install'));
67
+ console.log(chalk.yellow(' ○ CodeBakers not installed in this directory'));
68
+ console.log(chalk.gray(' Run `codebakers go` to install'));
69
+ }
70
+
71
+ // Warn about legacy folder
72
+ if (hasClaudeDir && isV6) {
73
+ console.log(chalk.yellow('\n ⚠ Legacy .claude/ folder found'));
74
+ console.log(chalk.gray(' This can be removed - v6.0 uses server-side patterns'));
45
75
  }
46
76
 
47
77
  console.log('');