{"record":{"id":"6a535a802ebe8393","repo":"jdx/mise","slug":"flag-cannot-be-used-with-a-bootstrap-subcommand","errorCode":null,"errorMessage":"{flag} cannot be used with a bootstrap subcommand","messagePattern":"(.+?) cannot be used with a bootstrap subcommand","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":1316,"sourceCode":"        self.dry_run |= dry_run;\n        self.yes |= yes;\n    }\n\n    #[cfg(test)]\n    pub(super) fn inherited_root_flags(&self) -> (bool, bool) {\n        (self.dry_run, self.yes)\n    }\n\n    pub(crate) async fn run(mut self) -> Result<()> {\n        normalize_adopt_alias(&mut self.adopt, self.from_git.take());\n        if self.from.is_some() || self.adopt.is_some() {\n            if self.command.is_some() {\n                let flag = if self.adopt.is_some() {\n                    \"--adopt\"\n                } else {\n                    \"--from\"\n                };\n                bail!(\"{flag} cannot be used with a bootstrap subcommand\");\n            }\n            return self.run_from().await;\n        }\n        if let Some(command) = self.command.take() {\n            return command.run().await;\n        }\n        let generation = OperationScope::begin(\"bootstrap\", self.dry_run).await?;\n        let result = self.run_phases().await;\n        generation.refresh_tracked().await;\n        let error = result.as_ref().err().map(|err| format!(\"{err:#}\"));\n        generation.finish(error, result.as_ref().ok().cloned());\n        // a complete run applied the declarations that arrived through\n        // sync; a declined, partial, or dry run did not\n        if let Ok(summary) = &result\n            && !self.dry_run\n            && !is_declined(summary)\n            && self.only.is_empty()\n            && self.skip.is_empty()","sourceCodeStart":1298,"sourceCodeEnd":1334,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/bootstrap.rs#L1298-L1334","documentation":"This error is thrown by mise's `bootstrap` command when a mutually exclusive combination of flags is passed: `--adopt` or `--from` together with a bootstrap subcommand (e.g. `mise bootstrap dotfiles pull --from ...`). The flags only make sense for the bare `mise bootstrap` flow, so the CLI refuses the invocation rather than guessing intent.","triggerScenarios":"Running `mise bootstrap` with `--adopt` (or `--from <repo>`) while also naming a subcommand as a positional argument; `self.command.is_some()` is true and `self.adopt`/`self.from` are set, so the bail fires before dispatching to `run_from` or the subcommand.","commonSituations":"Copying a bootstrap invocation that used `--from` and appending a subcommand like `dotfiles pull` or `status`; scripting `mise bootstrap --adopt <subcommand>` assuming the flag applies to all subcommands; shell aliases that bake in `--adopt` or `--from`.","solutions":["Remove the subcommand so the flags apply to the bare `mise bootstrap` flow (e.g. `mise bootstrap --from <repo>` or `mise bootstrap --adopt`).","Remove `--adopt`/`--from` if you actually meant to run a bootstrap subcommand (e.g. `mise bootstrap dotfiles pull`).","Check `mise bootstrap --help` to see which flags belong to the top-level command vs the subcommands.","If scripting, split the invocation: run the bare bootstrap with flags once, then invoke subcommands separately."],"exampleFix":"// before\nmise bootstrap dotfiles pull --from git@github.com:me/dotfiles.git\n// after\nmise bootstrap --from git@github.com:me/dotfiles.git\nmise bootstrap dotfiles pull","handlingStrategy":"validation","validationCode":"# shell pre-check before invoking\nif [[ -n \"$BOOTSTRAP_FROM\" && -n \"$BOOTSTRAP_SUBCMD\" ]]; then\n  echo \"--from/--adopt cannot be combined with a bootstrap subcommand\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":"mise bootstrap --from \"$REPO\" || mise bootstrap \"$SUBCMD\"  # run as separate invocations, not one","preventionTips":["Never combine --adopt/--from with a positional bootstrap subcommand","Keep flag-bearing bootstrap invocations and subcommand invocations as separate commands","Check `mise bootstrap --help` when composing scripted invocations"],"tags":["cli","mutually-exclusive-flags","bootstrap"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}