@vibecheckai/cli 3.3.0 → 3.4.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.
package/bin/registry.js CHANGED
@@ -1,43 +1,42 @@
1
1
  /**
2
- * Vibecheck CLI Command Registry (LOCKED)
2
+ * Vibecheck CLI Command Registry
3
3
  *
4
4
  * Single source of truth for the public CLI surface.
5
5
  * If it isn't here, it does not exist.
6
6
  *
7
- * ═══════════════════════════════════════════════════════════════════════════════
8
- * WORLD-CLASS CLI - Enhanced Registry with Rich Metadata
9
- * ═══════════════════════════════════════════════════════════════════════════════
7
+ * Simple 2-tier model:
8
+ * - FREE ($0): Inspect & Observe
9
+ * - PRO ($69/mo): Fix, Prove & Enforce
10
10
  */
11
11
 
12
12
  "use strict";
13
13
 
14
14
  // ─────────────────────────────────────────────────────────────
15
- // CORE 19 COMMANDS (locked surface area)
15
+ // CLI COMMANDS (2-tier: FREE / PRO)
16
16
  // ─────────────────────────────────────────────────────────────
17
17
  const ALLOWED_COMMANDS = new Set([
18
- // FREE (9) - Core functionality to try the product
18
+ // FREE (10) - Inspect & Observe
19
19
  "init", // one-time setup
20
20
  "doctor", // health check
21
21
  "watch", // continuous mode
22
- "scan", // includes --allowlist subcommand
23
- "ship", // verdict engine
24
- "classify", // Authority: inventory (duplication/legacy maps)
22
+ "scan", // static analysis
23
+ "report", // generate reports
24
+ "context", // generate IDE rules
25
+ "classify", // Authority: inventory (read-only)
25
26
  "login", // authenticate
26
27
  "logout", // remove credentials
27
28
  "whoami", // show current user
28
29
 
29
- // STARTER (7) - Productivity & automation
30
+ // PRO (9) - Fix, Prove & Enforce
31
+ "ship", // verdict engine (GO/NO-GO)
30
32
  "fix", // AI-powered fixes
31
- "report", // generate reports
32
- "context", // generate IDE rules
33
- "guard", // AI guardrails (prompt firewall, hallucination checking)
33
+ "prove", // runtime proof
34
+ "reality", // browser verification
35
+ "gate", // CI/CD enforcement
36
+ "guard", // AI guardrails
34
37
  "mcp", // MCP server
35
- "checkpoint", // baseline comparison & hallucination scoring
36
- "approve", // Authority: get verdicts for authorities
37
-
38
- // PRO (3) - Advanced proof & AI testing
39
- "prove", // includes --bundle for evidence packs
40
- "reality", // includes --agent for AI testing
38
+ "checkpoint", // baseline comparison
39
+ "approve", // Authority: verdicts
41
40
  "polish", // production polish
42
41
  ]);
43
42
 
@@ -49,34 +48,31 @@ function assertAllowedOnly(obj) {
49
48
  }
50
49
 
51
50
  // ─────────────────────────────────────────────────────────────
52
- // COMMANDS (ALLOWED ONLY) - Enhanced with World-Class Metadata
51
+ // COMMANDS - 2-Tier: FREE and PRO ($69/mo)
53
52
  // ─────────────────────────────────────────────────────────────
54
53
  const COMMANDS = {
55
54
  // ══════════════════════════════════════════════════════════════
56
- // FREE TIER (8 commands) - Core functionality to try the product
55
+ // FREE TIER - Inspect & Observe
57
56
  // ══════════════════════════════════════════════════════════════
58
57
 
59
- // ── SETUP ───────────────────────────────────────────────────
60
58
  init: {
61
59
  description: "One-time setup (config + contracts + scripts)",
62
- longDescription: "Initialize vibecheck in your project. Creates configuration files, sets up IDE rules, and optionally connects to the vibecheck dashboard for team collaboration.",
60
+ longDescription: "Initialize vibecheck in your project. Creates configuration files, sets up IDE rules, and optionally connects to the dashboard.",
63
61
  tier: "free",
64
62
  category: "setup",
65
63
  aliases: ["setup", "configure"],
66
64
  runner: () => require("./runners/runInit").runInit,
67
65
  examples: [
68
66
  { command: "vibecheck init", description: "Interactive setup wizard" },
69
- { command: "vibecheck init --local", description: "Quick local-only setup (no API)" },
70
- { command: "vibecheck init --connect", description: "Setup with GitHub integration", tier: "starter" },
71
- { command: "vibecheck init --quick", description: "Non-interactive with sensible defaults" },
67
+ { command: "vibecheck init --local", description: "Quick local-only setup" },
68
+ { command: "vibecheck init --quick", description: "Non-interactive defaults" },
72
69
  ],
73
70
  related: ["doctor", "scan"],
74
- docsUrl: "https://docs.vibecheckai.dev/getting-started",
75
71
  },
76
72
 
77
73
  doctor: {
78
74
  description: "Environment + dependency + config health check",
79
- longDescription: "Comprehensive diagnostics for your development environment. Checks Node.js, package managers, project configuration, and vibecheck setup. Can auto-fix common issues.",
75
+ longDescription: "Comprehensive diagnostics for your development environment.",
80
76
  tier: "free",
81
77
  category: "setup",
82
78
  aliases: ["health", "diag"],
@@ -84,209 +80,220 @@ const COMMANDS = {
84
80
  examples: [
85
81
  { command: "vibecheck doctor", description: "Run all health checks" },
86
82
  { command: "vibecheck doctor --fix", description: "Auto-fix detected issues" },
87
- { command: "vibecheck doctor --json", description: "Output diagnostics as JSON" },
83
+ { command: "vibecheck doctor --json", description: "Output as JSON" },
88
84
  ],
89
85
  related: ["init", "scan"],
90
- docsUrl: "https://docs.vibecheckai.dev/cli/doctor",
91
86
  },
92
87
 
93
88
  watch: {
94
89
  description: "Continuous mode - re-runs on changes",
95
- longDescription: "File watcher that automatically re-runs scans when your code changes. Ideal for development workflows where you want instant feedback.",
90
+ longDescription: "File watcher that automatically re-runs scans when your code changes.",
96
91
  tier: "free",
97
92
  category: "setup",
98
93
  aliases: ["w", "dev"],
99
94
  runner: () => require("./runners/runWatch").runWatch,
100
95
  examples: [
101
- { command: "vibecheck watch", description: "Start watching current directory" },
96
+ { command: "vibecheck watch", description: "Start watching" },
102
97
  { command: "vibecheck watch --path ./src", description: "Watch specific directory" },
103
- { command: "vibecheck watch --debounce 1000", description: "Custom debounce (1 second)" },
104
98
  ],
105
- related: ["scan", "ship"],
106
- docsUrl: "https://docs.vibecheckai.dev/cli/watch",
99
+ related: ["scan"],
107
100
  },
108
101
 
109
- // ── CORE LOOP ───────────────────────────────────────────────
110
102
  scan: {
111
- description: "Route integrity & code analysis; use --allowlist for false positive management",
112
- longDescription: "The core analysis engine. Scans your codebase for route integrity issues, security vulnerabilities, code quality problems, and more. Supports multiple scan layers: AST (fast), Truth (build manifests), and Reality (runtime browser testing).",
103
+ description: "Static code analysis; use --allowlist for false positives",
104
+ longDescription: "Scan your codebase for route integrity issues, security vulnerabilities, and code quality problems.",
113
105
  tier: "free",
114
106
  category: "proof",
115
107
  aliases: ["s", "check"],
116
108
  runner: () => require("./runners/runScan").runScan,
117
109
  examples: [
118
- { command: "vibecheck scan", description: "Quick AST scan (Layer 1)" },
119
- { command: "vibecheck scan --truth", description: "Include build manifest verification" },
120
- { command: "vibecheck scan --reality --url http://localhost:3000", description: "Full runtime proof", tier: "pro" },
121
- { command: "vibecheck scan --autofix", description: "Generate AI fix missions", tier: "starter" },
110
+ { command: "vibecheck scan", description: "Quick scan" },
111
+ { command: "vibecheck scan --profile full", description: "Full scan" },
122
112
  { command: "vibecheck scan --allowlist list", description: "View suppressed findings" },
123
- { command: "vibecheck scan --allowlist add --id R_DEAD_xyz --reason 'Known toggle'", description: "Suppress false positive" },
124
113
  ],
125
- related: ["ship", "fix", "prove"],
126
- docsUrl: "https://docs.vibecheckai.dev/cli/scan",
114
+ related: ["ship", "fix", "report"],
127
115
  },
128
116
 
129
- ship: {
130
- description: "Verdict engine - SHIP / WARN / BLOCK",
131
- longDescription: "The final word on whether your code is ready to ship. Combines all scan results, generates proof graphs, and renders a clear SHIP/WARN/BLOCK verdict. Use before every deployment.",
117
+ report: {
118
+ description: "Generate HTML/MD/SARIF reports",
119
+ longDescription: "Create shareable reports from scan results.",
132
120
  tier: "free",
133
- category: "proof",
134
- aliases: ["verdict", "go"],
135
- runner: () => require("./runners/runShip").runShip,
121
+ category: "output",
122
+ aliases: ["html", "artifact"],
123
+ runner: () => require("./runners/runReport").runReport,
136
124
  examples: [
137
- { command: "vibecheck ship", description: "Get shipping verdict" },
138
- { command: "vibecheck ship --strict", description: "Fail on any warnings" },
139
- { command: "vibecheck ship --badge", description: "Generate status badge" },
140
- { command: "vibecheck ship --fix", description: "Attempt auto-fixes then re-check" },
125
+ { command: "vibecheck report", description: "Generate HTML report" },
126
+ { command: "vibecheck report --format md", description: "Markdown report" },
127
+ { command: "vibecheck report --format sarif", description: "SARIF for GitHub" },
141
128
  ],
142
- related: ["scan", "prove", "fix"],
143
- docsUrl: "https://docs.vibecheckai.dev/cli/ship",
129
+ related: ["scan"],
130
+ },
131
+
132
+ context: {
133
+ description: "Generate IDE rules (.cursorrules, MDC, Copilot)",
134
+ longDescription: "Generate project-aware AI coding rules for your IDE.",
135
+ tier: "free",
136
+ category: "truth",
137
+ aliases: ["rules", "ai-rules", "mdc", "ctx"],
138
+ runner: () => require("./runners/runContext").runContext,
139
+ examples: [
140
+ { command: "vibecheck context", description: "Generate all IDE rules" },
141
+ { command: "vibecheck context --format cursor", description: ".cursorrules only" },
142
+ ],
143
+ related: ["scan", "guard"],
144
+ },
145
+
146
+ classify: {
147
+ description: "Inventory authority - duplication & legacy code maps",
148
+ longDescription: "Read-only inventory of your codebase including duplication maps and legacy code detection.",
149
+ tier: "free",
150
+ category: "authority",
151
+ aliases: ["inventory", "audit"],
152
+ runner: () => require("./runners/runClassify").runClassify,
153
+ examples: [
154
+ { command: "vibecheck classify", description: "Quick inventory" },
155
+ { command: "vibecheck classify --json", description: "JSON output" },
156
+ ],
157
+ related: ["approve", "scan"],
144
158
  },
145
159
 
146
- // ── ACCOUNT (skipAuth) ────────────────────────────────────
147
160
  login: {
148
161
  description: "Authenticate with API key",
149
- longDescription: "Connect your CLI to the vibecheck API. Required for dashboard sync, team features, and paid tier commands.",
162
+ longDescription: "Connect your CLI to the vibecheck API.",
150
163
  tier: "free",
151
164
  category: "account",
152
165
  aliases: ["auth", "signin"],
153
166
  runner: () => require("./runners/runAuth").runLogin,
154
167
  skipAuth: true,
155
168
  examples: [
156
- { command: "vibecheck login", description: "Interactive login (opens browser)" },
157
- { command: "vibecheck login --key YOUR_API_KEY", description: "Login with API key directly" },
158
- { command: "VIBECHECK_API_KEY=xxx vibecheck scan", description: "Use env var (CI/CD)" },
169
+ { command: "vibecheck login", description: "Interactive login" },
170
+ { command: "vibecheck login --key YOUR_API_KEY", description: "Login with key" },
159
171
  ],
160
172
  related: ["logout", "whoami"],
161
- docsUrl: "https://docs.vibecheckai.dev/authentication",
162
173
  },
163
174
 
164
175
  logout: {
165
176
  description: "Remove stored credentials",
166
- longDescription: "Clear your stored API key and log out of the vibecheck CLI.",
167
177
  tier: "free",
168
178
  category: "account",
169
179
  aliases: ["signout"],
170
180
  runner: () => require("./runners/runAuth").runLogout,
171
181
  skipAuth: true,
172
182
  examples: [
173
- { command: "vibecheck logout", description: "Clear stored credentials" },
183
+ { command: "vibecheck logout", description: "Clear credentials" },
174
184
  ],
175
185
  related: ["login", "whoami"],
176
- docsUrl: "https://docs.vibecheckai.dev/authentication",
177
186
  },
178
187
 
179
188
  whoami: {
180
189
  description: "Show current user and plan",
181
- longDescription: "Display your current authentication status, subscription tier, and usage limits.",
182
190
  tier: "free",
183
191
  category: "account",
184
192
  aliases: ["me", "user"],
185
193
  runner: () => require("./runners/runAuth").runWhoami,
186
194
  skipAuth: true,
187
195
  examples: [
188
- { command: "vibecheck whoami", description: "Show current user info" },
189
- { command: "vibecheck whoami --json", description: "Output as JSON" },
196
+ { command: "vibecheck whoami", description: "Show user info" },
190
197
  ],
191
198
  related: ["login", "logout"],
192
- docsUrl: "https://docs.vibecheckai.dev/authentication",
193
199
  },
194
200
 
195
- // ── AUTHORITY SYSTEM (FREE) ──────────────────────────────────
196
- classify: {
197
- description: "Inventory authority - duplication & legacy code maps",
198
- longDescription: "Produces a read-only inventory of your codebase including duplication maps, legacy code detection, and risk classifications. Part of the Authority System - read-only analysis available on FREE tier.",
199
- tier: "free",
200
- category: "authority",
201
- aliases: ["inventory", "audit"],
202
- runner: () => require("./runners/runClassify").runClassify,
201
+ // ══════════════════════════════════════════════════════════════
202
+ // PRO TIER ($69/mo) - Fix, Prove & Enforce
203
+ // ══════════════════════════════════════════════════════════════
204
+
205
+ ship: {
206
+ description: "Verdict engine - SHIP / WARN / BLOCK",
207
+ longDescription: "The final word on whether your code is ready to ship. Combines all scan results and generates a clear verdict.",
208
+ tier: "pro",
209
+ category: "proof",
210
+ aliases: ["verdict", "go"],
211
+ runner: () => require("./runners/runShip").runShip,
203
212
  examples: [
204
- { command: "vibecheck classify", description: "Quick inventory analysis" },
205
- { command: "vibecheck classify --json", description: "JSON output for processing" },
206
- { command: "vibecheck classify --include-semantic", description: "Include semantic duplicates" },
207
- { command: "vibecheck classify --output inventory.md --format markdown", description: "Save as markdown" },
213
+ { command: "vibecheck ship", description: "Get shipping verdict" },
214
+ { command: "vibecheck ship --strict", description: "Fail on warnings" },
215
+ { command: "vibecheck ship --badge", description: "Generate status badge" },
208
216
  ],
209
- related: ["approve", "scan"],
210
- docsUrl: "https://docs.vibecheckai.dev/cli/classify",
217
+ related: ["scan", "prove", "fix"],
211
218
  },
212
219
 
213
- // ══════════════════════════════════════════════════════════════
214
- // STARTER TIER (7 commands) - Productivity & automation
215
- // ══════════════════════════════════════════════════════════════
216
-
217
220
  fix: {
218
221
  description: "AI-powered auto-fix for findings",
219
- longDescription: "Generate surgical AI prompts (missions) to fix detected issues. Each mission includes context, constraints, and verification steps. Use --apply to let AI make changes directly.",
220
- tier: "starter",
222
+ longDescription: "Generate AI prompts to fix detected issues. Use --apply to let AI make changes directly.",
223
+ tier: "pro",
221
224
  category: "proof",
222
225
  aliases: ["f", "repair"],
223
226
  runner: () => require("./runners/runFix").runFix,
224
227
  examples: [
225
- { command: "vibecheck fix", description: "Generate fix missions (prompts only)" },
226
- { command: "vibecheck fix --apply", description: "Apply AI-generated fixes" },
227
- { command: "vibecheck fix --loop", description: "Continuous fix loop until clean" },
228
- { command: "vibecheck fix --max-missions 5", description: "Limit to 5 missions" },
228
+ { command: "vibecheck fix", description: "Generate fix missions" },
229
+ { command: "vibecheck fix --apply", description: "Apply AI fixes" },
230
+ { command: "vibecheck fix --loop", description: "Fix loop until clean" },
229
231
  ],
230
- related: ["scan", "checkpoint", "ship"],
231
- docsUrl: "https://docs.vibecheckai.dev/cli/fix",
232
+ related: ["scan", "ship"],
232
233
  },
233
234
 
234
- report: {
235
- description: "Generate HTML/MD/SARIF reports",
236
- longDescription: "Create beautiful, shareable reports from your scan results. Supports multiple formats for different audiences: HTML for stakeholders, Markdown for docs, SARIF for GitHub code scanning.",
237
- tier: "starter",
238
- category: "output",
239
- aliases: ["html", "artifact"],
240
- runner: () => require("./runners/runReport").runReport,
235
+ prove: {
236
+ description: "Full proof loop with runtime verification",
237
+ longDescription: "Complete verification cycle with runtime testing and evidence generation.",
238
+ tier: "pro",
239
+ category: "proof",
240
+ aliases: ["p", "verify"],
241
+ runner: () => require("./runners/runProve").runProve,
241
242
  examples: [
242
- { command: "vibecheck report", description: "Generate HTML report" },
243
- { command: "vibecheck report --format md", description: "Markdown report" },
244
- { command: "vibecheck report --format sarif", description: "SARIF for GitHub" },
245
- { command: "vibecheck report --type executive", description: "Executive summary" },
246
- { command: "vibecheck report --output ./reports", description: "Custom output directory" },
243
+ { command: "vibecheck prove", description: "Run full proof loop" },
244
+ { command: "vibecheck prove --url http://localhost:3000", description: "With runtime testing" },
245
+ { command: "vibecheck prove --bundle", description: "Generate evidence pack" },
247
246
  ],
248
- related: ["scan", "prove"],
249
- docsUrl: "https://docs.vibecheckai.dev/cli/report",
247
+ related: ["ship", "reality"],
250
248
  },
251
249
 
252
- context: {
253
- description: "Generate IDE rules (.cursorrules, MDC, Windsurf, Copilot)",
254
- longDescription: "Generate project-aware AI coding rules for your IDE. These rules help AI assistants understand your codebase conventions, preventing common mistakes and enforcing patterns.",
255
- tier: "starter",
256
- category: "truth",
257
- aliases: ["rules", "ai-rules", "mdc"],
258
- runner: () => require("./runners/runContext").runContext,
250
+ reality: {
251
+ description: "Browser-based runtime verification",
252
+ longDescription: "Verify your app's runtime behavior with Playwright-powered browser testing.",
253
+ tier: "pro",
254
+ category: "proof",
255
+ aliases: ["browser", "e2e"],
256
+ runner: () => require("./runners/runReality").runReality,
259
257
  examples: [
260
- { command: "vibecheck context", description: "Generate all IDE rule formats" },
261
- { command: "vibecheck context --format cursor", description: ".cursorrules only" },
262
- { command: "vibecheck context --format mdc", description: "MDC format (Cursor)" },
263
- { command: "vibecheck context --format copilot", description: "GitHub Copilot instructions" },
258
+ { command: "vibecheck reality --url http://localhost:3000", description: "Test localhost" },
259
+ { command: "vibecheck reality --auth email:pass", description: "With authentication" },
260
+ { command: "vibecheck reality --agent", description: "AI agent testing" },
264
261
  ],
265
- related: ["scan", "guard"],
266
- docsUrl: "https://docs.vibecheckai.dev/cli/context",
262
+ related: ["prove", "ship"],
263
+ },
264
+
265
+ gate: {
266
+ description: "CI/CD enforcement - fail builds on issues",
267
+ longDescription: "Enforce quality gates in your CI/CD pipeline.",
268
+ tier: "pro",
269
+ category: "automation",
270
+ aliases: ["ci", "enforce"],
271
+ runner: () => require("./runners/runGuard").runGate,
272
+ examples: [
273
+ { command: "vibecheck gate", description: "Run CI gate check" },
274
+ { command: "vibecheck gate --strict", description: "Strict mode" },
275
+ ],
276
+ related: ["ship", "scan"],
267
277
  },
268
278
 
269
279
  guard: {
270
280
  description: "AI guardrails - prompt firewall & hallucination checking",
271
- longDescription: "Validate AI-generated code and prompts. Detects prompt injection attempts, verifies claims against your codebase (hallucination checking), and ensures AI outputs meet your standards.",
272
- tier: "starter",
281
+ longDescription: "Validate AI-generated code and prompts. Detects prompt injection and verifies claims.",
282
+ tier: "pro",
273
283
  category: "truth",
274
284
  aliases: ["ai-guard", "firewall", "validate"],
275
285
  runner: () => require("./runners/runGuard").runGuard,
276
286
  examples: [
277
287
  { command: "vibecheck guard", description: "Run all guardrail checks" },
278
- { command: "vibecheck guard --claims", description: "Verify AI claims against codebase" },
279
- { command: "vibecheck guard --prompts", description: "Check for prompt injection" },
280
- { command: "vibecheck guard --hallucinations", description: "Detect hallucinated code" },
288
+ { command: "vibecheck guard --claims", description: "Verify AI claims" },
281
289
  ],
282
- related: ["context", "checkpoint", "fix"],
283
- docsUrl: "https://docs.vibecheckai.dev/cli/guard",
290
+ related: ["context", "fix"],
284
291
  },
285
292
 
286
293
  mcp: {
287
294
  description: "Start MCP server for AI IDEs",
288
- longDescription: "Launch a Model Context Protocol (MCP) server that integrates vibecheck directly into AI IDEs like Cursor. Enables real-time code analysis, fix suggestions, and proof verification within your editor.",
289
- tier: "starter",
295
+ longDescription: "Launch an MCP server for AI IDE integration.",
296
+ tier: "pro",
290
297
  category: "automation",
291
298
  aliases: [],
292
299
  runner: () => require("./runners/runMcp").runMcp,
@@ -294,149 +301,171 @@ const COMMANDS = {
294
301
  { command: "vibecheck mcp", description: "Start MCP server" },
295
302
  { command: "vibecheck mcp --port 3099", description: "Custom port" },
296
303
  ],
297
- related: ["context", "guard"],
298
- docsUrl: "https://docs.vibecheckai.dev/integrations/mcp",
304
+ related: ["context"],
299
305
  },
300
306
 
301
307
  checkpoint: {
302
308
  description: "Compare baseline vs current, hallucination scoring",
303
- longDescription: "Track changes between scan runs. Detects new issues, resolved issues, and regressions. Includes hallucination scoring to measure drift from your codebase's ground truth.",
304
- tier: "starter",
309
+ longDescription: "Track changes between scan runs. Detects new issues, resolved issues, and regressions.",
310
+ tier: "pro",
305
311
  category: "analysis",
306
312
  aliases: ["cp", "compare", "diff"],
307
313
  runner: () => require("./runners/runCheckpoint").runCheckpoint,
308
314
  examples: [
309
- { command: "vibecheck checkpoint", description: "Compare against last baseline" },
310
- { command: "vibecheck checkpoint --set", description: "Save current as new baseline" },
311
- { command: "vibecheck checkpoint --score", description: "Calculate hallucination score" },
315
+ { command: "vibecheck checkpoint", description: "Compare against baseline" },
316
+ { command: "vibecheck checkpoint --set", description: "Save new baseline" },
312
317
  ],
313
- related: ["scan", "fix", "guard"],
314
- docsUrl: "https://docs.vibecheckai.dev/cli/checkpoint",
318
+ related: ["scan", "fix"],
315
319
  },
316
320
 
317
- // ── AUTHORITY SYSTEM (STARTER) ───────────────────────────────
318
321
  approve: {
319
322
  description: "Authority verdicts - PROCEED/STOP/DEFER with proofs",
320
- longDescription: "Execute authorities to get structured verdicts with proofs. Part of the Authority System - transforms prompts into enforceable policy engines. Requires STARTER for advisory verdicts, PRO for enforcement.",
321
- tier: "starter",
323
+ longDescription: "Execute authorities to get structured verdicts with proofs.",
324
+ tier: "pro",
322
325
  category: "authority",
323
326
  aliases: ["auth-verdict", "authority"],
324
327
  runner: () => require("./runners/runApprove").runApprove,
325
328
  examples: [
326
- { command: "vibecheck approve safe-consolidation", description: "Run safe-consolidation authority" },
327
- { command: "vibecheck approve --list", description: "List available authorities" },
328
- { command: "vibecheck approve safe-consolidation --json", description: "JSON output for CI" },
329
- { command: "vibecheck approve safe-consolidation --badge", description: "Generate badge for PROCEED", tier: "pro" },
329
+ { command: "vibecheck approve safe-consolidation", description: "Run authority" },
330
+ { command: "vibecheck approve --list", description: "List authorities" },
330
331
  ],
331
- related: ["classify", "scan", "ship"],
332
- docsUrl: "https://docs.vibecheckai.dev/cli/approve",
333
- },
334
-
335
- // ══════════════════════════════════════════════════════════════
336
- // PRO TIER (3 commands) - Advanced proof & AI testing
337
- // ══════════════════════════════════════════════════════════════
338
-
339
- reality: {
340
- description: "Runtime proof (browser crawl); use --agent for AI testing",
341
- longDescription: "Browser-based runtime verification. Crawls your app with Playwright, records video/traces/HAR, verifies routes actually work, and captures network evidence. Use --agent for AI-driven autonomous testing.",
342
- tier: "pro",
343
- category: "proof",
344
- caps: "--agent for AI autonomous testing",
345
- aliases: ["r", "test", "e2e"],
346
- runner: () => async (args, ctx) => {
347
- const { runRuntime } = require("./runners/runRuntime");
348
- // Check if --agent flag is present to route to agent subcommand
349
- if (args.includes("--agent") || args.includes("-a")) {
350
- const filteredArgs = args.filter(a => a !== "--agent" && a !== "-a");
351
- return await runRuntime(["agent", ...filteredArgs], ctx);
352
- }
353
- return await runRuntime(["crawl", ...args], ctx);
354
- },
355
- examples: [
356
- { command: "vibecheck reality --url http://localhost:3000", description: "Crawl and verify routes" },
357
- { command: "vibecheck reality --url http://localhost:3000 --headed", description: "Watch browser in action" },
358
- { command: "vibecheck reality --agent --url http://localhost:3000", description: "AI autonomous testing" },
359
- { command: "vibecheck reality --auth ./auth.json", description: "Test with authentication" },
360
- ],
361
- related: ["prove", "scan", "ship"],
362
- docsUrl: "https://docs.vibecheckai.dev/cli/reality",
363
- },
364
-
365
- prove: {
366
- description: "One command reality proof - video + network evidence that your app works",
367
- longDescription: "The ultimate verification command. Runs the full 5-step pipeline: context → reality → ship → fix → verify. Generates a complete evidence pack with video recordings, network traces, and proof artifacts. Perfect for audits and stakeholder demos.",
368
- tier: "pro",
369
- category: "proof",
370
- aliases: ["p", "full", "all"],
371
- caps: "video, trace, HAR recording; use --bundle for evidence pack",
372
- runner: () => require("./runners/runProve").runProve,
373
- examples: [
374
- { command: "vibecheck prove --url http://localhost:3000", description: "Full proof pipeline" },
375
- { command: "vibecheck prove --url http://localhost:3000 --bundle", description: "Generate shareable evidence pack" },
376
- { command: "vibecheck prove --url http://localhost:3000 --stability-runs 3", description: "Run 3x for stability" },
377
- { command: "vibecheck prove --skip-fix", description: "Skip auto-fix step" },
378
- ],
379
- related: ["reality", "scan", "report"],
380
- docsUrl: "https://docs.vibecheckai.dev/cli/prove",
332
+ related: ["classify", "ship"],
381
333
  },
382
334
 
383
335
  polish: {
384
- description: "Production polish analyzer - finds missing essentials",
385
- longDescription: "Deep analysis for production readiness. Checks for missing essentials like error handling, loading states, empty states, accessibility, SEO, performance patterns, and more. Generates a prioritized punch list.",
336
+ description: "Production polish - final cleanup before deploy",
337
+ longDescription: "Final production readiness checks and cleanup.",
386
338
  tier: "pro",
387
- category: "quality",
388
- aliases: ["quality", "finalize", "ready"],
339
+ category: "proof",
340
+ aliases: ["prod", "final"],
389
341
  runner: () => require("./runners/runPolish").runPolish,
390
342
  examples: [
391
- { command: "vibecheck polish", description: "Full production readiness check" },
392
- { command: "vibecheck polish --category accessibility", description: "Focus on a11y" },
393
- { command: "vibecheck polish --category performance", description: "Focus on perf" },
394
- { command: "vibecheck polish --severity high", description: "Only high-priority items" },
343
+ { command: "vibecheck polish", description: "Run polish checks" },
395
344
  ],
396
- related: ["scan", "ship", "prove"],
397
- docsUrl: "https://docs.vibecheckai.dev/cli/polish",
345
+ related: ["ship", "prove"],
398
346
  },
399
347
  };
400
348
 
349
+ // Validate that only allowed commands are defined
401
350
  assertAllowedOnly(COMMANDS);
402
351
 
403
352
  // ─────────────────────────────────────────────────────────────
404
- // DERIVED MAPS
353
+ // TIER HELPERS
354
+ // ─────────────────────────────────────────────────────────────
355
+ function isPro(tier) {
356
+ return tier === "pro";
357
+ }
358
+
359
+ function requiresPro(commandName) {
360
+ const cmd = COMMANDS[commandName];
361
+ return cmd && cmd.tier === "pro";
362
+ }
363
+
364
+ function getFreeCommands() {
365
+ return Object.entries(COMMANDS)
366
+ .filter(([, cmd]) => cmd.tier === "free")
367
+ .map(([name]) => name);
368
+ }
369
+
370
+ function getProCommands() {
371
+ return Object.entries(COMMANDS)
372
+ .filter(([, cmd]) => cmd.tier === "pro")
373
+ .map(([name]) => name);
374
+ }
375
+
376
+ // ─────────────────────────────────────────────────────────────
377
+ // BUILD DERIVED DATA STRUCTURES
405
378
  // ─────────────────────────────────────────────────────────────
379
+
380
+ // Build alias map: { alias -> command }
406
381
  const ALIAS_MAP = {};
407
- for (const [cmd, def] of Object.entries(COMMANDS)) {
408
- for (const alias of def.aliases || []) ALIAS_MAP[alias] = cmd;
382
+ for (const [cmdName, cmd] of Object.entries(COMMANDS)) {
383
+ if (cmd.aliases) {
384
+ for (const alias of cmd.aliases) {
385
+ ALIAS_MAP[alias] = cmdName;
386
+ }
387
+ }
409
388
  }
410
389
 
411
- const ALL_COMMANDS = [
390
+ // All command names including aliases
391
+ const ALL_COMMANDS = new Set([
412
392
  ...Object.keys(COMMANDS),
413
- ...Object.values(COMMANDS).flatMap((c) => c.aliases || []),
414
- ];
393
+ ...Object.keys(ALIAS_MAP),
394
+ ]);
415
395
 
416
396
  // ─────────────────────────────────────────────────────────────
417
- // RUNNER LOADER
397
+ // GETTERS
418
398
  // ─────────────────────────────────────────────────────────────
419
- function getRunner(cmd, styles = {}) {
420
- const def = COMMANDS[cmd];
421
- if (!def) return null;
422
-
423
- const red = styles.red || "";
424
- const reset = styles.reset || "";
425
- const errorSym = styles.errorSymbol || "✗";
426
399
 
400
+ function getRunner(cmd, opts = {}) {
401
+ // Resolve alias to canonical command
402
+ const canonicalCmd = ALIAS_MAP[cmd] || cmd;
403
+ const def = COMMANDS[canonicalCmd];
404
+
405
+ if (!def) {
406
+ return null;
407
+ }
408
+
409
+ if (!def.runner) {
410
+ return null;
411
+ }
412
+
427
413
  try {
428
414
  return def.runner();
429
415
  } catch (e) {
430
- return async () => {
431
- console.error(`${red}${errorSym}${reset} Failed to load ${cmd}: ${e.message}`);
432
- return 1;
433
- };
416
+ if (opts.red && opts.reset) {
417
+ console.error(`${opts.red}${opts.errorSymbol || '×'} Failed to load runner for ${cmd}: ${e.message}${opts.reset}`);
418
+ }
419
+ return null;
420
+ }
421
+ }
422
+
423
+ function getCommand(name) {
424
+ // Check direct name
425
+ if (COMMANDS[name]) return COMMANDS[name];
426
+
427
+ // Check alias map
428
+ const canonical = ALIAS_MAP[name];
429
+ if (canonical && COMMANDS[canonical]) {
430
+ return { ...COMMANDS[canonical], _resolvedFrom: name, _canonicalName: canonical };
434
431
  }
432
+
433
+ return null;
435
434
  }
436
435
 
436
+ function resolveCommand(name) {
437
+ return ALIAS_MAP[name] || name;
438
+ }
439
+
440
+ // ─────────────────────────────────────────────────────────────
441
+ // EXPORTS
442
+ // ─────────────────────────────────────────────────────────────
437
443
  module.exports = {
444
+ // Core data
438
445
  COMMANDS,
446
+ ALLOWED_COMMANDS,
439
447
  ALIAS_MAP,
440
448
  ALL_COMMANDS,
449
+
450
+ // Tier helpers
451
+ isPro,
452
+ requiresPro,
453
+ getFreeCommands,
454
+ getProCommands,
455
+
456
+ // Getters
441
457
  getRunner,
458
+ getCommand,
459
+ resolveCommand,
460
+ listCommands: () => Object.keys(COMMANDS),
461
+
462
+ getCommandsByTier: (tier) =>
463
+ Object.entries(COMMANDS)
464
+ .filter(([, cmd]) => cmd.tier === tier)
465
+ .map(([name, cmd]) => ({ name, ...cmd })),
466
+
467
+ getCommandsByCategory: (category) =>
468
+ Object.entries(COMMANDS)
469
+ .filter(([, cmd]) => cmd.category === category)
470
+ .map(([name, cmd]) => ({ name, ...cmd })),
442
471
  };