{"record":{"id":"d4af4886366966da","repo":"BoundaryML/baml","slug":"no-runnable-target-name-found-use-baml-run-list-to-see","errorCode":null,"errorMessage":"no runnable target `{name}` found.\nuse `baml run --list` to see available targets.","messagePattern":"no runnable target `(.+?)` found\\.\nuse `baml run --list` to see available targets\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/run_command.rs","lineNumber":1418,"sourceCode":"                    label: format!(\"{file_name} (file)\"),\n                });\n            }\n        }\n        candidates.sort_by(|a, b| a.name.cmp(&b.name));\n\n        let suggestions: Vec<&str> = candidates\n            .iter()\n            .filter(|c| {\n                c.name.contains(name)\n                    || name.contains(&c.name)\n                    || strsim::jaro_winkler(&c.name, name) > 0.7\n            })\n            .take(5)\n            .map(|c| c.label.as_str())\n            .collect();\n\n        if suggestions.is_empty() {\n            anyhow!(\n                \"no runnable target `{name}` found.\\n\\\n                 use `baml run --list` to see available targets.\"\n            )\n        } else {\n            anyhow!(\n                \"no runnable target `{name}` found. Did you mean one of:\\n{}\",\n                suggestions\n                    .iter()\n                    .map(|s| format!(\"  - {s}\"))\n                    .collect::<Vec<_>>()\n                    .join(\"\\n\")\n            )\n        }\n    }\n\n    // ========================================================================\n    // --list\n    // ========================================================================","sourceCodeStart":1400,"sourceCodeEnd":1436,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/run_command.rs#L1400-L1436","documentation":"The positional target given to `baml run <target>` matched no runnable target. Candidate space spans scripts from `baml.toml` `[scripts]`, namespaces, user functions, and `.baml` files in the current directory; when no candidate is close (containment or Jaro-Winkler > 0.7), this error is thrown telling the user to run `baml run --list`.","triggerScenarios":"Running `baml run <name>` where `<name>` is not a script defined in `baml.toml` `[scripts]`, not a namespace, not a user function, and not a `.baml` file in the current directory.","commonSituations":"Typo in a script/namespace/function name; the `[scripts]` section was renamed or removed from baml.toml; running from a subdirectory where the target `.baml` file isn't resolvable; referencing a target that only exists in another branch.","solutions":["Run `baml run --list` to enumerate all runnable targets (scripts, namespaces, functions, files).","Correct the target name on the command line.","If the script is missing, add it under `[scripts]` in baml.toml.","Change to the project root (or the directory containing the relevant `.baml` files) before running."],"exampleFix":"// before\nbaml run clsify\n// after\nbaml run classify","handlingStrategy":"validation","validationCode":"// shell: check target against baml.toml scripts and --list before running\nbaml run --list | grep -qx \"$TARGET\" || { echo \"unknown target $TARGET\"; exit 1; }","typeGuard":null,"tryCatchPattern":"baml run \"$TARGET\" || { echo \"run 'baml run --list' to see targets\"; exit 1; }","preventionTips":["Run `baml run --list` after adding new scripts/namespaces.","Always run from the project root so .baml files resolve.","Keep [scripts] entries documented for the team."],"tags":["cli","command-line","target-not-found","baml"],"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"}