{"record":{"id":"51956fe0330c046e","repo":"jdx/mise","slug":"install-takes-the-executable-s-name-not-a-tool","errorCode":null,"errorMessage":"--install takes the executable's name, not a tool id; run `mise completion {} --tool {tool}` to see what the id resolves to","messagePattern":"--install takes the executable's name, not a tool id; run `mise completion (.+?) --tool (.+?)` to see what the id resolves to","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/completion.rs","lineNumber":179,"sourceCode":"            return self.install_script(shell.into());\n        }\n        let script = Cli::completion_script(shell.into());\n        miseprintln!(\"{}\", script.trim());\n\n        Ok(())\n    }\n\n    /// Put a stub for a tool where this shell looks for its completion. The stub defers to\n    /// `mise completion <shell> --tool <tool>` at completion time, so the script always matches\n    /// the version that is active, and the file never needs rewriting on a version switch.\n    fn install_tool_stub(&self, tool: &str, shell: usage_rs::complete::Shell) -> Result<()> {\n        use usage_rs::install::{self, OnForeign};\n\n        // The stub is filed under the command's name and completes that\n        // name, so it must be the executable as typed, not a tool id such\n        // as github.com/owner/repo.\n        if !crate::file::is_plain_file_name(tool) {\n            eyre::bail!(\n                \"--install takes the executable's name, not a tool id; run `mise completion {} --tool {tool}` to see what the id resolves to\",\n                shell.as_str()\n            );\n        }\n        let stub = crate::packslip::stub(tool, shell)?;\n        let on_foreign = if self.force {\n            OnForeign::Overwrite\n        } else {\n            OnForeign::Refuse\n        };\n        let plan = install::plan_for(\"mise\", tool, shell, &install::Env::from_process())\n            .map_err(eyre::Report::new)?;\n        let done = install::write(&plan, &stub, on_foreign).map_err(|err| match &err {\n            install::Error::Foreign { .. } => eyre::eyre!(\n                \"{err}\\n\\nPass --force to replace it, or redirect `mise completion {} --tool {tool}` yourself.\",\n                shell.as_str()\n            ),\n            _ => eyre::Report::new(err),","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/completion.rs#L161-L197","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass the plain executable name instead, e.g. `mise completion bash --install --tool mybin`","Run `mise completion <shell> --tool <tool-id>` (without --install) to see which executable name the id resolves to, then install that name"],"exampleFix":"// before\n$ mise completion bash --install --tool github.com/owner/repo\n// after\n$ mise completion bash --tool github.com/owner/repo  # shows resolved name\n$ mise completion bash --install --tool repo","handlingStrategy":"validation","validationCode":"[[ \"$tool\" != */* ]] || echo \"pass the executable name, not a tool id: $tool\"","typeGuard":"is_plain_file_name() { case \"$1\" in */*|\"\") return 1;; *) return 0;; esac; }","tryCatchPattern":"mise completion \"$shell\" --install --tool \"$tool\" || mise completion \"$shell\" --tool \"$tool\"  # inspect resolved name","preventionTips":["Pass bare executable names, never host/owner/repo ids","Resolve ids with `mise completion <shell> --tool <id>` first","Validate script inputs reject slashes for --tool with --install","Document the distinction in team tooling"],"tags":["cli","completions","invalid-argument"],"backgroundTag":"invalid-cli-argument","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}