@ngocsangairvds/vsaf 4.1.5 → 4.1.6
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
|
@@ -193,7 +193,10 @@ if (!vdsCliFound && vdsScriptsDir) {
|
|
|
193
193
|
// Check vds-scripts has valid structure (pyproject.toml = uv project)
|
|
194
194
|
if (existsSync(join(vdsScriptsDir, 'pyproject.toml'))) {
|
|
195
195
|
mkdirSync(wrapperDir, { recursive: true });
|
|
196
|
-
|
|
196
|
+
|
|
197
|
+
if (process.platform === 'win32') {
|
|
198
|
+
// Windows: Node.js wrapper + .cmd shim
|
|
199
|
+
const wrapperContent = `#!/usr/bin/env node
|
|
197
200
|
// Project-local vds-cli wrapper — created by vsaf install vds-skill
|
|
198
201
|
const { execFileSync } = require('child_process');
|
|
199
202
|
try {
|
|
@@ -202,20 +205,53 @@ try {
|
|
|
202
205
|
process.exit(e.status || 1);
|
|
203
206
|
}
|
|
204
207
|
`;
|
|
205
|
-
|
|
206
|
-
if (process.platform !== 'win32') {
|
|
207
|
-
chmodSync(wrapperPath, 0o755);
|
|
208
|
-
} else {
|
|
208
|
+
writeFileSync(wrapperPath, wrapperContent);
|
|
209
209
|
writeFileSync(wrapperPath + '.cmd', `@node "%~dp0\\vds-cli" %*\r\n`);
|
|
210
|
+
} else {
|
|
211
|
+
// Unix: pure bash wrapper — no node/nvm dependency
|
|
212
|
+
const wrapperContent = `#!/usr/bin/env bash
|
|
213
|
+
# Project-local vds-cli wrapper — created by vsaf install vds-skill
|
|
214
|
+
# Uses bash instead of node to avoid nvm/node PATH issues
|
|
215
|
+
exec uv run --directory ${JSON.stringify(vdsScriptsDir)} --package vds-cli vds-cli "$@"
|
|
216
|
+
`;
|
|
217
|
+
writeFileSync(wrapperPath, wrapperContent);
|
|
218
|
+
chmodSync(wrapperPath, 0o755);
|
|
210
219
|
}
|
|
211
220
|
log('✅', `vds-cli wrapper created: ${wrapperPath}`);
|
|
212
221
|
log(' ', `Points to: ${vdsScriptsDir}`);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
|
|
223
|
+
// Auto-register .claude/bin in CLAUDE.md so Claude Code always finds vds-cli
|
|
224
|
+
const claudeMdPath = join(projectPath, 'CLAUDE.md');
|
|
225
|
+
try {
|
|
226
|
+
const content = existsSync(claudeMdPath) ? readFileSync(claudeMdPath, 'utf-8') : '';
|
|
227
|
+
const pathExport = 'export PATH=".claude/bin:$PATH"';
|
|
228
|
+
if (!content.includes('.claude/bin')) {
|
|
229
|
+
const block = `\n\n## vds-cli PATH\n\nBefore running any \`vds-cli\` command, prepend the local bin directory:\n\`\`\`bash\n${pathExport}\n\`\`\`\nOr use the full path: \`.claude/bin/vds-cli\`\n`;
|
|
230
|
+
writeFileSync(claudeMdPath, content + block);
|
|
231
|
+
log('✅', 'PATH hint added to CLAUDE.md');
|
|
232
|
+
}
|
|
233
|
+
} catch {
|
|
234
|
+
// CLAUDE.md update is best-effort
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Also add Bash permission for .claude/bin/vds-cli in settings.local.json
|
|
238
|
+
const settingsPath = join(projectPath, '.claude', 'settings.local.json');
|
|
239
|
+
try {
|
|
240
|
+
const settings = existsSync(settingsPath)
|
|
241
|
+
? JSON.parse(readFileSync(settingsPath, 'utf-8'))
|
|
242
|
+
: {};
|
|
243
|
+
if (!settings.permissions) settings.permissions = {};
|
|
244
|
+
if (!settings.permissions.allow) settings.permissions.allow = [];
|
|
245
|
+
const vdsRule = 'Bash(.claude/bin/vds-cli *)';
|
|
246
|
+
if (!settings.permissions.allow.some(r => r.includes('.claude/bin/vds-cli'))) {
|
|
247
|
+
settings.permissions.allow.push(vdsRule);
|
|
248
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
249
|
+
log('✅', 'vds-cli permission added to settings.local.json');
|
|
250
|
+
}
|
|
251
|
+
} catch {
|
|
252
|
+
// settings update is best-effort
|
|
218
253
|
}
|
|
254
|
+
|
|
219
255
|
vdsCliFound = true;
|
|
220
256
|
}
|
|
221
257
|
}
|
|
@@ -48,19 +48,22 @@ Do **not** use this skill as the authoritative deep runbook for:
|
|
|
48
48
|
|
|
49
49
|
## Primary Command Entry Points
|
|
50
50
|
|
|
51
|
+
**Resolution order** — try each in sequence, use the first that works:
|
|
52
|
+
|
|
51
53
|
```bash
|
|
52
|
-
#
|
|
54
|
+
# 1. Project-local wrapper (recommended — works with nvm, no PATH setup needed)
|
|
55
|
+
.claude/bin/vds-cli --help
|
|
56
|
+
.claude/bin/vds-cli confluence --help
|
|
57
|
+
.claude/bin/vds-cli jira --help
|
|
58
|
+
.claude/bin/vds-cli bitbucket --help
|
|
59
|
+
|
|
60
|
+
# 2. On PATH (if user added .claude/bin to PATH or installed globally)
|
|
53
61
|
vds-cli --help
|
|
54
|
-
vds-cli confluence --help
|
|
55
|
-
vds-cli jira --help
|
|
56
|
-
vds-cli bitbucket --help
|
|
57
|
-
vds-cli git --help
|
|
58
62
|
|
|
59
|
-
# Direct uv invocation — project-local
|
|
63
|
+
# 3. Direct uv invocation — project-local fallback
|
|
60
64
|
uv run --directory .claude/vds-scripts --package vds-cli vds-cli --help
|
|
61
|
-
uv run --directory .claude/vds-scripts --package audit_orchestrator vds-audit --help
|
|
62
65
|
|
|
63
|
-
# Direct uv invocation — global fallback
|
|
66
|
+
# 4. Direct uv invocation — global fallback
|
|
64
67
|
uv run --directory ~/.claude/vds-scripts --package vds-cli vds-cli --help
|
|
65
68
|
```
|
|
66
69
|
|