@vibecheckai/cli 3.0.2 ā 3.0.3
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/package.json +9 -1
- package/bin/cli-hygiene.js +0 -241
- package/bin/guardrail.js +0 -834
- package/bin/runners/cli-utils.js +0 -1070
- package/bin/runners/context/ai-task-decomposer.js +0 -337
- package/bin/runners/context/analyzer.js +0 -462
- package/bin/runners/context/api-contracts.js +0 -427
- package/bin/runners/context/context-diff.js +0 -342
- package/bin/runners/context/context-pruner.js +0 -291
- package/bin/runners/context/dependency-graph.js +0 -414
- package/bin/runners/context/generators/claude.js +0 -107
- package/bin/runners/context/generators/codex.js +0 -108
- package/bin/runners/context/generators/copilot.js +0 -119
- package/bin/runners/context/generators/cursor.js +0 -514
- package/bin/runners/context/generators/mcp.js +0 -151
- package/bin/runners/context/generators/windsurf.js +0 -180
- package/bin/runners/context/git-context.js +0 -302
- package/bin/runners/context/index.js +0 -1042
- package/bin/runners/context/insights.js +0 -173
- package/bin/runners/context/mcp-server/generate-rules.js +0 -337
- package/bin/runners/context/mcp-server/index.js +0 -1176
- package/bin/runners/context/mcp-server/package.json +0 -24
- package/bin/runners/context/memory.js +0 -200
- package/bin/runners/context/monorepo.js +0 -215
- package/bin/runners/context/multi-repo-federation.js +0 -404
- package/bin/runners/context/patterns.js +0 -253
- package/bin/runners/context/proof-context.js +0 -972
- package/bin/runners/context/security-scanner.js +0 -303
- package/bin/runners/context/semantic-search.js +0 -350
- package/bin/runners/context/shared.js +0 -264
- package/bin/runners/context/team-conventions.js +0 -310
- package/bin/runners/lib/ai-bridge.js +0 -416
- package/bin/runners/lib/analysis-core.js +0 -271
- package/bin/runners/lib/analyzers.js +0 -541
- package/bin/runners/lib/audit-bridge.js +0 -391
- package/bin/runners/lib/auth-truth.js +0 -193
- package/bin/runners/lib/auth.js +0 -215
- package/bin/runners/lib/backup.js +0 -62
- package/bin/runners/lib/billing.js +0 -107
- package/bin/runners/lib/claims.js +0 -118
- package/bin/runners/lib/cli-ui.js +0 -540
- package/bin/runners/lib/compliance-bridge-new.js +0 -0
- package/bin/runners/lib/compliance-bridge.js +0 -165
- package/bin/runners/lib/contracts/auth-contract.js +0 -194
- package/bin/runners/lib/contracts/env-contract.js +0 -178
- package/bin/runners/lib/contracts/external-contract.js +0 -198
- package/bin/runners/lib/contracts/guard.js +0 -168
- package/bin/runners/lib/contracts/index.js +0 -89
- package/bin/runners/lib/contracts/plan-validator.js +0 -311
- package/bin/runners/lib/contracts/route-contract.js +0 -192
- package/bin/runners/lib/detect.js +0 -89
- package/bin/runners/lib/doctor/autofix.js +0 -254
- package/bin/runners/lib/doctor/index.js +0 -37
- package/bin/runners/lib/doctor/modules/dependencies.js +0 -325
- package/bin/runners/lib/doctor/modules/index.js +0 -46
- package/bin/runners/lib/doctor/modules/network.js +0 -250
- package/bin/runners/lib/doctor/modules/project.js +0 -312
- package/bin/runners/lib/doctor/modules/runtime.js +0 -224
- package/bin/runners/lib/doctor/modules/security.js +0 -348
- package/bin/runners/lib/doctor/modules/system.js +0 -213
- package/bin/runners/lib/doctor/modules/vibecheck.js +0 -394
- package/bin/runners/lib/doctor/reporter.js +0 -262
- package/bin/runners/lib/doctor/service.js +0 -262
- package/bin/runners/lib/doctor/types.js +0 -113
- package/bin/runners/lib/doctor/ui.js +0 -263
- package/bin/runners/lib/doctor-enhanced.js +0 -233
- package/bin/runners/lib/doctor-v2.js +0 -608
- package/bin/runners/lib/enforcement.js +0 -72
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced Doctor Command
|
|
3
|
-
*
|
|
4
|
-
* Self-diagnosing CLI that catches 90% of setup issues.
|
|
5
|
-
* Goal: kill support tickets by being brutally helpful.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
const { execSync } = require('child_process');
|
|
11
|
-
|
|
12
|
-
const c = {
|
|
13
|
-
reset: '\x1b[0m',
|
|
14
|
-
bold: '\x1b[1m',
|
|
15
|
-
dim: '\x1b[2m',
|
|
16
|
-
red: '\x1b[31m',
|
|
17
|
-
green: '\x1b[32m',
|
|
18
|
-
yellow: '\x1b[33m',
|
|
19
|
-
cyan: '\x1b[36m',
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
class DoctorEnhanced {
|
|
23
|
-
constructor(projectPath) {
|
|
24
|
-
this.projectPath = projectPath;
|
|
25
|
-
this.issues = [];
|
|
26
|
-
this.fixes = [];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async diagnose() {
|
|
30
|
-
console.log('\nš vibecheck Doctor\n');
|
|
31
|
-
console.log('Checking your environment...\n');
|
|
32
|
-
|
|
33
|
-
await this.checkNodeVersion();
|
|
34
|
-
await this.checkPackageManager();
|
|
35
|
-
await this.checkRequiredBinaries();
|
|
36
|
-
await this.checkEnvVars();
|
|
37
|
-
await this.checkPermissions();
|
|
38
|
-
await this.checkProjectStructure();
|
|
39
|
-
await this.checkCanBuild();
|
|
40
|
-
await this.checkCanRun();
|
|
41
|
-
|
|
42
|
-
this.printReport();
|
|
43
|
-
return this.issues.length === 0 ? 0 : 1;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async checkNodeVersion() {
|
|
47
|
-
try {
|
|
48
|
-
const version = process.version;
|
|
49
|
-
const major = parseInt(version.slice(1).split('.')[0]);
|
|
50
|
-
|
|
51
|
-
if (major < 18) {
|
|
52
|
-
this.issue('Node version too old', `You're running Node ${version}. vibecheck requires Node 18+.`, `nvm install 18 && nvm use 18`);
|
|
53
|
-
} else {
|
|
54
|
-
this.pass(`Node version: ${version}`);
|
|
55
|
-
}
|
|
56
|
-
} catch {
|
|
57
|
-
this.issue('Cannot detect Node version', 'Node.js may not be installed.', 'Install Node.js from nodejs.org');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async checkPackageManager() {
|
|
62
|
-
const managers = ['pnpm', 'npm', 'yarn'];
|
|
63
|
-
let found = null;
|
|
64
|
-
|
|
65
|
-
for (const mgr of managers) {
|
|
66
|
-
try {
|
|
67
|
-
execSync(`${mgr} --version`, { stdio: 'ignore' });
|
|
68
|
-
found = mgr;
|
|
69
|
-
break;
|
|
70
|
-
} catch {
|
|
71
|
-
// Not found
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (!found) {
|
|
76
|
-
this.issue('No package manager found', 'Install pnpm, npm, or yarn.', 'npm install -g pnpm');
|
|
77
|
-
} else {
|
|
78
|
-
this.pass(`Package manager: ${found}`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async checkRequiredBinaries() {
|
|
83
|
-
const binaries = [
|
|
84
|
-
{ name: 'git', required: true },
|
|
85
|
-
{ name: 'playwright', required: false, check: 'npx playwright --version' },
|
|
86
|
-
];
|
|
87
|
-
|
|
88
|
-
for (const bin of binaries) {
|
|
89
|
-
try {
|
|
90
|
-
if (bin.check) {
|
|
91
|
-
execSync(bin.check, { stdio: 'ignore' });
|
|
92
|
-
} else {
|
|
93
|
-
execSync(`which ${bin.name}`, { stdio: 'ignore' });
|
|
94
|
-
}
|
|
95
|
-
this.pass(`${bin.name} found`);
|
|
96
|
-
} catch {
|
|
97
|
-
if (bin.required) {
|
|
98
|
-
this.issue(`${bin.name} not found`, `${bin.name} is required.`, `Install ${bin.name}`);
|
|
99
|
-
} else {
|
|
100
|
-
this.warn(`${bin.name} not found`, `Optional: ${bin.name} enables runtime verification.`, `npx playwright install`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async checkEnvVars() {
|
|
107
|
-
const required = process.env.VIBECHECK_API_KEY ? [] : ['VIBECHECK_API_KEY (optional)'];
|
|
108
|
-
const sensitive = ['API_KEY', 'SECRET', 'TOKEN', 'PASSWORD'];
|
|
109
|
-
|
|
110
|
-
// Check for common missing env vars
|
|
111
|
-
const envFile = path.join(this.projectPath, '.env');
|
|
112
|
-
if (!fs.existsSync(envFile)) {
|
|
113
|
-
this.warn('No .env file', 'Consider creating .env for local configuration.', 'touch .env');
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Check for exposed secrets (but never print them)
|
|
117
|
-
const envExample = path.join(this.projectPath, '.env.example');
|
|
118
|
-
if (fs.existsSync(envExample)) {
|
|
119
|
-
const content = fs.readFileSync(envExample, 'utf8');
|
|
120
|
-
const hasSecrets = sensitive.some(s => content.includes(s));
|
|
121
|
-
if (hasSecrets) {
|
|
122
|
-
this.pass('.env.example found');
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
async checkPermissions() {
|
|
128
|
-
try {
|
|
129
|
-
const testFile = path.join(this.projectPath, '.vibecheck', '.test-write');
|
|
130
|
-
fs.mkdirSync(path.dirname(testFile), { recursive: true });
|
|
131
|
-
fs.writeFileSync(testFile, 'test');
|
|
132
|
-
fs.unlinkSync(testFile);
|
|
133
|
-
this.pass('Write permissions OK');
|
|
134
|
-
} catch {
|
|
135
|
-
this.issue('No write permissions', 'Cannot write to .vibecheck directory.', `chmod -R u+w ${this.projectPath}`);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
async checkProjectStructure() {
|
|
140
|
-
const packageJson = path.join(this.projectPath, 'package.json');
|
|
141
|
-
if (!fs.existsSync(packageJson)) {
|
|
142
|
-
this.issue('No package.json', 'This doesn\'t look like a Node.js project.', 'Run vibecheck init');
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
this.pass('package.json found');
|
|
147
|
-
|
|
148
|
-
// Check for common project structures
|
|
149
|
-
const hasSrc = fs.existsSync(path.join(this.projectPath, 'src')) ||
|
|
150
|
-
fs.existsSync(path.join(this.projectPath, 'app')) ||
|
|
151
|
-
fs.existsSync(path.join(this.projectPath, 'pages'));
|
|
152
|
-
|
|
153
|
-
if (!hasSrc) {
|
|
154
|
-
this.warn('No source directory found', 'vibecheck works best with standard project structures.', 'Consider organizing code in src/ or app/');
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
async checkCanBuild() {
|
|
159
|
-
try {
|
|
160
|
-
const packageJson = JSON.parse(fs.readFileSync(path.join(this.projectPath, 'package.json'), 'utf8'));
|
|
161
|
-
if (packageJson.scripts?.build) {
|
|
162
|
-
try {
|
|
163
|
-
execSync('npm run build', { cwd: this.projectPath, stdio: 'ignore', timeout: 10000 });
|
|
164
|
-
this.pass('Project builds successfully');
|
|
165
|
-
} catch {
|
|
166
|
-
this.warn('Build failed', 'Project may have build errors.', 'Run: npm run build');
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
} catch {
|
|
170
|
-
// Can't check build
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
async checkCanRun() {
|
|
175
|
-
// Minimal runtime check would go here
|
|
176
|
-
// For now, just pass
|
|
177
|
-
this.pass('Runtime check skipped (use --runtime for full check)');
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
issue(title, description, fix) {
|
|
181
|
-
this.issues.push({ type: 'error', title, description, fix });
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
warn(title, description, fix) {
|
|
185
|
-
this.issues.push({ type: 'warning', title, description, fix });
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
pass(message) {
|
|
189
|
-
// Silent pass - only show issues
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
printReport() {
|
|
193
|
-
if (this.issues.length === 0) {
|
|
194
|
-
console.log(`${c.green}${c.bold}ā All checks passed!${c.reset}\n`);
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
console.log('\n' + 'ā'.repeat(70));
|
|
199
|
-
console.log(`${c.bold}DIAGNOSIS REPORT${c.reset}`);
|
|
200
|
-
console.log('ā'.repeat(70) + '\n');
|
|
201
|
-
|
|
202
|
-
const errors = this.issues.filter(i => i.type === 'error');
|
|
203
|
-
const warnings = this.issues.filter(i => i.type === 'warning');
|
|
204
|
-
|
|
205
|
-
if (errors.length > 0) {
|
|
206
|
-
console.log(`${c.red}${c.bold}ā ERRORS (${errors.length}):${c.reset}\n`);
|
|
207
|
-
for (const issue of errors) {
|
|
208
|
-
console.log(` ${c.bold}${issue.title}${c.reset}`);
|
|
209
|
-
console.log(` ${c.dim}${issue.description}${c.reset}`);
|
|
210
|
-
if (issue.fix) {
|
|
211
|
-
console.log(` ${c.cyan}ā Fix: ${issue.fix}${c.reset}`);
|
|
212
|
-
}
|
|
213
|
-
console.log('');
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (warnings.length > 0) {
|
|
218
|
-
console.log(`${c.yellow}${c.bold}ā ļø WARNINGS (${warnings.length}):${c.reset}\n`);
|
|
219
|
-
for (const issue of warnings) {
|
|
220
|
-
console.log(` ${c.bold}${issue.title}${c.reset}`);
|
|
221
|
-
console.log(` ${c.dim}${issue.description}${c.reset}`);
|
|
222
|
-
if (issue.fix) {
|
|
223
|
-
console.log(` ${c.cyan}ā Fix: ${issue.fix}${c.reset}`);
|
|
224
|
-
}
|
|
225
|
-
console.log('');
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
console.log('ā'.repeat(70) + '\n');
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
module.exports = { DoctorEnhanced };
|