Skip to content

fix(npx): use npx (not npm) for unrecognized npx commands#762

Open
lineardevon wants to merge 1 commit intortk-ai:developfrom
lineardevon:fix/npx-passthrough-713
Open

fix(npx): use npx (not npm) for unrecognized npx commands#762
lineardevon wants to merge 1 commit intortk-ai:developfrom
lineardevon:fix/npx-passthrough-713

Conversation

@lineardevon
Copy link

Summary

  • The Commands::Npx catch-all fallback called npm_cmd::run(), which invoked npm instead of npx
  • When npx flags preceded the tool name (e.g. npx -y -p @playwright/cli playwright-cli list), routing fell to the catch-all and ran the wrong binary
  • Replace with direct npx passthrough matching the existing prisma passthrough pattern

Fixes #713

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test (1056 passed on develop)
  • Manual testing: verified rtk npx tsc --version and rtk npx playwright test still route to specialized handlers
  • Verified existing passthrough pattern consistency (prisma at lines 1933-1946)

Note: Flag-aware routing (npx -y tsctsc_cmd) and rewrite-layer regex updates are follow-up opportunities.

The Npx handler's catch-all fallback called npm_cmd::run(), which
invoked `npm` instead of `npx`. When npx flags preceded the tool
name (e.g. `npx -y -p @playwright/cli playwright-cli list`),
args[0] was a flag, not a tool name, so routing fell to the
catch-all — which then ran the wrong binary entirely.

Replace with direct npx passthrough matching the existing prisma
passthrough pattern. Preserves SKIP_ENV_VALIDATION, tracking, and
exit code propagation.

Fixes rtk-ai#713

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Devon Freitas <devon.freitas@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Mar 21, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants