rtk-ai/rtk

npx -p @scope/pkg binary fails: RTK treats scoped package name as npm subcommand

Open

#713 aberto em 18 de mar. de 2026

Ver no GitHub
 (2 comments) (3 reactions) (0 assignees)Rust (2.914 forks)batch import
area:clibugeffort-mediumfilter-qualitygood first issueplatform:macospriority:medium

Métricas do repositório

Stars
 (48.085 stars)
Métricas de merge de PR
 (Mesclagem média 11d 1h) (45 fundiu PRs em 30d)

Description

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.

Guia do colaborador