jdx/mise · error

{raw}: multiple [dotfiles] edit entries match; choose one of

Error message

{raw}: multiple [dotfiles] edit entries match; choose one of: {keys}

What it means

Thrown by `mise bootstrap dotfiles edit <TARGET>` when the TARGET argument matches more than one `[[dotfiles.edit]]` entry across the loaded config files. Because each edit entry can point at a different source (a Block-from-file path, the config file itself for inline/line edits), mise cannot decide which one to open in the editor, so it refuses and lists the matching config keys. It is a disambiguation error, not corruption: exactly one edit entry must match.

Source

Thrown at src/cli/dotfiles/edit.rs:124

            return Ok(Some(match &req.op {
                EditOp::Block {
                    source: BlockSource::File(path),
                    ..
                } => path.clone(),
                EditOp::Block {
                    source: BlockSource::Inline(_),
                    ..
                }
                | EditOp::Line { .. } => req.config_path.clone(),
            }));
        }
        edits => {
            let keys = edits
                .iter()
                .map(|req| req.config_key())
                .collect::<Vec<_>>()
                .join(", ");
            bail!("{raw}: multiple [dotfiles] edit entries match; choose one of: {keys}");
        }
    }
    if target.is_relative() {
        bail!("{raw}: target must be absolute or start with ~/");
    }
    Ok(None)
}

fn open_or_create(path: &std::path::Path) -> Result<()> {
    if !path.exists() {
        if let Some(parent) = path.parent() {
            file::create_dir_all(parent)?;
        }
        file::write(path, "")?;
    }
    Ok(())
}

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Pass the exact config key of the entry you want instead of a path prefix or glob shorthand — the error message lists the valid `keys`
  2. Remove or tighten one of the overlapping `[[dotfiles.edit]]` entries (make globs more specific, delete stale duplicates from the global or project mise.toml)
  3. Run `mise bootstrap dotfiles status` to see every configured file/edit target and spot the overlap
  4. If both entries are intentional, target the distinct source/config file each entry declares instead of the shared target

Example fix

# before (~/.config/mise/mise.toml)
[[dotfiles.edit]]
path = '~/.zshrc'
# (project mise.toml)
[[dotfiles.edit]]
path = '~/.z*'         # also matches ~/.zshrc

# after (project mise.toml)
[[dotfiles.edit]]
path = '~/.zprofile'   # disjoint from the global entry
Defensive patterns

Strategy: validation

Validate before calling

# List every configured edit target and check for ambiguity before editing
mise bootstrap dotfiles status | grep -F "$TARGET" # >1 hit = ambiguous

Prevention

When it happens

Trigger: Running `mise bootstrap dotfiles edit ~/.zshrc` when two `[[dotfiles.edit]]` entries both pass `system::edits::matches_target` for that argument — e.g. one with `path = '~/.zshrc'` in the global config and another with a matching glob such as `path = '~/.z*'` in a project mise.toml, or duplicate entries for the same path in different config files.

Common situations: Dotfile edit entries defined in both `~/.config/mise/mise.toml` and a checked-in project `mise.toml` that overlap through globs; a broad pattern like `~/*rc` added later shadowing an exact-path entry; renaming a target so an old entry and a new entry both match a shorthand argument.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/ae2ddafd7be25634. Report an issue: GitHub.