rtk-ai/rtk
Auf GitHub ansehenbug: npm rule in rewrite registry misses install — filter already exists in npm_cmd.rs
Open
#1.148 geöffnet am 10. Apr. 2026
area:clibugeffort-smallfilter-qualitygood first issueplatform:macospriority:low
Repository-Metriken
- Stars
- (48.085 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 11T 1h) (45 gemergte PRs in 30 T)
Beschreibung
Bug
The npm rewrite rule in src/discover/rules.rs only matches run|exec:
pattern: r"^npm\s+(run|exec)",
This means npm install (and npm ci, npm list, npm outdated, etc.) are never rewritten by the hook, so they bypass RTK entirely.
The filter already handles it
src/cmds/js/npm_cmd.rs has full install support — filter_npm_output() strips progress bars and keeps the summary. The NPM_SUBCOMMANDS const lists 30+ subcommands including install, ci, list, outdated, audit, etc.
The rule just doesn't route them there.
Reproduction
$ rtk rewrite "npm install"; echo "exit: $?"
# exit: 1 (no match — falls through uncompressed)
Suggested fix
// rules.rs line 56
pattern: r"^npm\s+(run|exec|install|ci|list|ls|outdated|audit|test)",
Environment
- rtk 0.35.0
- macOS Apple Silicon
rtk discovershows 43npm installcalls with 0% savings