npx -p @scope/pkg binary fails: RTK treats scoped package name as npm subcommand
#713 geöffnet am 18. März 2026
Repository-Metriken
- Stars
- (48.085 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 11T 1h) (45 gemergte PRs in 30 T)
Beschreibung
Bug
rtk npx does not handle the -p <scoped-package> <binary> form of npx. When the package name starts with @, RTK appears to parse it as a npm subcommand rather than a package specifier.
Reproduction
# Fails
npx -y -p @playwright/cli playwright-cli list
# Error: Unknown command: "@playwright/cli"
# Also fails
npx --package=@playwright/cli playwright-cli list
# Error: Unknown command: "playwright-cli"
# Works (bypasses RTK)
rtk proxy npx --package=@playwright/cli -- playwright-cli list
# Output: ### Browsers\n (no browsers)
Context
- RTK version: 0.29.0
- npm version: 10.9.3
- Node: v22.19.0
- macOS (Apple Silicon)
The rewrite hook converts npx -y -p @playwright/cli playwright-cli list to rtk npx -y -p @playwright/cli playwright-cli list, which then fails. Using rtk proxy npx works correctly.
This affects any skill or tool that invokes CLI tools from scoped npm packages (e.g. @playwright/cli, @anthropic-ai/sdk, etc.) via the standard npx package flag syntax.
Related
Issue #197 covers passthrough of known tools via npx but does not cover the -p @scope/package binary invocation pattern.