{"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":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/mod.rs","lineNumber":3311,"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":3293,"sourceCodeEnd":3329,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/config/mod.rs#L3293-L3329","documentation":"load_command_wrappers found a [command-wrappers] (or alias) entry whose command string is blank (empty or whitespace). A wrapper must execute something, so configuration parsing fails with the offending wrapper's name in the message.","triggerScenarios":"Collecting command wrappers from config files (command_wrappers()) where any wrapper's command(), after trim(), is empty — e.g. command = \"\" or command = \"   \". Safe mode only inspects global configs.","commonSituations":"Hand-editing mise.toml and leaving a wrapper's command blank, templating that resolves a command to an empty string, or disabling a wrapper by blanking it instead of deleting the entry.","solutions":["Set a non-blank command for the wrapper named in the error","Delete the wrapper entry entirely if it is no longer needed (don't blank it to disable)","Check templated command values for variables that resolve to empty strings"],"exampleFix":"// before\n[command_wrappers.mytool]\ncommand = \"\"\n// after\n[command_wrappers.mytool]\ncommand = \"mytool-wrapper\"","handlingStrategy":"validation","validationCode":"# check every wrapper command is non-blank before running mise\ntomlq -r '.command_wrappers | to_entries[] | select(.value.command == \"\" or .value.command == null) | .key' mise.toml \\\n  && echo \"blank wrapper commands found\"","typeGuard":"// Rust\nfn has_command(w: &CommandWrapper) -> bool {\n    !w.command().trim().is_empty()\n}","tryCatchPattern":"// Rust\nmatch build_command_wrappers(&config_files, tools, safe_mode) {\n    Ok(w) => use(w),\n    Err(e) if e.to_string().contains(\"must have a non-blank command\") => {\n        eprintln!(\"fill in or delete the blank wrapper named in the error\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Never blank out a wrapper's command to disable it — delete the entry","Watch templated commands for variables that may resolve to empty strings","Validate mise.toml with the JSON schema in your editor"],"tags":["config","toml","validation","command-wrappers"],"backgroundTag":"empty-required-field","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"}