rtk-ai / rtk-ai/rtk

npm's lifecycle subcommands are never routed to rtk

Open Beginner friendly
#3,671 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:cli enhancement good first issue priority:medium
Dominant language
Rust
Stars
81.1k
Forks
5.1k
Avg merge
4d 11h
Merged PRs (30d)
40

Description

Type: Enhancement (coverage gap) · Severity: Medium (lost savings) · Area: src/discover/rules.rs

Summary

The npm rule matches only ^npm\s+(exec|run|run-script|rum|urn|x), so the subcommands an agent
runs most often fall through to the native binary unfiltered:

Command Rewritten before
npm run build yes
npm test no
npm install no
npm ci no
npm audit no
npm outdated no
npm ls no

This is a rule gap, not a filter gap: npm_cmd::KNOWN_SUBCOMMANDS already lists install, ci,
test, audit, outdated and friends precisely so that run is not injected for them. The
filter was built to handle these; nothing ever sent them its way.

Why it matters

npm install is among the noisiest commands in a JS project — dozens of npm WARN deprecated
lines, EBADENGINE blocks, funding notices — wrapped around two lines that actually matter
(how many packages were added, and how many vulnerabilities were found).

Environment

  • rtk 0.42.4 (develop @ 29f9bb7)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/discover/rules.rs and inspect the existing npm rule alongside npm_cmd::KNOWN_SUBCOMMANDS. Verify that npm test, install, ci, audit, outdated and ls are routed through rtk without injecting run, then confirm the existing npm filtering behavior still applies to those commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, rust
Domain
cli, tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.