Skip to content

fix(npx): route unknown tools through npx instead of npm#840

Open
gghez wants to merge 1 commit intortk-ai:developfrom
gghez:fix/npx-dispatches-to-npm
Open

fix(npx): route unknown tools through npx instead of npm#840
gghez wants to merge 1 commit intortk-ai:developfrom
gghez:fix/npx-dispatches-to-npm

Conversation

@gghez
Copy link
Copy Markdown

@gghez gghez commented Mar 26, 2026

Summary

  • rtk npx <unknown-tool> was dispatching to npm instead of npx because the
    catch-all in the Npx match arm delegated to npm_cmd::run(), which hardcodes
    resolved_command("npm")
  • Replaced the catch-all with a direct npx invocation that still applies npm
    boilerplate filtering via filter_npm_output

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • 3 new tests covering npx argument parsing
  • Manual testing: rtk npx cowsay hello output inspected

Fixes #815

@aeppling
Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

@gghez gghez force-pushed the fix/npx-dispatches-to-npm branch from 8a53e04 to 737f72a Compare March 27, 2026 00:26
@gghez
Copy link
Copy Markdown
Author

gghez commented Mar 27, 2026

Thanks for the heads up — rebased and updated the import paths to crate::core::*. All tests passing.

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.

3 participants