jdx/mise · error

--install takes the executable's name, not a tool id; run…

Error message

--install takes the executable's name, not a tool id; run `mise completion {} --tool {tool}` to see what the id resolves to

What it means

`mise completion <shell> --install` installs a completion stub that must be filed under and complete the executable name as typed on the command line. If the value passed to `--tool` is a full tool id (e.g. `github.com/owner/repo`) rather than a plain executable file name, mise rejects it, since the stub mechanism can only key on the binary's plain name.

Solutions

  1. Pass the plain executable name instead, e.g. `mise completion bash --install --tool mybin`
  2. Run `mise completion <shell> --tool <tool-id>` (without --install) to see which executable name the id resolves to, then install that name

Example fix

// before
$ mise completion bash --install --tool github.com/owner/repo
// after
$ mise completion bash --tool github.com/owner/repo  # shows resolved name
$ mise completion bash --install --tool repo
Defensive patterns

Strategy: validation

Validate before calling

[[ "$tool" != */* ]] || echo "pass the executable name, not a tool id: $tool"

Type guard

is_plain_file_name() { case "$1" in */*|"") return 1;; *) return 0;; esac; }

Try / catch

mise completion "$shell" --install --tool "$tool" || mise completion "$shell" --tool "$tool"  # inspect resolved name

Prevention

When it happens

Trigger: Calling `mise completion <shell> --install --tool <tool-id>` where the tool argument contains path separators, a host/owner/repo form, or any value failing the `is_plain_file_name` check, instead of the bare executable name.

Common situations: Users copy a tool id from `mise ls` output or docs and paste it into the completion install command; automations derive the argument from a backend identifier rather than the installed binary name.

Understand the failure class

Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/51956fe0330c046e. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/completion.rs:179

            return self.install_script(shell.into());
        }
        let script = Cli::completion_script(shell.into());
        miseprintln!("{}", script.trim());

        Ok(())
    }

    /// Put a stub for a tool where this shell looks for its completion. The stub defers to
    /// `mise completion <shell> --tool <tool>` at completion time, so the script always matches
    /// the version that is active, and the file never needs rewriting on a version switch.
    fn install_tool_stub(&self, tool: &str, shell: usage_rs::complete::Shell) -> Result<()> {
        use usage_rs::install::{self, OnForeign};

        // The stub is filed under the command's name and completes that
        // name, so it must be the executable as typed, not a tool id such
        // as github.com/owner/repo.
        if !crate::file::is_plain_file_name(tool) {
            eyre::bail!(
                "--install takes the executable's name, not a tool id; run `mise completion {} --tool {tool}` to see what the id resolves to",
                shell.as_str()
            );
        }
        let stub = crate::packslip::stub(tool, shell)?;
        let on_foreign = if self.force {
            OnForeign::Overwrite
        } else {
            OnForeign::Refuse
        };
        let plan = install::plan_for("mise", tool, shell, &install::Env::from_process())
            .map_err(eyre::Report::new)?;
        let done = install::write(&plan, &stub, on_foreign).map_err(|err| match &err {
            install::Error::Foreign { .. } => eyre::eyre!(
                "{err}\n\nPass --force to replace it, or redirect `mise completion {} --tool {tool}` yourself.",
                shell.as_str()
            ),
            _ => eyre::Report::new(err),

View on GitHub (pinned to 533346cc37)