{"record":{"id":"991695976ce79f0c","repo":"BoundaryML/baml","slug":"failed-to-install-the-baml-extension-automatically-no","errorCode":null,"errorMessage":"failed to install the BAML extension automatically: no supported IDE CLI (`code` or `cursor`) was found on PATH.\n\n{help}","messagePattern":"failed to install the BAML extension automatically: no supported IDE CLI \\(`code` or `cursor`\\) was found on PATH\\.\n\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/ide_command.rs","lineNumber":125,"sourceCode":"    fn resolve_editor(&self) -> Result<OsString> {\n        if self.cursor {\n            return command_on_path(\"cursor\")\n                .ok_or_else(|| missing_ide_cli_error(\"Cursor\", \"cursor\", HostOs::CURRENT));\n        }\n        if self.code {\n            return command_on_path(\"code\")\n                .ok_or_else(|| missing_ide_cli_error(\"VS Code\", \"code\", HostOs::CURRENT));\n        }\n\n        let cursor = command_on_path(\"cursor\");\n        let code = command_on_path(\"code\");\n        match (cursor, code) {\n            (Some(cursor), None) => Ok(cursor),\n            (None, Some(code)) => Ok(code),\n            (Some(_), Some(_)) => Err(anyhow!(\n                \"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","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/ide_command.rs#L107-L143","documentation":"The counterpart of the ambiguity error: when NEITHER `code` nor `cursor` is found on PATH, `resolve_editor` errors with a message that includes OS-specific manual-install instructions generated by manual_install_help.","triggerScenarios":"Running `baml ide install` on a machine where no supported IDE CLI shim (`code`/`cursor`) is on PATH.","commonSituations":"macOS installs where the `code`/`cursor` shell commands were never added to PATH from inside the IDE (Cmd+Shift+P > 'Install code command in PATH').","solutions":["Install the CLI shim from inside the IDE (VS Code: 'Shell Command: Install code command in PATH')","Add the editor's bin directory to PATH manually","Follow the manual-install steps printed in the error's {help} section","Alternatively install the .vsix via the editor's Extensions UI"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# ensure an IDE CLI exists before running\ncommand -v code >/dev/null || command -v cursor >/dev/null || { echo \"install the VS Code/Cursor CLI shim first\"; exit 1; }","typeGuard":null,"tryCatchPattern":"if let Err(e) = result {\n    if e.to_string().contains(\"no supported IDE CLI\") {\n        eprintln!(\"Follow the manual-install steps printed above.\");\n    }\n}","preventionTips":["On macOS run 'Shell Command: Install code command in PATH' right after installing the IDE","Add the editor's bin dir to PATH in your shell profile","Check `command -v code`/`cursor` in setup scripts"],"tags":["ide","path","vscode"],"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"}