{"record":{"id":"5c5e0bb469582de4","repo":"jdx/mise","slug":"raw-target-must-be-absolute-or-start-with","errorCode":null,"errorMessage":"{raw}: target must be absolute or start with ~/","messagePattern":"(.+?): target must be absolute or start with ~/","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/edit.rs","lineNumber":128,"sourceCode":"                } => path.clone(),\n                EditOp::Block {\n                    source: BlockSource::Inline(_),\n                    ..\n                }\n                | EditOp::Line { .. } => req.config_path.clone(),\n            }));\n        }\n        edits => {\n            let keys = edits\n                .iter()\n                .map(|req| req.config_key())\n                .collect::<Vec<_>>()\n                .join(\", \");\n            bail!(\"{raw}: multiple [dotfiles] edit entries match; choose one of: {keys}\");\n        }\n    }\n    if target.is_relative() {\n        bail!(\"{raw}: target must be absolute or start with ~/\");\n    }\n    Ok(None)\n}\n\nfn open_or_create(path: &std::path::Path) -> Result<()> {\n    if !path.exists() {\n        if let Some(parent) = path.parent() {\n            file::create_dir_all(parent)?;\n        }\n        file::write(path, \"\")?;\n    }\n    Ok(())\n}\n\nasync fn apply_target(target: &str) -> Result<()> {\n    let config = Config::reset().await?;\n    let targets = vec![target.to_string()];\n    let files = system::files::files_from_config(&config)?","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cli/dotfiles/edit.rs#L110-L146","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\n$ mise bootstrap dotfiles edit .zshrc\nerror: .zshrc: target must be absolute or start with ~/\n\n# after\n$ mise bootstrap dotfiles edit ~/.zshrc","handlingStrategy":"validation","validationCode":"# shell: reject relative targets before calling mise\ncase \"$1\" in /*|~/*) mise bootstrap dotfiles edit \"$1\" ;; *) echo \"target must be absolute or ~/...\" >&2; exit 2 ;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass / or ~/ absolute paths to dotfiles commands","Copy the exact target spelling from `mise bootstrap dotfiles status` output"],"tags":["mise","dotfiles","path-validation","cli-usage"],"backgroundTag":"invalid-path-argument","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}