jdx/mise · error
adoption requires confirmation; review the directory and ret
Error message
adoption requires confirmation; review the directory and retry with --yes
What it means
Adopting an existing non-empty directory as the global configuration repository is a destructive-looking operation, so install_at asks for interactive confirmation. When the prompt is declined (or cannot be answered because input is not a TTY / `--yes` was not passed), the tool aborts with this error rather than proceeding without explicit consent.
Source
Thrown at src/system/remote_repository.rs:360
let new_files = entries
.split('\0')
.filter(|s| !s.is_empty())
.filter(|entry| !destination.join(entry).exists())
.count();
miseprintln!(
"Would adopt {shown} as the global configuration repository ({new_files} new file(s); existing files and local overrides preserved)"
);
return Ok(destination.to_path_buf());
}
eprintln!(
"Adopt existing global configuration at {} (preserving existing files and local overrides)",
destination.display()
);
if !yes
&& !crate::ui::confirm("Adopt this directory as the global configuration repository?")?
.is_yes()
{
bail!("adoption requires confirmation; review the directory and retry with --yes");
}
// Existing files are never replaced. Move only new files and Git metadata;
// an interrupted adoption remains recoverable without deleting user data.
for entry in entries.split('\0').filter(|s| !s.is_empty()) {
let target = destination.join(entry);
if !target.exists() {
if let Some(parent) = target.parent() {
std::fs::create_dir_all(parent)?;
}
std::fs::rename(checkout.join(entry), target)?;
}
}
std::fs::rename(checkout.join(".git"), destination.join(".git"))?;
} else if dry_run {
miseprintln!("Would clone {origin} at {revision} into {shown}");
} else {
if destination.exists() {
std::fs::remove_dir(destination)?;View on GitHub (pinned to afd2eddd3a)
Solutions
- Inspect the destination directory first, then re-run with `--yes` to confirm adoption non-interactively.
- Answer the interactive prompt with 'y' when running in a terminal.
- For automation, pre-approve by passing `--yes` explicitly in the script/CI step.
- If adoption is not wanted, point the install at an empty/fresh directory instead.
Example fix
// before: CI script fails at the confirmation prompt mise config install-source ./config.bundle // after mise config install-source --yes ./config.bundle
Defensive patterns
Strategy: try-catch
Validate before calling
if (!process.stdout.isTTY && !args.includes('--yes')) {
throw new Error('non-interactive shell: pass --yes to confirm adoption');
} Try / catch
try {
runInstall(dest, { yes: false });
} catch (e) {
if (String(e).includes('adoption requires confirmation')) {
runInstall(dest, { yes: true }); // after reviewing the directory
} else throw e;
} Prevention
- Pass `--yes` explicitly in scripts, CI, and non-TTY contexts.
- Review the destination directory contents before the first adoption run.
- Preview with a dry run to see the adoption summary before confirming.
When it happens
Trigger: Running install/preview_source against an existing non-empty destination without `.git`, in non-interactive contexts (CI, scripts, piped stdin) or with the confirmation prompt answered 'no' — whenever `yes` is false and `crate::ui::confirm` does not return yes.
Common situations: Automation/CI scripts run the installer without a TTY; user reviews the adoption summary and declines; a wrapper suppresses stdin so the prompt defaults to no.
Related errors
- remote task path is not a regular file or directory: {}
- cannot encode #{value.class} as JSON
- git command failed with {status}
- {} exists but is not a git checkout with an origin remote
- {} has origin {origin:?}, expected {url:?}
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/c9de4e73e8733eb6.
Report an issue: GitHub.