@vodmal/vdx-cli 0.7.0 → 0.8.1

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/README.md CHANGED
@@ -24,6 +24,11 @@ invocation; pick global when you'll run `vdx` repeatedly, npx when you
24
24
  don't want anything in your global `node_modules` or you're in an
25
25
  ephemeral environment.
26
26
 
27
+ **First command after install: `vdx doctor`** — it inspects your environment
28
+ (Node version, `vdx` on PATH, git, mise, npm auth, container runtime, Claude
29
+ Code plugin) and points to remedies for everything that's missing or
30
+ sub-optimal.
31
+
27
32
  ## Use
28
33
 
29
34
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vodmal/vdx-cli",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
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
@@ -149,6 +149,65 @@ function checkContainerRuntime(): CheckResult {
149
149
  };
150
150
  }
151
151
 
152
+ function findOnPath(name: string): string | null {
153
+ const PATH = process.env.PATH ?? '';
154
+ const sep = process.platform === 'win32' ? ';' : ':';
155
+ for (const dir of PATH.split(sep)) {
156
+ if (!dir) continue;
157
+ const p = path.join(dir, name);
158
+ if (fs.existsSync(p)) return p;
159
+ }
160
+ return null;
161
+ }
162
+
163
+ function isEphemeralPath(p: string): 'npx-cache' | 'local-bin' | null {
164
+ if (p.includes(`${path.sep}.npm${path.sep}_npx${path.sep}`)) return 'npx-cache';
165
+ if (p.includes(`${path.sep}node_modules${path.sep}.bin${path.sep}`)) return 'local-bin';
166
+ return null;
167
+ }
168
+
169
+ function checkVdxOnPath(): CheckResult {
170
+ const found = findOnPath('vdx');
171
+ if (!found) {
172
+ return {
173
+ id: 'vdx-on-path',
174
+ label: 'vdx install',
175
+ status: 'warning',
176
+ level: 1,
177
+ message:
178
+ '`vdx` not on PATH at check time. If you use a shell alias it is also fine — doctor cannot detect aliases.',
179
+ remedy:
180
+ 'npm i -g @vodmal/vdx-cli OR alias vdx="npx -y -p @vodmal/vdx-cli vdx" OR keep using `npx -y -p @vodmal/vdx-cli vdx …` ad-hoc',
181
+ };
182
+ }
183
+ const ephemeral = isEphemeralPath(found);
184
+ if (ephemeral === 'npx-cache') {
185
+ return {
186
+ id: 'vdx-on-path',
187
+ label: 'vdx install',
188
+ status: 'ok',
189
+ level: 3,
190
+ message: `via npx cache: ${found} (ephemeral; fine for npx-only workflows — always latest)`,
191
+ };
192
+ }
193
+ if (ephemeral === 'local-bin') {
194
+ return {
195
+ id: 'vdx-on-path',
196
+ label: 'vdx install',
197
+ status: 'ok',
198
+ level: 2,
199
+ message: `local node_modules: ${found} (works inside this project only)`,
200
+ };
201
+ }
202
+ return {
203
+ id: 'vdx-on-path',
204
+ label: 'vdx install',
205
+ status: 'ok',
206
+ level: 4,
207
+ message: `global: ${found}`,
208
+ };
209
+ }
210
+
152
211
  function checkClaudeCodePlugin(): CheckResult {
153
212
  const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
154
213
  if (!fs.existsSync(settingsPath)) {
@@ -189,6 +248,7 @@ function checkClaudeCodePlugin(): CheckResult {
189
248
 
190
249
  const CHECKS: Array<() => CheckResult> = [
191
250
  checkNode,
251
+ checkVdxOnPath,
192
252
  checkGit,
193
253
  checkMise,
194
254
  checkNpmAuth,