{"record":{"id":"dff54da7219661c9","repo":"jdx/mise","slug":"mise-lock-upgrade-cannot-be-combined-with-tool","errorCode":null,"errorMessage":"`mise lock --upgrade` cannot be combined with tool arguments","messagePattern":"`mise lock --upgrade` cannot be combined with tool arguments","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/lock.rs","lineNumber":281,"sourceCode":"\nfn classify_lock_result(\n    resolution_error: Option<String>,\n    error_is_fatal: bool,\n    applied: bool,\n) -> (LockTaskStatus, Option<String>) {\n    if let Some(error) = resolution_error.filter(|_| error_is_fatal) {\n        (LockTaskStatus::Failed, Some(error))\n    } else if applied {\n        (LockTaskStatus::Updated, None)\n    } else {\n        (LockTaskStatus::Unresolved, None)\n    }\n}\n\nimpl Lock {\n    pub(crate) async fn run(self) -> Result<()> {\n        if self.upgrade && !self.tool.is_empty() {\n            bail!(\"`mise lock --upgrade` cannot be combined with tool arguments\");\n        }\n        let settings = Settings::get();\n        let config = Config::get().await?;\n        if !self.dry_run && !self.upgrade {\n            lockfile::migrate_monorepo_lockfiles(&config, self.upgrade)?;\n        }\n        let before_date = self.get_before_date()?;\n        let lock_resolve_options = ResolveOptions {\n            before_date,\n            filter_installed_versions_by_release_date: true,\n            latest_versions: self.bump,\n            use_locked_version: !self.bump,\n            // Lock moving channels to their current concrete value without making\n            // ordinary `latest` requests ignore an installed concrete version.\n            resolve_rolling_channels: true,\n            ..Default::default()\n        };\n        let monorepo_union = if !self.global && config.monorepo_lockfile_root().is_some() {","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/lock.rs#L263-L299","documentation":"`mise lock` has two mutually exclusive modes: updating lockfiles for explicitly given tools, or --upgrade which re-locks everything. Passing tool arguments together with --upgrade is contradictory, so mise bails immediately before doing any work.","triggerScenarios":"Running `mise lock --upgrade <tool>` (e.g. `mise lock --upgrade node`) — self.upgrade is true while self.tool is non-empty.","commonSituations":"Users assuming --upgrade scopes to the named tools the way other mise commands accept tool arguments; scripted aliases combining flags; misreading --upgrade as \"upgrade these tools\" rather than \"upgrade all locked tools\".","solutions":["Drop --upgrade to lock only the named tools: `mise lock node python`.","Drop the tool arguments to upgrade every tool in the lockfile: `mise lock --upgrade`.","Run both if needed: `mise lock --upgrade` followed by targeted `mise lock <tool>` calls."],"exampleFix":"// before\nmise lock --upgrade node\n// after (choose one)\nmise lock node        # lock only node\n# or\nmise lock --upgrade   # upgrade all locked tools","handlingStrategy":"validation","validationCode":"# shell: pick one mode before running\nif [ \"$MODE\" = upgrade ]; then mise lock --upgrade; else mise lock \"$@\"; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember --upgrade is global: it never takes tool arguments.","For targeted relocks, omit --upgrade and list tools explicitly.","Wrap lock invocations in scripts that enforce the flag combination."],"tags":["cli","lock","conflicting-flags"],"backgroundTag":"mutually-exclusive-options","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"}