{"record":{"id":"1505a26f66a66ed8","repo":"jdx/mise","slug":"could-not-determine-which-executable-to-use-for","errorCode":null,"errorMessage":"Could not determine which executable to use for '{}'. Available executables:\n  {}\n\nUse --bin to specify the correct binary path.","messagePattern":"Could not determine which executable to use for '(.+?)'\\. Available executables:\n  (.+?)\n\nUse --bin to specify the correct binary path\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/tool_stub.rs","lineNumber":761,"sourceCode":"                    .unwrap_or(false)\n            })\n            .collect();\n\n        // If there's exactly one match containing the tool name, use it\n        if name_matches.len() == 1 {\n            return Ok(name_matches[0].clone());\n        }\n\n        // Strategy 3: If there's only one executable total, use it\n        if executables.len() == 1 {\n            return Ok(executables[0].clone());\n        }\n\n        // No good match found, provide helpful error message\n        let mut exe_list = executables.to_vec();\n        exe_list.sort();\n\n        bail!(\n            \"Could not determine which executable to use for '{}'. Available executables:\\n  {}\\n\\nUse --bin to specify the correct binary path.\",\n            tool_name,\n            exe_list.join(\"\\n  \")\n        );\n    }\n\n    async fn lock_stub(&self) -> Result<String> {\n        if !self.output.exists() {\n            bail!(\n                \"Tool stub file does not exist: {}\",\n                display_path(&self.output)\n            );\n        }\n\n        let mut stub = ToolStubFile::from_file(&self.output)?;\n        let config = Config::get().await?;\n\n        // Allow --version to override the version in the stub for bumping","sourceCodeStart":743,"sourceCodeEnd":779,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/generate/tool_stub.rs#L743-L779","documentation":"This error is thrown by `find_best_binary_match` when the archive contains executable files but none can be confidently matched to the tool name (no exact filename match, with or without common extensions). The error lists all candidate executables and instructs the user to disambiguate with --bin.","triggerScenarios":"An archive contains multiple or ambiguously named executables (e.g. tool-server, tool-cli, example) and none exactly matches the stub's tool name, so automatic selection is refused.","commonSituations":"Multi-binary release archives where the tool name differs from the binary name (e.g. crate named 'thing' ships binary 'thingd'); archives containing demo/example binaries alongside the real one; renamed binaries upstream between versions.","solutions":["Pass --bin <path-inside-archive> to explicitly select the correct executable","Compare the listed 'Available executables' in the error against the archive and pick the real binary","If the tool was renamed upstream, set the stub's name/bin so they match"],"exampleFix":"// before\nmise generate tool-stub mytool --url https://example.com/mytool.tar.gz\n// after\nmise generate tool-stub mytool --url https://example.com/mytool.tar.gz --bin mytoold","handlingStrategy":"fallback","validationCode":"# Pre-check candidate binaries in the archive against the tool name\ncurl -fsSL \"$URL\" | tar -tz | grep -E \"(^|/)${TOOL_NAME}(\\.(exe))?$\"","typeGuard":null,"tryCatchPattern":"if ! mise generate tool-stub \"$TOOL\" --url \"$URL\" 2>/dev/null; then\n  # Read the 'Available executables:' list from the error and retry with --bin\n  mise generate tool-stub \"$TOOL\" --url \"$URL\" --bin \"$BIN_PATH\"\nfi","preventionTips":["When a release ships multiple binaries, always pass --bin explicitly","Keep the stub's tool name consistent with the shipped binary name","Check release notes for renamed binaries between versions"],"tags":["archive","tool-stub","ambiguity"],"backgroundTag":"invalid-argument-value","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"}