{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/system/repos.rs#L63-L99","documentation":"When parsing a `[repos]` entry from mise configuration, the `path` value must not start with a bare `~` unless it is a proper home-relative path beginning with `~/`. Values like `~foo` or `~repos/x` are ambiguous and not expanded by `file::replace_path`, so mise rejects them at parse time with guidance to use `~/`.","triggerScenarios":"Calling `RepoRequest::from_toml` with a `path_raw` string that starts with `~` but not `~/` — e.g. `path = \"~mise/config\"` or `path = \"~\"` alone — in a mise.toml `[repos]` table.","commonSituations":"Typo where the `/` was dropped (`~mise` instead of `~/mise`); confusing tilde-prefixed directory names with home expansion; pasting a path like `~user/...` expecting user-relative expansion which mise does not support.","solutions":["Change the value to start with `~/`, e.g. `path = \"~/mise/config\"`.","If you meant another user's home, write the absolute path explicitly (e.g. `/home/other/...`) — `~user` expansion is not supported.","If the tilde was accidental, remove it or use a full absolute path."],"exampleFix":"# before\n[repos]\npath = \"~mise/config\"\n\n# after\n[repos]\npath = \"~/mise/config\"","handlingStrategy":"validation","validationCode":"if (/^~(?!\\/)/.test(repoPath)) throw new Error(`path '${repoPath}' must start with ~/ (home-relative), an absolute path, or be relative to the project`);","typeGuard":null,"tryCatchPattern":"try {\n  parseRepoToml(cfg);\n} catch (e) {\n  if (/cannot start with `~`/.test(String(e.cause ?? e))) {\n    cfg.path = '~/' + cfg.path.replace(/^~/, '');\n  }\n  throw e;\n}","preventionTips":["Always write home paths as `~/...`, never `~name/...` or a bare `~`","Use absolute paths when you need another user's home directory","Validate [repos] paths with a lint step before committing mise.toml"],"tags":["configuration","path","tilde-expansion","toml"],"backgroundTag":"invalid-argument-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}