jdx/mise · error
adoption requires confirmation; review the directory and…
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-ish operation, so mise requires explicit confirmation. It prompts interactively; if the user declines or the command runs non-interactively without the `--yes` flag, the adoption aborts before any files or Git metadata are moved.
Solutions
- Re-run the command with `--yes` to skip the interactive confirmation.
- First review the directory contents and the listed new/conflicting files, then confirm with `--yes` once satisfied.
- For automation, add `--yes` to the script after a one-time manual review.
- If you declined intentionally, adopt a different (empty or dedicated) destination directory instead.
Example fix
// before (non-interactive, fails) $ mise config install-source <bundle> --origin <url> adoption requires confirmation // after $ mise config install-source <bundle> --origin <url> --yes
Defensive patterns
Strategy: try-catch
Try / catch
try {
await installSource(bundle, origin);
} catch (e) {
if (/requires confirmation/.test(String(e.cause ?? e))) {
// non-interactive context: re-run with explicit consent after review
return installSource(bundle, origin, { yes: true });
}
throw e;
} Prevention
- Pass --yes when running non-interactively (CI, scripts) after a one-time manual review
- Review the destination directory contents before first-time adoption
- Adopt a dedicated, curated directory rather than an arbitrary populated one
When it happens
Trigger: install/install_source/preview_source (install_at) targeting a non-empty destination without `.git`, run either (a) non-interactively without `--yes`, or (b) interactively where the user answered no to the confirmation prompt.
Common situations: Scripted/CI onboarding runs where no TTY exists and `--yes` was omitted; users piped the command and never saw the prompt; users reviewed the listed directory contents and deliberately declined.
Understand the failure class
Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.
Related errors
- a branch name is required
- a repository url is required
- declined; nothing was changed
- existing file conflicts with adoption
- existing symbolic link conflicts with adoption
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/c9de4e73e8733eb6.
Report an issue: GitHub.
Appendix: 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 533346cc37)