@@ -63,17 +63,20 @@ export interface RunCommandOptions {
6363
6464/**
6565 * Generate run command as an array of parts.
66- * For example: ["npx", "eslint"] or ["bunx", "tsc"]
66+ * First element is the package manager label (e.g., "pnpm"), rest are arguments.
67+ * For example: ["pnpm", "dlx", "nuxt"] or ["npx", "eslint"]
6768 */
6869export function getRunCommandParts ( options : RunCommandOptions ) : string [ ] {
6970 const pm = packageManagers . find ( p => p . id === options . packageManager )
7071 if ( ! pm ) return [ ]
7172
7273 const spec = getPackageSpecifier ( options )
74+ // Split execute command (e.g., "pnpm dlx" -> ["pnpm", "dlx"])
75+ const executeParts = pm . execute . split ( ' ' )
7376
7477 // For deno, always use the package specifier
7578 if ( options . packageManager === 'deno' ) {
76- return [ pm . execute , spec ]
79+ return [ ... executeParts , spec ]
7780 }
7881
7982 // For npx/bunx/pnpm dlx/yarn dlx/vlt x, the command name is what gets executed
@@ -86,13 +89,13 @@ export function getRunCommandParts(options: RunCommandOptions): string[] {
8689 : options . packageName
8790 // If command matches base package name, use the package spec
8891 if ( options . command === baseName ) {
89- return [ pm . execute , spec ]
92+ return [ ... executeParts , spec ]
9093 }
9194 // Otherwise use the command name directly (e.g., npx tsc, not npx typescript/tsc)
92- return [ pm . execute , options . command ]
95+ return [ ... executeParts , options . command ]
9396 }
9497
95- return [ pm . execute , spec ]
98+ return [ ... executeParts , spec ]
9699}
97100
98101/**
0 commit comments