@vibecheckai/cli 3.1.6 → 3.1.8

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.
@@ -11,6 +11,7 @@
11
11
 
12
12
  const fs = require("fs");
13
13
  const path = require("path");
14
+ const { parseGlobalFlags, shouldShowBanner } = require("./lib/global-flags");
14
15
 
15
16
  // Use enhanced wizard if available
16
17
  let InitWizard;
@@ -1100,8 +1101,10 @@ function printComplianceInfo(complianceType) {
1100
1101
  // HELP DISPLAY
1101
1102
  // ═══════════════════════════════════════════════════════════════════════════════
1102
1103
 
1103
- function printHelp() {
1104
- console.log(BANNER_FULL);
1104
+ function printHelp(showBanner = true) {
1105
+ if (showBanner && shouldShowBanner({})) {
1106
+ console.log(BANNER_FULL);
1107
+ }
1105
1108
  console.log(`
1106
1109
  ${c.bold}Usage:${c.reset} vibecheck init [mode] [options]
1107
1110
 
@@ -1176,13 +1179,19 @@ function printHelp() {
1176
1179
  // ═══════════════════════════════════════════════════════════════════════════════
1177
1180
 
1178
1181
  function parseArgs(args) {
1182
+ // Parse global flags first
1183
+ const { flags: globalFlags, cleanArgs } = parseGlobalFlags(args);
1184
+
1179
1185
  const out = {
1180
- path: ".",
1186
+ path: globalFlags.path || ".",
1181
1187
  gitHooks: false,
1182
- help: false,
1188
+ help: globalFlags.help || false,
1183
1189
  quick: false,
1184
- json: false,
1185
- verbose: false,
1190
+ json: globalFlags.json || false,
1191
+ verbose: globalFlags.verbose || false,
1192
+ noBanner: globalFlags.noBanner || false,
1193
+ ci: globalFlags.ci || false,
1194
+ quiet: globalFlags.quiet || false,
1186
1195
  // Mode flags (--local is default, --connect requires STARTER)
1187
1196
  local: false,
1188
1197
  connect: false,
@@ -1194,24 +1203,20 @@ function parseArgs(args) {
1194
1203
  verify: false,
1195
1204
  // Enterprise options
1196
1205
  enterprise: false,
1197
- ci: false,
1198
1206
  compliance: false,
1199
1207
  team: false,
1200
1208
  mcp: false,
1201
- strict: false,
1209
+ strict: globalFlags.strict || false,
1202
1210
  failOnWarn: false,
1203
1211
  detect: false,
1204
1212
  };
1205
1213
 
1206
- for (let i = 0; i < args.length; i++) {
1207
- const a = args[i];
1214
+ for (let i = 0; i < cleanArgs.length; i++) {
1215
+ const a = cleanArgs[i];
1208
1216
  if (a.startsWith("--path=")) out.path = a.split("=")[1];
1209
- if (a === "--path" || a === "-p") out.path = args[++i];
1217
+ if (a === "--path" || a === "-p") out.path = cleanArgs[++i];
1210
1218
  if (a === "--git-hooks") out.gitHooks = true;
1211
- if (a === "--help" || a === "-h") out.help = true;
1212
1219
  if (a === "--quick" || a === "-q") out.quick = true;
1213
- if (a === "--json") out.json = true;
1214
- if (a === "--verbose" || a === "-v") out.verbose = true;
1215
1220
  if (a === "--verify") out.verify = true;
1216
1221
 
1217
1222
  // Enhancement flags
@@ -1602,7 +1607,7 @@ async function runInit(args) {
1602
1607
  const opts = parseArgs(args);
1603
1608
 
1604
1609
  if (opts.help) {
1605
- printHelp();
1610
+ printHelp(shouldShowBanner(opts));
1606
1611
  return 0;
1607
1612
  }
1608
1613
 
@@ -1621,7 +1626,7 @@ async function runInit(args) {
1621
1626
  opts.team || opts.mcp || opts.detect;
1622
1627
 
1623
1628
  if (EnterpriseInit && useEnterprise && !opts.local && !opts.connect) {
1624
- if (!opts.json) {
1629
+ if (shouldShowBanner(opts)) {
1625
1630
  printBanner();
1626
1631
  bannerPrinted = true;
1627
1632
  printEnterpriseHeader(opts);
@@ -1637,7 +1642,7 @@ async function runInit(args) {
1637
1642
 
1638
1643
  // Detect-only mode (quick detection report)
1639
1644
  if (opts.detect) {
1640
- if (!opts.json) {
1645
+ if (shouldShowBanner(opts)) {
1641
1646
  printBanner();
1642
1647
  bannerPrinted = true;
1643
1648
  console.log(` ${c.dim}Project:${c.reset} ${c.bold}${projectName}${c.reset}`);
@@ -1669,8 +1674,9 @@ async function runInit(args) {
1669
1674
 
1670
1675
  // Interactive wizard mode
1671
1676
  if (opts.wizard && InitWizard) {
1672
- if (!opts.json && !bannerPrinted) {
1677
+ if (shouldShowBanner(opts) && !bannerPrinted) {
1673
1678
  printBanner();
1679
+ bannerPrinted = true;
1674
1680
  }
1675
1681
  const wizard = new InitWizard(targetDir, opts);
1676
1682
  return await wizard.run();
@@ -1678,7 +1684,7 @@ async function runInit(args) {
1678
1684
 
1679
1685
  // Repair mode - fix partial state
1680
1686
  if (opts.repair) {
1681
- if (!opts.json && !bannerPrinted) {
1687
+ if (shouldShowBanner(opts) && !bannerPrinted) {
1682
1688
  printBanner();
1683
1689
  bannerPrinted = true;
1684
1690
  console.log(` ${c.dim}Project:${c.reset} ${c.bold}${projectName}${c.reset}`);
@@ -1690,7 +1696,7 @@ async function runInit(args) {
1690
1696
  }
1691
1697
 
1692
1698
  // Print banner only once (not already printed in enterprise/detect modes)
1693
- if (!opts.json && !bannerPrinted) {
1699
+ if (shouldShowBanner(opts) && !bannerPrinted) {
1694
1700
  printBanner();
1695
1701
  bannerPrinted = true;
1696
1702
 
@@ -8,6 +8,7 @@
8
8
 
9
9
  const fs = require("fs");
10
10
  const path = require("path");
11
+ const { parseGlobalFlags, shouldShowBanner } = require("./lib/global-flags");
11
12
  const { buildTruthpack, writeTruthpack } = require("./lib/truth");
12
13
  const { detectPackageManager, detectNext, detectFastify, detectFastifyEntry } = require("./lib/detect");
13
14
  const { readPkg, writePkg, upsertScripts } = require("./lib/pkgjson");
@@ -135,8 +136,10 @@ function printSection(title, icon = '◆') {
135
136
  printDivider();
136
137
  }
137
138
 
138
- function printHelp() {
139
- console.log(BANNER_FULL);
139
+ function printHelp(opts = {}) {
140
+ if (shouldShowBanner(opts)) {
141
+ console.log(BANNER_FULL);
142
+ }
140
143
  console.log(`
141
144
  ${c.bold}Usage:${c.reset} vibecheck install [options]
142
145
 
@@ -174,12 +177,15 @@ function ensureDir(p) {
174
177
 
175
178
  async function runInstall(argsOrContext = {}) {
176
179
  // Handle array args from CLI
180
+ let opts = { noBanner: false, json: false, quiet: false, ci: false };
177
181
  if (Array.isArray(argsOrContext)) {
178
- if (argsOrContext.includes("--help") || argsOrContext.includes("-h")) {
179
- printHelp();
182
+ const { flags } = parseGlobalFlags(argsOrContext);
183
+ opts = { ...opts, ...flags };
184
+ if (opts.help) {
185
+ printHelp(opts);
180
186
  return 0;
181
187
  }
182
- argsOrContext = { repoRoot: process.cwd() };
188
+ argsOrContext = { repoRoot: opts.path || process.cwd() };
183
189
  }
184
190
 
185
191
  const { repoRoot } = argsOrContext;
@@ -187,7 +193,9 @@ async function runInstall(argsOrContext = {}) {
187
193
  const projectName = path.basename(root);
188
194
 
189
195
  // Print banner
190
- console.log(BANNER_FULL);
196
+ if (shouldShowBanner(opts)) {
197
+ console.log(BANNER_FULL);
198
+ }
191
199
  console.log(` ${c.dim}Project:${c.reset} ${c.bold}${projectName}${c.reset}`);
192
200
  console.log(` ${c.dim}Path:${c.reset} ${root}`);
193
201
  console.log();
@@ -25,6 +25,7 @@
25
25
  const fs = require("fs");
26
26
  const path = require("path");
27
27
  const crypto = require("crypto");
28
+ const { parseGlobalFlags, shouldShowBanner } = require("./lib/global-flags");
28
29
 
29
30
  // Entitlements enforcement
30
31
  const entitlements = require("./lib/entitlements-v2");
@@ -612,8 +613,10 @@ function printTierWarning(tier, limits, originalMaxPages, appliedMaxPages, verif
612
613
  // HELP DISPLAY
613
614
  // ═══════════════════════════════════════════════════════════════════════════════
614
615
 
615
- function printHelp() {
616
- console.log(BANNER_FULL);
616
+ function printHelp(opts = {}) {
617
+ if (shouldShowBanner(opts)) {
618
+ console.log(BANNER_FULL);
619
+ }
617
620
  console.log(`
618
621
  ${c.bold}Usage:${c.reset} vibecheck reality --url <url> [options]
619
622
 
@@ -1027,9 +1030,12 @@ function coverageFromTruthpack({ truthpack, visitedUrls }) {
1027
1030
 
1028
1031
  async function runReality(argsOrOpts = {}) {
1029
1032
  // Handle array args from CLI
1033
+ let globalOpts = { noBanner: false, json: false, quiet: false, ci: false };
1030
1034
  if (Array.isArray(argsOrOpts)) {
1031
- if (argsOrOpts.includes("--help") || argsOrOpts.includes("-h")) {
1032
- printHelp();
1035
+ const { flags } = parseGlobalFlags(argsOrOpts);
1036
+ globalOpts = { ...globalOpts, ...flags };
1037
+ if (globalOpts.help) {
1038
+ printHelp(globalOpts);
1033
1039
  return 0;
1034
1040
  }
1035
1041
  // Parse args to options
@@ -1052,6 +1058,7 @@ async function runReality(argsOrOpts = {}) {
1052
1058
  maxPages: parseInt(getArg(["--max-pages"]) || "18", 10),
1053
1059
  maxDepth: parseInt(getArg(["--max-depth"]) || "2", 10),
1054
1060
  timeoutMs: parseInt(getArg(["--timeout"]) || "15000", 10),
1061
+ ...globalOpts,
1055
1062
  };
1056
1063
  }
1057
1064
 
@@ -1071,7 +1078,7 @@ async function runReality(argsOrOpts = {}) {
1071
1078
  } = argsOrOpts;
1072
1079
 
1073
1080
  if (!url) {
1074
- printHelp();
1081
+ printHelp(argsOrOpts);
1075
1082
  console.log(`\n ${colors.error}${ICONS.cross}${c.reset} ${c.bold}Error:${c.reset} --url is required\n`);
1076
1083
  return 1;
1077
1084
  }
@@ -1109,7 +1116,9 @@ async function runReality(argsOrOpts = {}) {
1109
1116
  }
1110
1117
 
1111
1118
  // Print banner
1112
- printBanner();
1119
+ if (shouldShowBanner(argsOrOpts)) {
1120
+ printBanner();
1121
+ }
1113
1122
 
1114
1123
  console.log(` ${c.dim}Project:${c.reset} ${c.bold}${projectName}${c.reset}`);
1115
1124
  console.log(` ${c.dim}URL:${c.reset} ${colors.accent}${url}${c.reset}`);
@@ -14,6 +14,7 @@
14
14
 
15
15
  const fs = require("fs");
16
16
  const path = require("path");
17
+ const { parseGlobalFlags, shouldShowBanner } = require("./lib/global-flags");
17
18
  const { shipCore } = require("./runShip");
18
19
 
19
20
  // ═══════════════════════════════════════════════════════════════════════════════
@@ -273,8 +274,10 @@ function watchDirectory(dir, callback) {
273
274
  };
274
275
  }
275
276
 
276
- function printHelp() {
277
- console.log(BANNER_FULL);
277
+ function printHelp(opts = {}) {
278
+ if (shouldShowBanner(opts)) {
279
+ console.log(BANNER_FULL);
280
+ }
278
281
  console.log(`
279
282
  ${c.bold}Usage:${c.reset} vibecheck watch [options]
280
283
 
@@ -314,9 +317,12 @@ function printHelp() {
314
317
 
315
318
  async function runWatch(argsOrOpts = {}) {
316
319
  // Handle array args from CLI
320
+ let globalOpts = { noBanner: false, json: false, quiet: false, ci: false };
317
321
  if (Array.isArray(argsOrOpts)) {
318
- if (argsOrOpts.includes("--help") || argsOrOpts.includes("-h")) {
319
- printHelp();
322
+ const { flags } = parseGlobalFlags(argsOrOpts);
323
+ globalOpts = { ...globalOpts, ...flags };
324
+ if (globalOpts.help) {
325
+ printHelp(globalOpts);
320
326
  return 0;
321
327
  }
322
328
  const getArg = (flags) => {
@@ -331,6 +337,7 @@ async function runWatch(argsOrOpts = {}) {
331
337
  fastifyEntry: getArg(["--fastify-entry"]),
332
338
  debounceMs: parseInt(getArg(["--debounce"]) || "500", 10),
333
339
  clearScreen: !argsOrOpts.includes("--no-clear"),
340
+ ...globalOpts,
334
341
  };
335
342
  }
336
343
 
package/bin/vibecheck.js CHANGED
@@ -1083,10 +1083,7 @@ async function main() {
1083
1083
  const suggestions = findSimilarCommands(cmd, ALL_COMMANDS);
1084
1084
  console.log(`\n${c.red}${sym.error}${c.reset} Unknown command: ${c.yellow}${cmd}${c.reset}`);
1085
1085
 
1086
- if (cmd === "replay" || cmd === "record") {
1087
- console.log(`\n${c.dim}replay is a PRO feature for session recording.${c.reset}`);
1088
- console.log(`${c.dim}Free alternative:${c.reset} ${c.cyan}vibecheck reality${c.reset} ${c.dim}(one-time runtime proof)${c.reset}`);
1089
- } else if (suggestions.length > 0) {
1086
+ if (suggestions.length > 0) {
1090
1087
  console.log(`\n${c.dim}Did you mean:${c.reset}`);
1091
1088
  suggestions.forEach((s) => {
1092
1089
  const actual = ALIAS_MAP[s] || s;
@@ -1173,47 +1170,8 @@ async function main() {
1173
1170
  runStart,
1174
1171
  };
1175
1172
 
1176
- // Execute command
1177
- switch (cmd) {
1178
- case "prove":
1179
- case "reality":
1180
- case "watch":
1181
- case "ship":
1182
- case "runtime":
1183
- case "export":
1184
- case "security":
1185
- case "install":
1186
- case "pr":
1187
- case "share":
1188
- exitCode = await runner(cmdArgs, context);
1189
- break;
1190
-
1191
- case "ctx":
1192
- case "truthpack":
1193
- if (cmdArgs[0] === "sync") {
1194
- const { runCtxSync } = require("./runners/runCtxSync");
1195
- exitCode = await runCtxSync({ ...context, fastifyEntry: getArgValue(cmdArgs, ["--fastify-entry"]) });
1196
- } else if (cmdArgs[0] === "guard") {
1197
- const { runCtxGuard } = require("./runners/runCtxGuard");
1198
- exitCode = await runCtxGuard.main(cmdArgs.slice(1));
1199
- } else if (cmdArgs[0] === "diff") {
1200
- const { main: ctxDiffMain } = require("./runners/runCtxDiff");
1201
- exitCode = await ctxDiffMain(cmdArgs.slice(1));
1202
- } else if (cmdArgs[0] === "search") {
1203
- const { runContext } = require("./runners/runContext");
1204
- exitCode = await runContext(["--search", ...cmdArgs.slice(1)]);
1205
- } else {
1206
- exitCode = await runner(cmdArgs, context);
1207
- }
1208
- break;
1209
-
1210
- case "status":
1211
- exitCode = await runner({ ...context, json: cmdArgs.includes("--json") });
1212
- break;
1213
-
1214
- default:
1215
- exitCode = await runner(cmdArgs);
1216
- }
1173
+ // Execute command - all commands use consistent runner signature
1174
+ exitCode = await runner(cmdArgs, context);
1217
1175
  } catch (error) {
1218
1176
  console.error(formatError(error, config));
1219
1177
  exitCode = 1;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibecheck-mcp-server",
3
- "version": "3.1.6",
3
+ "version": "3.1.8",
4
4
  "description": "Professional MCP server for vibecheck - Intelligent development environment vibechecks",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibecheckai/cli",
3
- "version": "3.1.6",
3
+ "version": "3.1.8",
4
4
  "description": "Vibecheck CLI - Ship with confidence. One verdict: SHIP | WARN | BLOCK.",
5
5
  "main": "bin/vibecheck.js",
6
6
  "bin": {