{"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":171,"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":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/completion.rs#L153-L189","documentation":"When installing a completion stub via `mise completion <shell> --install`, the `--tool`/positional value must be a plain executable name (e.g. `node`), because the stub is filed under and completes that name. Passing a tool id such as `github.com/owner/repo` or `aqua:foo/bar` is rejected; mise hints that `--tool` resolution should be inspected separately.","triggerScenarios":"`mise completion <shell> --install github.com/owner/repo` or `--tool aqua:owner/repo`, i.e. passing a backend-qualified tool id instead of the executable's file name; copying a tool id from `mise ls` into the completion command.","commonSituations":"Confusing tool installation ids with executable names for multi-binary tools (e.g. installing completions for `rg` whose tool id is `ubi:BurntSushi/ripgrep`); scripting completion install from a tool list.","solutions":["Pass the plain executable name, e.g. `mise completion bash --install rg`","If unsure what executable a tool id provides, run `mise completion <shell> --tool <id>` to resolve it first","Install the tool first (`mise use <tool-id>`) so the executable name is known, then install the stub by that name"],"exampleFix":"// before\nmise completion bash --install github.com/BurntSushi/ripgrep\n// after\nmise completion bash --install rg","handlingStrategy":"validation","validationCode":"const isPlainFileName = s => !s.includes('/') && !s.includes(':');\nif (!isPlainFileName(tool)) throw new Error(`use executable name, not ${tool}`);","typeGuard":"const isPlainFileName = (s) => typeof s === 'string' && /^[\\w.-]+$/.test(s);","tryCatchPattern":null,"preventionTips":["Resolve tool ids with `mise completion <shell> --tool <id>` to find the executable name first","Install the tool before wiring completions","Remember the stub is filed under the executable's typed name","Never pass backend-qualified ids (aqua:, github.com/...) to --install"],"tags":["cli","completion","argument-validation"],"backgroundTag":"invalid-cli-argument","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}