@vodmal/vdx-cli 0.8.1 → 0.8.2

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.2",
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') {
@@ -261,7 +279,7 @@ export function runDoctor(): DoctorReport {
261
279
  const ok = checks.filter((c) => c.status === 'ok').length;
262
280
  const warning = checks.filter((c) => c.status === 'warning').length;
263
281
  const missing = checks.filter((c) => c.status === 'missing').length;
264
- return { checks, ok, warning, missing };
282
+ return { cliVersion: readCliVersion(), checks, ok, warning, missing };
265
283
  }
266
284
 
267
285
  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
  );