{"record":{"id":"ad209547a97b43d9","repo":"BoundaryML/baml","slug":"no-runnable-target-name-found-did-you-mean-one-of","errorCode":null,"errorMessage":"no runnable target `{name}` found. Did you mean one of:\n{}","messagePattern":"no runnable target `(.+?)` found\\. Did you mean one of:\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/run_command.rs","lineNumber":1423,"sourceCode":"\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    // ========================================================================\n\n    fn print_list(\n        &self,\n        engine: &BexEngine,\n        scripts: &HashMap<String, Vec<String>>,","sourceCodeStart":1405,"sourceCodeEnd":1441,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/run_command.rs#L1405-L1441","documentation":"The did-you-mean variant of the positional-target not-found error for `baml run <target>`: the given target matched nothing exactly, but up to 5 close candidates were found among scripts (labeled \"(script)\"), namespaces (\"(namespace)\"), user functions, and local `.baml` files (\"(file)\"). The error lists them so the user can pick the right kind of target.","triggerScenarios":"Running `baml run <name>` where `<name>` is a near-miss of a script, namespace, user function, or `.baml` filename — close enough for the suggestion heuristic (containment or Jaro-Winkler > 0.7) but not exact.","commonSituations":"Typos or casing mistakes in target names; confusing a namespace with a function name; forgetting the `.baml` extension or including it when the target is a function; a target that exists as a script in a teammate's baml.toml but not yours.","solutions":["Pick one of the suggested targets from the error and re-run, e.g. `baml run <suggested>`.","Verify the target kind via `baml run --list` and use the exact name shown.","If it's a script that should exist, add it to `[scripts]` in baml.toml.","Run from the directory where the intended `.baml` file is resolvable."],"exampleFix":"// before\nbaml run MyScript.baml\n// after\nbaml run my_script","handlingStrategy":"validation","validationCode":"// shell: exact-match check including target kind\nbaml run --list | grep -qx \"$TARGET\" || { echo \"unknown target: $TARGET\"; baml run --list; exit 1; }","typeGuard":null,"tryCatchPattern":"out=$(baml run \"$TARGET\" 2>&1) || { echo \"$out\"; case \"$out\" in *\"Did you mean\"*) ;; esac; exit 1; }","preventionTips":["Note the target kind (script vs namespace vs function vs file) shown by --list.","Avoid mixing the .baml extension into script/function target names.","Standardize baml.toml [scripts] across the team to avoid divergent target sets."],"tags":["cli","command-line","target-not-found","typo","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"}