Skip to content

docs(dlx): add missing usage examples and version range documentation#7083

Open
syhstanley wants to merge 4 commits into
yarnpkg:masterfrom
syhstanley:fix/dlx-doc-missing-examples
Open

docs(dlx): add missing usage examples and version range documentation#7083
syhstanley wants to merge 4 commits into
yarnpkg:masterfrom
syhstanley:fix/dlx-doc-missing-examples

Conversation

@syhstanley

Copy link
Copy Markdown

What's the problem this PR addresses?

The yarn dlx documentation was missing several common usage patterns, causing confusion in the wider ecosystem. Notably, the Rust community incorrectly concluded that yarn dlx does not support version pinning because the docs never demonstrated it.

Fixes #7072

How did you fix it?

Added two new paragraphs to the details section:

  • Documents the @version suffix syntax (e.g. pkg@1.0.0, pkg@^2)
  • Clarifies multi-binary package behavior and the Binary not found error

Added three new examples:

  • yarn dlx create-vite@5.0.0 — version specifier
  • yarn dlx -p typescript@5.0.2 tsc --version — named binary from versioned package
  • yarn dlx -p typescript@5.0.2 tsserver — alternate binary from same package

All examples were verified to work correctly.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

- 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 clemyan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to mark @yarnpkg/cli and @yarnpkg/plugin-dlx for patch release

Comment thread packages/plugin-dlx/sources/commands/dlx.ts Outdated
stanleyshen2003 and others added 2 commits March 29, 2026 21:33
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>
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.

dlx document missing 4 more cases

3 participants