rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Add nushell completion support

Open QingyaoLin opened this issue 1 month ago • 2 comments

Problem you are trying to solve

Enable nushell to enjoy first-class completion support, just like shells such as bash and zsh.

Solution you'd like

You can also have native rustup command completion support in nushell.

Notes

We can consider using clap_complete_nushell crate. In many projects, this clap_complete_nushell crate is used to generate nushell completion scripts, for example:

  1. jj
  2. uv
  3. atuin

QingyaoLin avatar Nov 18 '25 15:11 QingyaoLin

In addition, according to the clap_complete_nushell crate example, I think the difficulty of integration is very small, but the edge cases of completion may need to be considered.

use clap::Command;
use clap_complete::generate;
use clap_complete_nushell::Nushell;
use std::io;

let mut cmd = Command::new("myapp")
    .subcommand(Command::new("test").subcommand(Command::new("config")))
    .subcommand(Command::new("hello"));

generate(Nushell, &mut cmd, "myapp", &mut io::stdout());

QingyaoLin avatar Nov 18 '25 15:11 QingyaoLin

If there's anything I haven't considered, please let me know.

QingyaoLin avatar Nov 18 '25 15:11 QingyaoLin