{"record":{"id":"5b397b322e941489","repo":"jdx/mise","slug":"mise-prune-requires-confirmation-but-there-was-nobody-to-ask","errorCode":null,"errorMessage":"mise prune requires confirmation but there was nobody to ask; pass --yes to prune non-interactively","messagePattern":"mise prune requires confirmation but there was nobody to ask; pass --yes to prune non-interactively","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/prune.rs","lineNumber":238,"sourceCode":"        return Ok(());\n    }\n\n    // Ask about everything first, then remove. A prompt in the middle of a\n    // live region has to pause it, and the answers are the same either way.\n    let mut confirmed = Vec::with_capacity(to_delete.len());\n    for (p, tv) in to_delete {\n        if let Some(needed) = explain {\n            explain_removal(&tv, needed);\n        }\n        if Settings::get().yes {\n            confirmed.push((p, tv));\n            continue;\n        }\n        match prompt::confirm_with_all(format!(\"remove {} ?\", tv))? {\n            Confirmation::Yes => confirmed.push((p, tv)),\n            Confirmation::No | Confirmation::Unanswered => {}\n            Confirmation::Unavailable if unavailable == UnavailableConfirmation::Decline => {}\n            Confirmation::Unavailable => eyre::bail!(\n                \"mise prune requires confirmation but there was nobody to ask; pass --yes to prune non-interactively\"\n            ),\n        }\n    }\n\n    let mut progress = removal_progress(\n        &mpr,\n        confirmed\n            .iter()\n            .map(|(_, tv)| (removal_key(tv), tv.style())),\n    );\n    for (p, tv) in confirmed {\n        let tool = progress\n            .as_ref()\n            .and_then(|progress| progress.start_tool(&removal_key(&tv)));\n        let pr = match &tool {\n            Some(tool) => tool.reporter(),\n            None => mpr.add(&tv.style()),","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/prune.rs#L220-L256","documentation":"`mise prune` asks for confirmation before removing tool versions. When the command runs non-interactively (no TTY/stdin to prompt), confirmation is Unavailable; unless --yes (UnavailableConfirmation other than Decline) was passed, mise aborts rather than deleting tools without consent.","triggerScenarios":"Running `mise prune` in CI, scripts, or piped contexts where ui::confirm cannot read an answer, without passing --yes.","commonSituations":"CI pipeline cleanup steps; cron jobs; shell scripts piping prune output; Dockerfile RUN steps without -it.","solutions":["Pass --yes: `mise prune --yes` to confirm removals non-interactively","Restrict scope so no confirmation is needed, e.g. `mise prune <tool>@<version>` where policy allows","Run prune interactively in a TTY session instead"],"exampleFix":"// before (CI)\nrun: mise prune\n// after\nrun: mise prune --yes","handlingStrategy":"validation","validationCode":"if [ ! -t 0 ]; then PRUNE_FLAGS=\"--yes\"; fi; mise prune $PRUNE_FLAGS","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --yes in CI/scripts for destructive mise commands","Guard interactive commands with a TTY check","Scope prune narrowly so unattended runs are predictable"],"tags":["prune","confirmation","non-interactive","ci","cli-flag"],"backgroundTag":"missing-required-flag","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"}