{"record":{"id":"8d14f31d1ac3d838","repo":"jdx/mise","slug":"invalid-system-package-spec-spec-expected-m-8d14f3","errorCode":null,"errorMessage":"invalid system package spec '{spec}': expected '<manager>:<package>[@version]'","messagePattern":"invalid system package spec '(.+?)': expected '<manager>:<package>\\[@version\\]'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/mod.rs","lineNumber":400,"sourceCode":"                name: rest.to_string(),\n                version: None,\n                tap_url: None,\n                desired: packages::PackageDesiredState::Present,\n            },\n        ));\n    }\n    match rest.rsplit_once('@') {\n        Some((name, version)) if !name.is_empty() && !version.is_empty() => Ok((\n            mgr,\n            PackageRequest {\n                name: name.to_string(),\n                version: (version != \"latest\").then(|| version.to_string()),\n                tap_url: None,\n                desired: packages::PackageDesiredState::Present,\n            },\n        )),\n        Some(_) => {\n            bail!(\"invalid system package spec '{spec}': expected '<manager>:<package>[@version]'\")\n        }\n        None => Ok((\n            mgr,\n            PackageRequest {\n                name: rest.to_string(),\n                version: None,\n                tap_url: None,\n                desired: packages::PackageDesiredState::Present,\n            },\n        )),\n    }\n}\n\n/// Build [`ManagerPackages`] from already-parsed requests (used by\n/// `mise bootstrap packages use`, where version pins come from the CLI spec). Unknown or\n/// settings-excluded managers are hard errors.\npub(crate) fn packages_from_requests(\n    by_mgr: IndexMap<String, Vec<PackageRequest>>,","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/mod.rs#L382-L418","documentation":"parse_use_spec splits a `mise bootstrap packages use` spec of the form `manager:package[@version]` on '@'. After stripping the manager prefix, the remainder must be a package name optionally followed by exactly one '@version'; if a second '@' remains (Some(_) in the match), the spec shape is invalid and this error is raised.","triggerScenarios":"Calling parse_use_spec (directly or via `mise bootstrap packages use`) with more than one '@' in the package part, e.g. \"brew:openssl@3@latest\" or \"apt:curl@8.5.0-1ubuntu2@foo\".","commonSituations":"Pasting a fully-qualified package filename or docker-style tag containing '@'; double-appending a version to an already-versioned formula name like brew:postgresql@17@latest (versioned formula + explicit version must not be combined this way).","solutions":["Remove the extra '@' segment — keep at most one: \"brew:postgresql@17\" or \"brew:postgresql@17.6\"","If you want the versioned formula, drop the trailing version: \"brew:postgresql@17\"","If you want a specific version, drop the '@17' formula suffix from the name and keep one version: \"brew:postgresql@17.6\""],"exampleFix":"// before\n//   mise bootstrap packages use brew:postgresql@17@latest\n// after\n//   mise bootstrap packages use brew:postgresql@17","handlingStrategy":"validation","validationCode":"// A use-spec is manager:package with at most one '@version':\nfunction isValidUseSpec(spec: string): boolean {\n  const colon = spec.indexOf(\":\");\n  if (colon <= 0 || colon === spec.length - 1) return false;\n  const pkgPart = spec.slice(colon + 1);\n  return pkgPart.split(\"@\").length <= 2;\n}\n// isValidUseSpec(\"brew:postgresql@17\") === true\n// isValidUseSpec(\"brew:postgresql@17@latest\") === false","typeGuard":"function hasAtMostOneVersion(s: string): boolean {\n  const pkg = s.slice(s.indexOf(\":\") + 1);\n  return pkg.split(\"@\").length <= 2;\n}","tryCatchPattern":"try {\n  await mise([\"bootstrap\", \"packages\", \"use\", spec]);\n} catch (e) {\n  if (String(e).includes(\"<manager>:<package>[@version]\")) {\n    throw new Error(`Spec \"${spec}\" has multiple '@' segments; use at most one version`);\n  }\n  throw e;\n}","preventionTips":["Never combine a versioned formula name with an explicit version (postgresql@17@latest is invalid)","Count the '@' characters after the manager prefix — at most one is allowed","Don't paste package filenames or image tags containing '@' directly","Pick either the formula variant (@17) or a concrete version (@17.6), not both"],"tags":["cli","parsing","system-packages","argument-format"],"backgroundTag":"invalid-argument-format","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}