jdx/mise · error
invalid command wrapper name: {name:?}
Error message
invalid command wrapper name: {name:?} What it means
Command wrapper names must be valid, plain executable names: non-empty, not '.' or '..', and containing no path separators ('/' or '\\'). validate_wrapper_name rejects any name violating these rules because wrappers are keyed as command names, not paths.
Source
Thrown at src/shims.rs:1130
a == b
}
}
pub(crate) fn command_name_without_exe_suffix(bin_name: &str) -> &str {
let suffix = std::env::consts::EXE_SUFFIX;
if suffix.is_empty() {
return bin_name;
}
let suffix_start = bin_name.len().saturating_sub(suffix.len());
match (bin_name.get(..suffix_start), bin_name.get(suffix_start..)) {
(Some(name), Some(actual_suffix)) if actual_suffix.eq_ignore_ascii_case(suffix) => name,
_ => bin_name,
}
}
fn validate_wrapper_name(name: &str) -> Result<()> {
if name.is_empty() || name == "." || name == ".." || name.contains('/') || name.contains('\\') {
bail!("invalid command wrapper name: {name:?}");
}
if cfg!(windows) && name.contains('.') {
bail!("command wrapper names cannot contain dots on Windows: {name:?}");
}
Ok(())
}
fn validate_wrapper_names<'a>(names: impl IntoIterator<Item = &'a String>) -> Result<()> {
let mut normalized = HashSet::new();
for name in names {
validate_wrapper_name(name)?;
if cfg!(macos) && !normalized.insert(name.to_lowercase()) {
bail!("command wrapper names collide on macOS after case normalization: {name:?}");
}
}
Ok(())
}
View on GitHub (pinned to afd2eddd3a)
Solutions
- Use just the executable name as the wrapper key (e.g. `foo`, not `bin/foo`).
- Strip the directory portion: use the basename of the path you intended.
- If you meant to wrap a tool in a subdirectory, configure the wrapper's *command* with the full path and keep the name a plain identifier.
- Fix empty/`.`/`..` entries by giving the wrapper an explicit name.
Example fix
// before [wrapper] "bin/ruff" = "ruff --fix" // path separator invalid // after [wrapper] ruff = "/full/path/to/ruff --fix"
Defensive patterns
Strategy: validation
Validate before calling
// bash: validate a wrapper name before adding it
validate_wrapper_name() {
case "$1" in
""|.|..|*/*|*\\*) echo "invalid wrapper name: $1"; return 1;;
*) return 0;;
esac
}
validate_wrapper_name "bin/ruff" || echo 'use basename only' Prevention
- Wrapper names are plain command names — strip paths to the basename.
- Never use '.', '..', or names with / or \\.
- Validate names in scripts that generate wrapper configs.
- Put full paths in the wrapper's command, not its name.
When it happens
Trigger: Declaring a wrapper key like `tools/mytool`, `sub\dir\cmd`, `.` or `..`, or an empty string in the command wrapper configuration (mise.toml wrapper section or `mise wrapper add` argument).
Common situations: Users pasting a file path where only the command name belongs, typos with trailing slashes, or generating wrapper names programmatically from paths without taking the basename.
Understand the failure class
Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.
Related errors
- command wrapper names cannot contain dots on Windows: {name:
- {bin_name} is a mise bin however it is not currently active.
- artifactbundle must be true, false, 1, or 0, got {value}
- install_command must be a non-empty string
- version_order must be "source" or "semver"
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/19c18ba94349a8a5.
Report an issue: GitHub.