{"record":{"id":"181b962e53d2ee0b","repo":"BoundaryML/baml","slug":"unknown-toolchain-command-other-toolchain-help","errorCode":null,"errorMessage":"unknown toolchain command {other:?}\n\n{TOOLCHAIN_HELP}","messagePattern":"unknown toolchain command (.+?)\n\n(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml/src/main.rs","lineNumber":392,"sourceCode":"                    \"usage: baml toolchain pin <canary|nightly|version|path>\\nunexpected arguments: {}\",\n                    args[2..].join(\" \")\n                ));\n            }\n            pin_toolchain(selector, manifest_base_url.as_deref())\n        }\n        Some(\"update\") => update_toolchain(manifest_base_url.as_deref()),\n        Some(\"status\") => status_toolchain(manifest_base_url.as_deref()),\n        Some(\"list\") => {\n            list_toolchains();\n            Ok(())\n        }\n        Some(\"uninstall\") => {\n            let version = args\n                .get(1)\n                .ok_or_else(|| anyhow!(\"usage: baml toolchain uninstall <version>\"))?;\n            uninstall_toolchain(version)\n        }\n        Some(other) => Err(anyhow!(\n            \"unknown toolchain command {other:?}\\n\\n{TOOLCHAIN_HELP}\"\n        )),\n    }\n}\n\nfn is_help_arg(arg: &str) -> bool {\n    matches!(arg, \"--help\" | \"-h\" | \"help\")\n}\n\nfn parse_manifest_base_url(mut args: Vec<String>) -> Result<(Vec<String>, Option<String>)> {\n    let mut manifest_base_url = None;\n    let mut i = 0;\n    while i < args.len() {\n        if args[i] == \"--manifest-base-url\" {\n            let value = args\n                .get(i + 1)\n                .ok_or_else(|| anyhow!(\"--manifest-base-url requires a value\"))?\n                .trim_end_matches('/')","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml/src/main.rs#L374-L410","documentation":"The `toolchain` subcommand dispatcher handles install/use/pin/uninstall/list (and help); any other word after `baml toolchain` hits the `Some(other)` catch-all arm and throws this error, echoing the unknown command plus the full toolchain help text.","triggerScenarios":"Running `baml toolchain <typo>` where the token is not install/use/pin/uninstall/list/help — e.g. `baml toolchain update`, `baml toolchain rm`, `baml toolchain switch`.","commonSituations":"Muscle-memory from rustup (`rustup toolchain update`), typos like `instal`, or guessing subcommand names instead of reading help.","solutions":["Read the TOOLCHAIN_HELP text printed with the error and pick a supported command.","Use `baml toolchain install <selector>` to get a newer toolchain instead of a hypothetical `update`.","Use `baml toolchain list` to verify the command works and see what's available."],"exampleFix":"# before\nbaml toolchain update\n\n# after\nbaml toolchain install nightly","handlingStrategy":"validation","validationCode":"ALLOWED=\"install use pin uninstall list help\"\nif [[ \" $ALLOWED \" != *\" $TOOLCHAIN_CMD \"* ]]; then\n  echo \"unknown toolchain command: $TOOLCHAIN_CMD\" >&2; exit 1\nfi\nbaml toolchain \"$TOOLCHAIN_CMD\"","typeGuard":"const TOOLCHAIN_COMMANDS = [\"install\", \"use\", \"pin\", \"uninstall\", \"list\", \"help\"] as const;\ntype ToolchainCommand = typeof TOOLCHAIN_COMMANDS[number];\nconst isToolchainCommand = (s: string): s is ToolchainCommand =>\n  (TOOLCHAIN_COMMANDS as readonly string[]).includes(s);","tryCatchPattern":"try:\n    subprocess.run([\"baml\", \"toolchain\", cmd], check=True)\nexcept subprocess.CalledProcessError as e:\n    if \"unknown toolchain command\" in e.stderr.decode():\n        raise SystemExit(\"Unsupported command — see TOOLCHAIN_HELP in the error output\")","preventionTips":["Check `baml toolchain --help` to learn the exact command set.","Don't assume rustup-compatible verbs like `update` or `default` exist.","Whitelist subcommands in wrapper scripts before forwarding."],"tags":["cli","usage","unknown-command","toolchain"],"backgroundTag":"command-not-found","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}