{"record":{"id":"3c51833117beea3e","repo":"jdx/mise","slug":"repo-path-path-raw-cannot-start-with-use","errorCode":null,"errorMessage":"repo path `{path_raw}` cannot start with `~`; use `~/` for a home-relative path","messagePattern":"repo path `(.+?)` cannot start with `~`; use `~/` for a home-relative path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/repos.rs","lineNumber":81,"sourceCode":"}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\npub(crate) struct RepoStatus {\n    pub request: RepoRequest,\n    pub origin: Option<String>,\n    pub current_ref: Option<String>,\n    pub current_sha: Option<String>,\n    pub state: RepoState,\n}\n\nimpl RepoRequest {\n    pub(crate) fn from_toml(\n        path_raw: String,\n        config: RepoTomlConfig,\n        project_root: Option<&Path>,\n    ) -> Result<Self> {\n        if path_raw.starts_with('~') && !path_raw.starts_with(\"~/\") {\n            bail!(\n                \"repo path `{path_raw}` cannot start with `~`; use `~/` for a home-relative path\"\n            );\n        }\n        let path = file::replace_path(&path_raw);\n        let path = if path.is_absolute() {\n            path\n        } else {\n            let Some(root) = project_root else {\n                bail!(\n                    \"relative repo paths are only allowed in a project config; use an absolute path or a `~/` path\"\n                );\n            };\n            if path.components().any(|component| {\n                matches!(\n                    component,\n                    Component::ParentDir | Component::RootDir | Component::Prefix(_)\n                )\n            }) {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/repos.rs#L63-L99","documentation":"RepoRequest::from_toml validates the `[repos]` path string from a TOML configuration. A path that begins with `~` but is not exactly the home-relative form `~/...` (e.g. `~alice/repo`, `~config`) is rejected, because bare `~` prefixes are ambiguous (another user's home vs a literal directory name) and are not expanded by `replace_path`. Only `~/` is accepted as a home-relative shorthand.","triggerScenarios":"Writing a repo entry in mise.toml with a path like `~user/repos/foo` or `~foo` — any value where the first character is `~` but the second is not `/`.","commonSituations":"Copy-pasting a path like `~otheruser/config` from shell history expecting tilde-user expansion; typos such as `~config` missing the slash; misunderstanding that only `~/` shorthand is supported.","solutions":["Use the home-relative form: change `~user/repo` to `~/repo` (your own home).","Use the full absolute path (`/home/otheruser/repo`) if you truly need another user's home directory.","If `~` is meant as a literal directory name, prefix with `./` (project-relative) or use an absolute path.","Escape nothing — the tilde shorthand is exactly `~/`; anything else must be absolute or relative."],"exampleFix":"// before (mise.toml)\n[[repos]]\npath = \"~shared/tools-repo\"\n// after\n[[repos]]\npath = \"~/tools-repo\"   # or an absolute path","handlingStrategy":"validation","validationCode":"function validateRepoPath(p) {\n  if (p.startsWith('~') && !p.startsWith('~/')) {\n    throw new Error(`repo path '${p}' must use '~/` for home-relative paths`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only ever use `~/` for tilde expansion; never `~user`.","Prefer absolute paths in generated/templated configs.","Lint mise.toml repo paths for a bare leading `~` without a slash."],"tags":["config","path-validation","toml"],"backgroundTag":"invalid-argument-format","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}