{"record":{"id":"9523cdae08416596","repo":"BoundaryML/baml","slug":"baml-update-is-ambiguous-to-use-the-latest-version-of-baml","errorCode":null,"errorMessage":"`baml update` is ambiguous.\nTo use the latest version of BAML, run `baml toolchain update`.\nTo use the latest BAML toolchain selector, run `baml self-update`.","messagePattern":"`baml update` is ambiguous\\.\nTo use the latest version of BAML, run `baml toolchain update`\\.\nTo use the latest BAML toolchain selector, run `baml self-update`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/lib.rs","lineNumber":152,"sourceCode":"            // No tests were found\n            ExitCode::NoTestsRun => 5,\n            // `baml query` contract (documented per-command)\n            ExitCode::QueryIncomplete => 1,\n            ExitCode::QueryInvalid => 2,\n            ExitCode::QueryBudgetExhausted => 3,\n            ExitCode::QueryCancelled => 4,\n            ExitCode::QueryFailed => 5,\n        }\n    }\n}\n\n/// Run the CLI with the given arguments.\n///\n/// Dispatches to one of: `run`, `check`, `generate`, `test`, `pack`,\n/// `fmt`, ... `baml run` is the top-level entry for standalone execution.\npub fn run_cli(argv: Vec<String>) -> Result<ExitCode> {\n    if argv.get(1).map(String::as_str) == Some(\"update\") {\n        return Err(anyhow!(\n            \"`baml update` is ambiguous.\\n\\\n             To use the latest version of BAML, run `baml toolchain update`.\\n\\\n             To use the latest BAML toolchain selector, run `baml self-update`.\"\n        ));\n    }\n    let cli = commands::RuntimeCli::parse_from_smart(argv);\n    cli.run()\n}\n\n// TODO: Original run_cli that used RuntimeCliDefaults is commented out\n// pub fn run_cli(\n//     argv: Vec<String>,\n//     caller_type: baml_runtime::RuntimeCliDefaults,\n// ) -> Result<ExitCode> {\n//     let mut cli = commands::RuntimeCli::parse_from_smart(argv);\n//     if !matches!(cli.command, commands::Commands::Test(_)) {\n//         // We only need to set the exit handlers if we're not running tests\n//         // and the caller is Python.","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/lib.rs#L134-L170","documentation":"run_cli deliberately rejects the bare `baml update` invocation because it is ambiguous: it could mean updating the BAML version used by a project or updating the toolchain selector binary itself. The CLI exits with a message directing users to `baml toolchain update` (latest BAML version) or `baml self-update` (latest toolchain selector).","triggerScenarios":"Invoke the CLI with `update` as the first argument (argv[1] == \"update\"), e.g. `baml update`.","commonSituations":"Habit from other CLIs (npm update, rustup update) where `update` is a generic subcommand; outdated docs or tutorials referencing a former `baml update` command.","solutions":["Run `baml toolchain update` to get the latest BAML version for your project.","Run `baml self-update` to update the BAML toolchain selector binary itself.","Update scripts/docs to use the explicit subcommands instead of `baml update`."],"exampleFix":"// before\nbaml update\n// after\nbaml toolchain update   # or: baml self-update","handlingStrategy":"validation","validationCode":"# replace ambiguous update in scripts\ncase \"$cmd\" in update) echo \"use 'baml toolchain update' or 'baml self-update'\"; exit 1;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never script bare `baml update`","Use explicit subcommands: baml toolchain update / baml self-update","Update internal docs/aliases that reference the old command"],"tags":["cli","ambiguous-command","update","usage"],"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-23T08:17:48.524Z"}