docs(dlx): add missing usage examples and version range documentation#7083
Open
syhstanley wants to merge 2 commits intoyarnpkg:masterfrom
Open
docs(dlx): add missing usage examples and version range documentation#7083syhstanley wants to merge 2 commits intoyarnpkg:masterfrom
syhstanley wants to merge 2 commits intoyarnpkg:masterfrom
Conversation
- Document @Version suffix syntax for specifying package versions - Add example: yarn dlx create-vite@5.0.0 - Add example: yarn dlx -p typescript@5.0.2 tsc --version (named binary) - Add example: yarn dlx -p typescript@5.0.2 tsserver (alternate binary) - Clarify multi-binary behavior and Binary not found error Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
clemyan
reviewed
Mar 29, 2026
Member
clemyan
left a comment
There was a problem hiding this comment.
Need to mark @yarnpkg/cli and @yarnpkg/plugin-dlx for patch release
|
|
||
| Version ranges can be appended to the package name using the \`@\` suffix (e.g. \`pkg@1.0.0\` or \`pkg@^2\`). When no range is specified, Yarn will use the \`latest\` dist-tag. | ||
|
|
||
| When a package ships multiple binaries, use \`-p,--package\` to specify the package (with an optional version) and pass the desired binary name as the command. If the binary name matches one of the package's binaries it will be invoked directly; otherwise Yarn will report a \`Binary not found\` error. |
Member
There was a problem hiding this comment.
Without using -p, I think the default is to run the bin with the same name as the package name? If so please clarify that -p is only needed when running a bin that does not match the package name or when needing multiple packages.
Address review feedback: explain that without -p, Yarn runs the binary matching the package name, and -p is only needed for mismatched names or multiple packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the problem this PR addresses?
The
yarn dlxdocumentation was missing several common usage patterns, causing confusion in the wider ecosystem. Notably, the Rust community incorrectly concluded thatyarn dlxdoes not support version pinning because the docs never demonstrated it.Fixes #7072
How did you fix it?
Added two new paragraphs to the
detailssection:@versionsuffix syntax (e.g.pkg@1.0.0,pkg@^2)Binary not founderrorAdded three new examples:
yarn dlx create-vite@5.0.0— version specifieryarn dlx -p typescript@5.0.2 tsc --version— named binary from versioned packageyarn dlx -p typescript@5.0.2 tsserver— alternate binary from same packageAll examples were verified to work correctly.
Checklist