Skip to content
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

Add completion for uv Python package manager #1071

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions custom-completions/uv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# uv completions

[uv](https://docs.astral.sh/uv/) is a Python package and project manager, known for its speed.

Though `uv` can generate its Nu completion script via `uv generate-shell-completion`, this script can only
provide static choices, not dynamic choices from _pyproject.toml_ file.

## Install completion script

First, if you installed the script generated by `uv generate-shell-completion`, please remove it to avoid conflict.

### Method 1: Use from Git repo

- `git clone https://github.com/nushell/nu_scripts.git`

- Add this to `$nu.config-path` file.

```nu
source repo/custom-completions/uv/uv-completions.nu
```

### Method 2: Selectively copy


- Copy the _uv-completions.nu_ to Nu standard place.

```nu
cp custom-completions/uv/uv-completions.nu ($nu.data-dir | path join 'completions')
```

- Open `$nu.config-path` file and add this:

```nu
source uv-completions.nu
```
Loading