{"record":{"id":"3011e9554e4c5f36","repo":"jdx/mise","slug":"command-wrapper-for-name-must-have-a-non-blank","errorCode":null,"errorMessage":"command wrapper for {name:?} must have a non-blank command","messagePattern":"command wrapper for (.+?) must have a non-blank command","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/mod.rs","lineNumber":3216,"sourceCode":"    trace!(\"load_shell_aliases: {}\", shell_aliases.len());\n\n    Ok(shell_aliases)\n}\n\n/// Load command wrappers from global through project scope.\npub(crate) fn load_command_wrappers<'a>(\n    config_files: &ConfigMap,\n    tools: impl IntoIterator<Item = &'a crate::toolset::ToolRequest>,\n) -> Result<IndexMap<String, CommandWrapper>> {\n    let mut wrappers = IndexMap::new();\n    let safe_mode = Settings::safe_mode();\n    for config_file in config_files.values().rev() {\n        if safe_mode && !is_global_config(config_file.get_path()) {\n            continue;\n        }\n        for (name, wrapper) in config_file.command_wrappers()? {\n            if wrapper.command().trim().is_empty() {\n                bail!(\"command wrapper for {name:?} must have a non-blank command\");\n            }\n            wrappers.insert(name, wrapper);\n        }\n    }\n    command_wrapper::add_rust_wrapper(&mut wrappers, tools)?;\n    Ok(wrappers)\n}\n\nfn load_plugins(config_files: &ConfigMap) -> Result<HashMap<String, String>> {\n    let mut plugins = HashMap::new();\n    for config_file in config_files.values() {\n        for (plugin, url) in config_file.plugins()? {\n            plugins.insert(plugin.clone(), url.clone());\n        }\n    }\n    trace!(\"load_plugins: {}\", plugins.len());\n    Ok(plugins)\n}","sourceCodeStart":3198,"sourceCodeEnd":3234,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/config/mod.rs#L3198-L3234","documentation":"mise validates every `[command_wrappers]` entry and rejects wrappers whose `command` string is blank or whitespace-only. During wrapper collection over all config files, `wrapper.command().trim().is_empty()` triggers this bail, because a wrapper without an actual command to prepend cannot generate a working shim.","triggerScenarios":"Declaring a `[command_wrappers.<name>]` entry in any config file with `command = \"\"`, `command = \" \"`, or omitting/blanking the command value while the wrapper section exists (e.g. `command_wrapper(name)` present but its command field empty).","commonSituations":"Copy-pasting a wrapper TOML block and forgetting to fill in the command; a template or environment-variable-substituted command (e.g. `command = \"${WRAPPER}\"`) that resolves to an empty string; commenting out a command body but leaving the wrapper key in place.","solutions":["Set a non-blank `command` value for the wrapper in the config file that defines it.","If the command comes from a template/env var, ensure it resolves to a non-empty string at load time.","Remove the empty `[command_wrappers.<name>]` section entirely if the wrapper is no longer wanted."],"exampleFix":"# before (mise.toml)\n[command_wrappers.git]\ncommand = \"\"\n\n# after\n[command_wrappers.git]\ncommand = \"hub\"","handlingStrategy":"validation","validationCode":"# Fail fast on blank wrapper commands in committed configs:\nif grep -rE '^command[[:space:]]*=[[:space:]]*[\"'\"']\\s*[\"'\"']' --include='*.toml' .; then\n  echo \"blank command value found\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After editing a command_wrapper, run `mise config get` or `mise tasks` to confirm it parses.","Never leave template placeholders like ${WRAPPER} unset when the config loads.","Delete wrapper sections you no longer use rather than blanking their command."],"tags":["mise","config-validation","command-wrappers","empty-string"],"backgroundTag":"empty-required-field","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"}