jdx/mise · error
{raw}: target must be absolute or start with ~/
Error message
{raw}: target must be absolute or start with ~/ What it means
Thrown by `mise bootstrap dotfiles edit` when the TARGET is not yet managed by any `[dotfiles]` file or edit entry AND the resolved target path is relative. Before offering to add a new dotfile, mise requires an unambiguous location: an absolute path or one starting with `~/`. A relative path like `src/.env` would resolve differently depending on the working directory, so it is rejected up front.
Source
Thrown at src/cli/dotfiles/edit.rs:128
} => 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(())
}
async fn apply_target(target: &str) -> Result<()> {
let config = Config::reset().await?;
let targets = vec![target.to_string()];
let files = system::files::files_from_config(&config)?View on GitHub (pinned to 6f52dcdf99)
Solutions
- Re-run with an absolute path or a `~/`-prefixed path, e.g. `mise bootstrap dotfiles edit ~/.config/app/config.toml`
- If you meant an existing managed dotfile, check its exact target with `mise bootstrap dotfiles status` and copy that spelling
- If the file belongs to a project, use the absolute path of the repo file, not a cwd-relative one
Example fix
# before $ mise bootstrap dotfiles edit .zshrc error: .zshrc: target must be absolute or start with ~/ # after $ mise bootstrap dotfiles edit ~/.zshrc
Defensive patterns
Strategy: validation
Validate before calling
# shell: reject relative targets before calling mise case "$1" in /*|~/*) mise bootstrap dotfiles edit "$1" ;; *) echo "target must be absolute or ~/..." >&2; exit 2 ;; esac
Prevention
- Always pass / or ~/ absolute paths to dotfiles commands
- Copy the exact target spelling from `mise bootstrap dotfiles status` output
When it happens
Trigger: Running `mise bootstrap dotfiles edit .zshrc` or `mise bootstrap dotfiles edit config/app.toml` where no `[[dotfiles.files]]` or `[[dotfiles.edit]]` entry matches — `source_for_target` finds nothing, `target.is_relative()` is true, and it bails before the add flow.
Common situations: Typing a bare filename out of habit instead of the full path; copying a target name from a listing that shows it relative to $HOME; running the command from a subdirectory expecting cwd-relative resolution.
Related errors
- {raw}: multiple [dotfiles] edit entries match; choose one of
- no dotfiles matched target filter: {}
- no dotfiles matched target filter: {}
- No config file found in current directory
- --localized-dir {raw:?} cannot be carried to Windows: {bad:?
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/5c5e0bb469582de4.
Report an issue: GitHub.