-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Generate shell completion for uvx
#7388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,6 +181,25 @@ To enable shell autocompletion for uv commands, run one of the following: | |
|
||
Then restart the shell or source the shell config file. | ||
|
||
You can also enable shell autocompletion for uvx by running the same commands, replacing `uv` with | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not the author, but my understanding is that If my understanding is correct, these docs are misleading, and there isn't really need for docs. The existing instructions will cause completion to work for both It wouldn't be hard to modify this code to generate the completions separately, e.g. something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You’re right, I misread the instructions in the summary. Will revert in the morning (or anyone is welcome to PR). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could expand the docs with the statement that uv and uvx completions are included in the same output. Not sure if it's worth providing further hints, like if you use a per command file for completions, duplicate the output in both files or symlink uvx -> uv. Could be discussed in future docs changes. |
||
`uvx`: | ||
|
||
=== "Linux and macOS" | ||
|
||
```bash | ||
# Determine your shell (e.g., with `echo $SHELL`), then run one of: | ||
echo 'eval "$(uvx generate-shell-completion bash)"' >> ~/.bashrc | ||
echo 'eval "$(uvx generate-shell-completion zsh)"' >> ~/.zshrc | ||
echo 'uvx generate-shell-completion fish | source' >> ~/.config/fish/config.fish | ||
echo 'eval (uvx generate-shell-completion elvish | slurp)' >> ~/.elvish/rc.elv | ||
``` | ||
|
||
=== "Windows" | ||
|
||
```powershell | ||
Add-Content -Path $PROFILE -Value '(& uvx generate-shell-completion powershell) | Out-String | Invoke-Expression' | ||
``` | ||
|
||
## Uninstallation | ||
|
||
If you need to remove uv from your system, just remove the `uv` and `uvx` binaries: | ||
|
Uh oh!
There was an error while loading. Please reload this page.