Skip to content

Commit bee2bd3

Browse files
committed
fix: apply runtime resolution to CLI add command for Windows
- npx → npx.cmd resolution now works in 'ncp add name npx ...' - Matches behavior of config import and auto-import - Part of fix for #7
1 parent db1d7ed commit bee2bd3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/cli/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { ConfigPrompter } from '../services/config-prompter.js';
2828
import { SchemaCache } from '../cache/schema-cache.js';
2929
import { getCacheDirectory } from '../utils/ncp-paths.js';
3030
import { setNCPTitle, updateNCPProgress } from '../utils/terminal-title.js';
31+
import { getRuntimeForExtension } from '../utils/runtime-detector.js';
3132
import type { CredentialType } from '../auth/secure-credential-store.js';
3233

3334
// Check for no-color flag early
@@ -888,8 +889,11 @@ async function handleManualAdd(name: string, command: string, args: string[], op
888889
}
889890
}
890891

892+
// Apply runtime resolution (npx → npx.cmd on Windows)
893+
const resolvedCommand = getRuntimeForExtension(command);
894+
891895
mcpConfig = {
892-
command,
896+
command: resolvedCommand,
893897
args: args || []
894898
};
895899

0 commit comments

Comments
 (0)