{"record":{"id":"f71fbe229cebc8b1","repo":"BoundaryML/baml","slug":"failed-to-install-the-baml-extension-into-ide-automatically","errorCode":null,"errorMessage":"failed to install the BAML extension into {ide} automatically: the `{cli}` CLI was not found on PATH.\n\n{help}","messagePattern":"failed to install the BAML extension into (.+?) automatically: the `(.+?)` CLI was not found on PATH\\.\n\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/ide_command.rs","lineNumber":141,"sourceCode":"                \"both Cursor and VS Code CLIs were found; rerun with --cursor or --code\"\n            )),\n            (None, None) => Err(anyhow!(\n                r\"failed to install the BAML extension automatically: no supported IDE CLI (`code` or `cursor`) was found on PATH.\n\n{help}\",\n                help = manual_install_help(\"VS Code or Cursor\", HostOs::CURRENT)\n            )),\n        }\n    }\n}\n\n/// The IDE is often installed without its CLI shim (on macOS the `code`\n/// and `cursor` commands must be added to PATH by hand from inside the\n/// IDE), so a bare not-found error dead-ends users who do have the IDE.\n/// Explain what we could not do and walk through the manual install\n/// instead.\nfn missing_ide_cli_error(ide: &str, cli: &str, os: HostOs) -> anyhow::Error {\n    anyhow!(\n        r\"failed to install the BAML extension into {ide} automatically: the `{cli}` CLI was not found on PATH.\n\n{help}\",\n        help = manual_install_help(ide, os)\n    )\n}\n\n/// OS-specific wording for the manual-install guidance: the example\n/// downloads directory and the Command Palette chord. A parameter of\n/// [`manual_install_help`] so tests can cover every variant.\n#[derive(Clone, Copy, Debug)]\nenum HostOs {\n    MacOs,\n    Windows,\n    Linux,\n}\n\nimpl HostOs {","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/ide_command.rs#L123-L159","documentation":"`missing_ide_cli_error` builds a contextual error for the case where a specific editor was targeted (via --code/--cursor) but its CLI shim is not installed. It explains that the extension could not be auto-installed and embeds OS-specific manual-install help, since IDEs are often installed without their CLI on PATH.","triggerScenarios":"Running `baml ide install --code` (or --cursor) when that specific CLI is absent from PATH; called from resolve_editor and tests.","commonSituations":"macOS/Windows installs where the editor exists but its shell command was never added to PATH; CI or SSH environments with only GUI apps installed.","solutions":["Install the editor's CLI command into PATH (e.g. VS Code: Cmd+Shift+P > 'Shell Command: Install code command in PATH')","Follow the manual install steps in the error's help text","Run the targeted editor if it is a different one than you intended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# confirm the targeted CLI exists first\nbaml ide install --code  # only if: command -v code\nbaml ide install --cursor # only if: command -v cursor","typeGuard":null,"tryCatchPattern":"if let Err(e) = result {\n    if e.to_string().contains(\"CLI was not found on PATH\") {\n        eprintln!(\"Use the manual install instructions from the error help text.\");\n    }\n}","preventionTips":["Only pass --code/--cursor when that CLI is known to be installed","Document PATH setup for IDE CLIs in onboarding docs","Prefer the Extensions-UI vsix install on machines without CLI shims"],"tags":["ide","path","cli"],"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-14T16:17:12.679Z"}