@vodmal/vdx-cli 0.8.1 → 0.8.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vodmal/vdx-cli",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "vdx — unified lifecycle interface (up/down/build/test/check/fix) + versioned maturity audit with drift detection. Pairs with the vdx Claude Code plugin.",
5
5
  "keywords": [
6
6
  "vdx",
package/src/doctor.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as fs from 'node:fs';
2
2
  import * as os from 'node:os';
3
3
  import * as path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
4
5
  import { execFileSync } from 'node:child_process';
5
6
 
6
7
  export type CheckStatus = 'ok' | 'warning' | 'missing';
@@ -15,12 +16,27 @@ export interface CheckResult {
15
16
  }
16
17
 
17
18
  export interface DoctorReport {
19
+ cliVersion: string;
18
20
  checks: CheckResult[];
19
21
  ok: number;
20
22
  warning: number;
21
23
  missing: number;
22
24
  }
23
25
 
26
+ function readCliVersion(): string {
27
+ try {
28
+ const pkgPath = path.resolve(
29
+ path.dirname(fileURLToPath(import.meta.url)),
30
+ '..',
31
+ 'package.json',
32
+ );
33
+ const raw = JSON.parse(fs.readFileSync(pkgPath, 'utf8')) as { version?: string };
34
+ return raw.version ?? 'unknown';
35
+ } catch {
36
+ return 'unknown';
37
+ }
38
+ }
39
+
24
40
  function probeVersion(binary: string, args: string[] = ['--version']): string | null {
25
41
  try {
26
42
  const out = execFileSync(binary, args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
@@ -187,7 +203,9 @@ function checkVdxOnPath(): CheckResult {
187
203
  label: 'vdx install',
188
204
  status: 'ok',
189
205
  level: 3,
190
- message: `via npx cache: ${found} (ephemeral; fine for npx-only workflows — always latest)`,
206
+ message:
207
+ `via npx cache: ${found} — invoked-only (shell command \`vdx\` will not resolve outside npx). ` +
208
+ `For shell-global command run: npm i -g @vodmal/vdx-cli OR alias vdx="npx -y -p @vodmal/vdx-cli vdx".`,
191
209
  };
192
210
  }
193
211
  if (ephemeral === 'local-bin') {
@@ -208,6 +226,52 @@ function checkVdxOnPath(): CheckResult {
208
226
  };
209
227
  }
210
228
 
229
+ function checkVdxInShell(): CheckResult {
230
+ const found = findOnPath('vdx');
231
+ if (!found) {
232
+ return {
233
+ id: 'vdx-in-shell',
234
+ label: 'vdx in shell',
235
+ status: 'warning',
236
+ level: 1,
237
+ message:
238
+ 'no — `vdx` command not on persistent PATH. If you set a shell alias, it works but doctor cannot detect aliases.',
239
+ remedy:
240
+ 'npm i -g @vodmal/vdx-cli OR alias vdx="npx -y -p @vodmal/vdx-cli vdx"',
241
+ };
242
+ }
243
+ const ephemeral = isEphemeralPath(found);
244
+ if (ephemeral === 'npx-cache') {
245
+ return {
246
+ id: 'vdx-in-shell',
247
+ label: 'vdx in shell',
248
+ status: 'warning',
249
+ level: 1,
250
+ message:
251
+ 'no — only the ephemeral npx-cache binary is on PATH; bare `vdx <verb>` in a fresh shell will not resolve',
252
+ remedy:
253
+ 'npm i -g @vodmal/vdx-cli OR alias vdx="npx -y -p @vodmal/vdx-cli vdx"',
254
+ };
255
+ }
256
+ if (ephemeral === 'local-bin') {
257
+ return {
258
+ id: 'vdx-in-shell',
259
+ label: 'vdx in shell',
260
+ status: 'warning',
261
+ level: 2,
262
+ message: `project-only — \`vdx\` works inside this project root (${found}) but not elsewhere`,
263
+ remedy: 'npm i -g @vodmal/vdx-cli for global shell access',
264
+ };
265
+ }
266
+ return {
267
+ id: 'vdx-in-shell',
268
+ label: 'vdx in shell',
269
+ status: 'ok',
270
+ level: 4,
271
+ message: `yes — \`vdx\` resolves globally (${found})`,
272
+ };
273
+ }
274
+
211
275
  function checkClaudeCodePlugin(): CheckResult {
212
276
  const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
213
277
  if (!fs.existsSync(settingsPath)) {
@@ -249,6 +313,7 @@ function checkClaudeCodePlugin(): CheckResult {
249
313
  const CHECKS: Array<() => CheckResult> = [
250
314
  checkNode,
251
315
  checkVdxOnPath,
316
+ checkVdxInShell,
252
317
  checkGit,
253
318
  checkMise,
254
319
  checkNpmAuth,
@@ -261,7 +326,7 @@ export function runDoctor(): DoctorReport {
261
326
  const ok = checks.filter((c) => c.status === 'ok').length;
262
327
  const warning = checks.filter((c) => c.status === 'warning').length;
263
328
  const missing = checks.filter((c) => c.status === 'missing').length;
264
- return { checks, ok, warning, missing };
329
+ return { cliVersion: readCliVersion(), checks, ok, warning, missing };
265
330
  }
266
331
 
267
332
  const PROJECT_MARKER_FILES = [
package/src/report.ts CHANGED
@@ -76,6 +76,7 @@ export function reportDoctorMarkdown(r: DoctorReport): string {
76
76
  const lines: string[] = [];
77
77
  lines.push('# vdx doctor report');
78
78
  lines.push('');
79
+ lines.push(`- **@vodmal/vdx-cli version**: \`${r.cliVersion}\``);
79
80
  lines.push(
80
81
  `- **OK**: ${r.ok} **Warning**: ${r.warning} **Missing**: ${r.missing}`,
81
82
  );