rtk-ai/rtk

feat: Add npm install / npm ls command support

Open

#1.524 geöffnet am 25. Apr. 2026

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Rust (2.914 Forks)batch import
area:clieffort-mediumenhancementhelp wantedpriority:medium

Repository-Metriken

Stars
 (48.085 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 1h) (45 gemergte PRs in 30 T)

Beschreibung

Currently rtk npm only intercepts npm run commands. npm install and npm ls are not rewritten by the hook engine (rtk hook claude / rtk rewrite).

npm install output can be very verbose — dependency trees, audit warnings, deprecation notices — often 200+ lines. This is a significant token waste when used in LLM CLI contexts.

Observed behavior:

$ rtk hook check "npm run build"    # → rtk npm run build ✓
$ rtk hook check "npm install"      # → exit 1, no rewrite ✗
$ rtk hook check "npm ls"           # → exit 1, no rewrite ✗

Expected: npm installrtk npm install with compact output (strip progress bars, dependency tree noise, keep errors/warnings/audit summary).

Usage context: Monorepo with 12+ services, npm install called ~104 times/month across Claude Code sessions. Estimated ~15-20K tokens saveable.

Contributor Guide