@codebakers/cli 1.1.4 → 1.1.6

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 (44) hide show
  1. package/dist/commands/doctor.d.ts +8 -0
  2. package/dist/commands/doctor.js +218 -0
  3. package/dist/commands/init.d.ts +4 -0
  4. package/dist/commands/init.js +772 -0
  5. package/dist/commands/install-hook.d.ts +12 -0
  6. package/dist/commands/install-hook.js +193 -0
  7. package/dist/commands/install.d.ts +1 -0
  8. package/dist/commands/install.js +81 -0
  9. package/dist/commands/login.d.ts +1 -0
  10. package/dist/commands/login.js +54 -0
  11. package/dist/commands/mcp-config.d.ts +6 -0
  12. package/dist/commands/mcp-config.js +209 -0
  13. package/dist/commands/serve.d.ts +1 -0
  14. package/dist/commands/serve.js +26 -0
  15. package/dist/commands/setup.d.ts +1 -0
  16. package/dist/commands/setup.js +92 -0
  17. package/dist/commands/status.d.ts +1 -0
  18. package/dist/commands/status.js +49 -0
  19. package/dist/commands/uninstall.d.ts +1 -0
  20. package/dist/commands/uninstall.js +50 -0
  21. package/dist/config.d.ts +5 -0
  22. package/dist/config.js +33 -0
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.js +71 -1026
  25. package/dist/mcp/server.d.ts +2 -0
  26. package/dist/mcp/server.js +544 -0
  27. package/package.json +16 -38
  28. package/src/commands/doctor.ts +231 -0
  29. package/src/commands/init.ts +827 -0
  30. package/src/commands/install-hook.ts +207 -0
  31. package/src/commands/install.ts +94 -0
  32. package/src/commands/login.ts +56 -0
  33. package/src/commands/mcp-config.ts +235 -0
  34. package/src/commands/serve.ts +23 -0
  35. package/src/commands/setup.ts +104 -0
  36. package/src/commands/status.ts +48 -0
  37. package/src/commands/uninstall.ts +49 -0
  38. package/src/config.ts +34 -0
  39. package/src/index.ts +87 -0
  40. package/src/mcp/server.ts +617 -0
  41. package/tsconfig.json +16 -0
  42. package/README.md +0 -89
  43. package/dist/chunk-7CKLRE2H.js +0 -36
  44. package/dist/config-R2H6JKGW.js +0 -16
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Run all health checks for CodeBakers setup
3
+ */
4
+ export declare function doctor(): Promise<void>;
5
+ /**
6
+ * Quick check - returns true if basic setup is complete
7
+ */
8
+ export declare function isSetupComplete(): boolean;
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.doctor = doctor;
7
+ exports.isSetupComplete = isSetupComplete;
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const fs_1 = require("fs");
10
+ const path_1 = require("path");
11
+ const os_1 = require("os");
12
+ const install_hook_js_1 = require("./install-hook.js");
13
+ /**
14
+ * Run all health checks for CodeBakers setup
15
+ */
16
+ async function doctor() {
17
+ console.log(chalk_1.default.blue('\n CodeBakers Doctor\n'));
18
+ console.log(chalk_1.default.gray(' Checking your setup...\n'));
19
+ const projectChecks = checkProject();
20
+ const systemChecks = checkSystem();
21
+ // Display project checks
22
+ console.log(chalk_1.default.white(' Project:'));
23
+ for (const check of projectChecks) {
24
+ const icon = check.ok ? chalk_1.default.green('✓') : chalk_1.default.red('✗');
25
+ console.log(` ${icon} ${check.message}`);
26
+ if (check.details && !check.ok) {
27
+ console.log(chalk_1.default.gray(` └─ ${check.details}`));
28
+ }
29
+ }
30
+ console.log(chalk_1.default.white('\n System:'));
31
+ for (const check of systemChecks) {
32
+ const icon = check.ok ? chalk_1.default.green('✓') : chalk_1.default.red('✗');
33
+ console.log(` ${icon} ${check.message}`);
34
+ if (check.details && !check.ok) {
35
+ console.log(chalk_1.default.gray(` └─ ${check.details}`));
36
+ }
37
+ }
38
+ // Summary
39
+ const allChecks = [...projectChecks, ...systemChecks];
40
+ const passed = allChecks.filter(c => c.ok).length;
41
+ const total = allChecks.length;
42
+ console.log('');
43
+ if (passed === total) {
44
+ console.log(chalk_1.default.green(' ✅ Everything looks good!\n'));
45
+ }
46
+ else {
47
+ console.log(chalk_1.default.yellow(` ⚠️ ${passed}/${total} checks passed. See issues above.\n`));
48
+ // Provide fix suggestions
49
+ console.log(chalk_1.default.white(' Suggested fixes:'));
50
+ const claudeMdCheck = projectChecks.find(c => c.message.includes('CLAUDE.md'));
51
+ if (claudeMdCheck && !claudeMdCheck.ok) {
52
+ console.log(chalk_1.default.gray(' • Run: codebakers install'));
53
+ }
54
+ const hookCheck = systemChecks.find(c => c.message.includes('Hook'));
55
+ if (hookCheck && !hookCheck.ok) {
56
+ console.log(chalk_1.default.gray(' • Run: codebakers install-hook'));
57
+ }
58
+ console.log('');
59
+ }
60
+ }
61
+ /**
62
+ * Check project-level setup
63
+ */
64
+ function checkProject() {
65
+ const results = [];
66
+ const cwd = process.cwd();
67
+ // Check CLAUDE.md
68
+ const claudeMdPath = (0, path_1.join)(cwd, 'CLAUDE.md');
69
+ if ((0, fs_1.existsSync)(claudeMdPath)) {
70
+ const content = (0, fs_1.readFileSync)(claudeMdPath, 'utf-8');
71
+ if (content.includes('CODEBAKERS') || content.includes('CodeBakers') || content.includes('.claude')) {
72
+ results.push({ ok: true, message: 'CLAUDE.md exists (CodeBakers router)' });
73
+ }
74
+ else {
75
+ results.push({
76
+ ok: false,
77
+ message: 'CLAUDE.md exists but is not CodeBakers router',
78
+ details: 'Run: codebakers install --force'
79
+ });
80
+ }
81
+ }
82
+ else {
83
+ results.push({
84
+ ok: false,
85
+ message: 'CLAUDE.md not found',
86
+ details: 'Run: codebakers install'
87
+ });
88
+ }
89
+ // Check .claude folder
90
+ const claudeDir = (0, path_1.join)(cwd, '.claude');
91
+ if ((0, fs_1.existsSync)(claudeDir)) {
92
+ results.push({ ok: true, message: '.claude/ folder exists' });
93
+ // Count modules
94
+ try {
95
+ const files = (0, fs_1.readdirSync)(claudeDir).filter(f => f.endsWith('.md'));
96
+ const moduleCount = files.length;
97
+ if (moduleCount >= 10) {
98
+ results.push({ ok: true, message: `${moduleCount} modules present` });
99
+ }
100
+ else if (moduleCount > 0) {
101
+ results.push({
102
+ ok: false,
103
+ message: `Only ${moduleCount} modules found (expected 10+)`,
104
+ details: 'Run: codebakers install to add missing modules'
105
+ });
106
+ }
107
+ else {
108
+ results.push({
109
+ ok: false,
110
+ message: 'No modules found in .claude/',
111
+ details: 'Run: codebakers install'
112
+ });
113
+ }
114
+ // Check for 00-core.md
115
+ const corePath = (0, path_1.join)(claudeDir, '00-core.md');
116
+ if ((0, fs_1.existsSync)(corePath)) {
117
+ results.push({ ok: true, message: '00-core.md exists (base patterns)' });
118
+ }
119
+ else {
120
+ results.push({
121
+ ok: false,
122
+ message: '00-core.md not found',
123
+ details: 'This module is loaded on every task'
124
+ });
125
+ }
126
+ // Check for 00-system.md
127
+ const systemPath = (0, path_1.join)(claudeDir, '00-system.md');
128
+ if ((0, fs_1.existsSync)(systemPath)) {
129
+ results.push({ ok: true, message: '00-system.md exists (workflow module)' });
130
+ }
131
+ else {
132
+ results.push({
133
+ ok: true, // Not required, just recommended
134
+ message: '00-system.md not found (optional workflow module)',
135
+ details: 'Contains 9-step execution flow'
136
+ });
137
+ }
138
+ }
139
+ catch {
140
+ results.push({
141
+ ok: false,
142
+ message: 'Could not read .claude/ folder',
143
+ details: 'Check folder permissions'
144
+ });
145
+ }
146
+ }
147
+ else {
148
+ results.push({
149
+ ok: false,
150
+ message: '.claude/ folder not found',
151
+ details: 'Run: codebakers install'
152
+ });
153
+ }
154
+ // Check PROJECT-STATE.md (optional)
155
+ const statePath = (0, path_1.join)(cwd, 'PROJECT-STATE.md');
156
+ if ((0, fs_1.existsSync)(statePath)) {
157
+ results.push({ ok: true, message: 'PROJECT-STATE.md exists' });
158
+ }
159
+ else {
160
+ results.push({
161
+ ok: true, // It's optional
162
+ message: 'PROJECT-STATE.md not found (created on first run)',
163
+ });
164
+ }
165
+ return results;
166
+ }
167
+ /**
168
+ * Check system-level setup
169
+ */
170
+ function checkSystem() {
171
+ const results = [];
172
+ // Check hook installation
173
+ if ((0, install_hook_js_1.isHookInstalled)()) {
174
+ results.push({ ok: true, message: 'Hook installed in ~/.claude/settings.json' });
175
+ }
176
+ else {
177
+ results.push({
178
+ ok: false,
179
+ message: 'Hook not installed',
180
+ details: 'Run: codebakers install-hook'
181
+ });
182
+ }
183
+ // Check ~/.claude directory exists
184
+ const claudeConfigDir = (0, path_1.join)((0, os_1.homedir)(), '.claude');
185
+ if ((0, fs_1.existsSync)(claudeConfigDir)) {
186
+ results.push({ ok: true, message: '~/.claude directory exists' });
187
+ }
188
+ else {
189
+ results.push({
190
+ ok: false,
191
+ message: '~/.claude directory not found',
192
+ details: 'Run: codebakers install-hook (will create it)'
193
+ });
194
+ }
195
+ // Check settings.json exists
196
+ const settingsPath = (0, path_1.join)(claudeConfigDir, 'settings.json');
197
+ if ((0, fs_1.existsSync)(settingsPath)) {
198
+ results.push({ ok: true, message: '~/.claude/settings.json exists' });
199
+ }
200
+ else {
201
+ results.push({
202
+ ok: true, // Will be created by install-hook
203
+ message: '~/.claude/settings.json not found',
204
+ details: 'Run: codebakers install-hook'
205
+ });
206
+ }
207
+ return results;
208
+ }
209
+ /**
210
+ * Quick check - returns true if basic setup is complete
211
+ */
212
+ function isSetupComplete() {
213
+ const cwd = process.cwd();
214
+ const hasClaudeMd = (0, fs_1.existsSync)((0, path_1.join)(cwd, 'CLAUDE.md'));
215
+ const hasClaudeDir = (0, fs_1.existsSync)((0, path_1.join)(cwd, '.claude'));
216
+ const hasHook = (0, install_hook_js_1.isHookInstalled)();
217
+ return hasClaudeMd && hasClaudeDir && hasHook;
218
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Interactive init command - walks users through complete setup
3
+ */
4
+ export declare function init(): Promise<void>;