docs: clarify package manager completions delegate to local CLIs#134
Merged
AmirSa12 merged 2 commits intoJun 19, 2026
Merged
Conversation
|
commit: |
AmirSa12
approved these changes
Jun 19, 2026
Member
There was a problem hiding this comment.
Hey @theoephraim !
I remember bringing this up on discord.
Thanks for the PR ❤️ I will fully refresh the docs soon.
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
The README's Package Manager Completions section only shows completing the package manager's own flags (e.g.
pnpm install --reporter=<TAB>). It doesn't mention what's arguably the most useful behavior: package-manager completion also delegates to CLIs installed as local project dependencies.When a user has
tab pnpm zsh(etc.) installed, typingpnpm exec my-cli <TAB>completesmy-cli's own subcommands and flags — even thoughmy-cliisn't onPATHand the user never installed its completion script. This isn't documented anywhere, so CLI authors and users don't know it works.Why
This came up while documenting completions for varlock. Our docs initially (incorrectly) told users that completion "won't work when installed as a local dependency." You told me on discord and I confirmed in the code that is not true — the package-manager completion strips
exec/x/run/dlx, detects whether the target CLI speaks the completion protocol, and forwards the request (falling back to<pm> <cli> complete -- …so local binaries resolve).Changes
Adds a Completing locally-installed CLIs subsection that:
pnpm exec/dlx/ bare formsnpx/bunxare separate binaries with no completion of their own, so those forms don't work — usenpm exec/bun xinsteadDocs-only change.