jdx/mise · error

repo path ` ` cannot start with `~`; use `~/` for a…

Error message

repo path `{path_raw}` cannot start with `~`; use `~/` for a home-relative path

What it means

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 `~/`.

Solutions

  1. Change the value to start with `~/`, e.g. `path = "~/mise/config"`.
  2. If you meant another user's home, write the absolute path explicitly (e.g. `/home/other/...`) — `~user` expansion is not supported.
  3. If the tilde was accidental, remove it or use a full absolute path.

Example fix

# before
[repos]
path = "~mise/config"

# after
[repos]
path = "~/mise/config"
Defensive patterns

Strategy: validation

Validate before calling

if (/^~(?!\/)/.test(repoPath)) throw new Error(`path '${repoPath}' must start with ~/ (home-relative), an absolute path, or be relative to the project`);

Try / catch

try {
  parseRepoToml(cfg);
} catch (e) {
  if (/cannot start with `~`/.test(String(e.cause ?? e))) {
    cfg.path = '~/' + cfg.path.replace(/^~/, '');
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/3c51833117beea3e. Report an issue: GitHub.

Appendix: source

Thrown at src/system/repos.rs:81

}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct RepoStatus {
    pub request: RepoRequest,
    pub origin: Option<String>,
    pub current_ref: Option<String>,
    pub current_sha: Option<String>,
    pub state: RepoState,
}

impl RepoRequest {
    pub(crate) fn from_toml(
        path_raw: String,
        config: RepoTomlConfig,
        project_root: Option<&Path>,
    ) -> Result<Self> {
        if path_raw.starts_with('~') && !path_raw.starts_with("~/") {
            bail!(
                "repo path `{path_raw}` cannot start with `~`; use `~/` for a home-relative path"
            );
        }
        let path = file::replace_path(&path_raw);
        let path = if path.is_absolute() {
            path
        } else {
            let Some(root) = project_root else {
                bail!(
                    "relative repo paths are only allowed in a project config; use an absolute path or a `~/` path"
                );
            };
            if path.components().any(|component| {
                matches!(
                    component,
                    Component::ParentDir | Component::RootDir | Component::Prefix(_)
                )
            }) {

View on GitHub (pinned to 533346cc37)