Skip to content

feat(completions): add nushell shell completion support - #12

Merged
benbenbang merged 1 commit into
mainfrom
feat/add_nushell
Mar 14, 2026
Merged

benbenbang merged 1 commit into
mainfrom
feat/add_nushell

Conversation

@benbenbang

Copy link
Copy Markdown
Owner

This pull request adds native nushell shell completion support to the uv-plugin-completion system, enabling nushell users to get dynamic plugin completions alongside the core uv command. The changes include implementation of nushell completion injection and updated documentation.

Nushell completion integration:

  • Added inject_nushell function in adds-on/src/main.rs that injects plugin externs into the nushell module completions block, merging plugin completions seamlessly with uv's native completions.
  • Implemented plugin_nushell_body helper that extracts completion definitions from each plugin by running uv-<plugin> completions nushell, strips module wrappers, and renames uv-<plugin> references to uv <plugin> for natural subcommand integration.
  • Added nushell case handling in the main shell completion dispatcher to route nushell requests through the new injection logic.
  • Included unit test test_inject_nushell_appends_plugin to verify correct insertion of plugin externs into the completions module.

Documentation updates:

  • Updated README.md installation instructions to include nushell completion setup with uv generate-shell-completion nushell and config.nu integration steps.
  • Clarified that zsh completions discover plugins dynamically at tab-press time with no eval or reloading needed, while nushell/bash/fish require re-running completion generation after installing new plugins.
  • Improved comment clarity for zsh installation, emphasizing dynamic plugin discovery behavior.

This pull request adds native nushell shell completion support to the uv-plugin-completion system, enabling nushell users to get dynamic plugin completions alongside the core uv command. The changes include implementation of nushell completion injection and updated documentation.

**Nushell completion integration:**
* Added `inject_nushell` function in `adds-on/src/main.rs` that injects plugin externs into the nushell `module completions` block, merging plugin completions seamlessly with uv's native completions.
* Implemented `plugin_nushell_body` helper that extracts completion definitions from each plugin by running `uv-<plugin> completions nushell`, strips module wrappers, and renames `uv-<plugin>` references to `uv <plugin>` for natural subcommand integration.
* Added nushell case handling in the main shell completion dispatcher to route nushell requests through the new injection logic.
* Included unit test `test_inject_nushell_appends_plugin` to verify correct insertion of plugin externs into the completions module.

**Documentation updates:**
* Updated `README.md` installation instructions to include nushell completion setup with `uv generate-shell-completion nushell` and config.nu integration steps.
* Clarified that zsh completions discover plugins dynamically at tab-press time with no eval or reloading needed, while nushell/bash/fish require re-running completion generation after installing new plugins.
* Improved comment clarity for zsh installation, emphasizing dynamic plugin discovery behavior.
@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request triage labels Mar 14, 2026
@benbenbang
benbenbang enabled auto-merge (squash) March 14, 2026 19:43
@benbenbang
benbenbang merged commit d91b446 into main Mar 14, 2026
2 checks passed
@benbenbang
benbenbang deleted the feat/add_nushell branch March 14, 2026 19:43
@ptah-technical-app

Copy link
Copy Markdown

🎉 This PR is included in version 2.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request released triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant