Skip to content

feat(x): add --package/-p flag for specifying package separately from binary#32855

Open
bartlomieju wants to merge 1 commit intomainfrom
feat/deno-x-package-flag
Open

feat(x): add --package/-p flag for specifying package separately from binary#32855
bartlomieju wants to merge 1 commit intomainfrom
feat/deno-x-package-flag

Conversation

@bartlomieju
Copy link
Member

Summary

Closes #31667

Adds --package/-p flag to deno x that allows specifying the package to install separately from the binary to execute, matching the npx -p <package> <binary> convention.

This is useful when a package exposes multiple binaries (e.g. typescript has tsc and tsserver):

deno x -p typescript tsc
deno x -p typescript@5 tsc

Previously, the only way was deno x typescript/tsc.

The implementation combines --package and the binary name into {package}/{binary} before feeding it to the existing npm resolution flow, so all existing behavior is preserved.

Test plan

  • Added spec tests for -p (short) and --package (long) forms
  • All 19 existing deno x spec tests still pass
  • clippy clean

🤖 Generated with Claude Code

… binary

Add `--package`/`-p` flag to `deno x` that allows specifying the
package to install separately from the binary to execute, matching
the `npx -p <package> <binary>` convention.

This is useful when a package exposes multiple binaries (e.g.
`typescript` has `tsc` and `tsserver`):

  deno x -p typescript tsc
  deno x -p typescript@5 tsc

Previously, the only way to do this was:

  deno x typescript/tsc

Closes #31667

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"deno x" command does not work with packages exposing multiple binaries

1 participant