BoundaryML/baml · error

no runnable target `{name}` found. Did you mean one of: {}

Error message

no runnable target `{name}` found. Did you mean one of:
{}

What it means

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.

Source

Thrown at baml_language/crates/baml_cli/src/run_command.rs:1423

        let suggestions: Vec<&str> = candidates
            .iter()
            .filter(|c| {
                c.name.contains(name)
                    || name.contains(&c.name)
                    || strsim::jaro_winkler(&c.name, name) > 0.7
            })
            .take(5)
            .map(|c| c.label.as_str())
            .collect();

        if suggestions.is_empty() {
            anyhow!(
                "no runnable target `{name}` found.\n\
                 use `baml run --list` to see available targets."
            )
        } else {
            anyhow!(
                "no runnable target `{name}` found. Did you mean one of:\n{}",
                suggestions
                    .iter()
                    .map(|s| format!("  - {s}"))
                    .collect::<Vec<_>>()
                    .join("\n")
            )
        }
    }

    // ========================================================================
    // --list
    // ========================================================================

    fn print_list(
        &self,
        engine: &BexEngine,
        scripts: &HashMap<String, Vec<String>>,

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Pick one of the suggested targets from the error and re-run, e.g. `baml run <suggested>`.
  2. Verify the target kind via `baml run --list` and use the exact name shown.
  3. If it's a script that should exist, add it to `[scripts]` in baml.toml.
  4. Run from the directory where the intended `.baml` file is resolvable.

Example fix

// before
baml run MyScript.baml
// after
baml run my_script
Defensive patterns

Strategy: validation

Validate before calling

// shell: exact-match check including target kind
baml run --list | grep -qx "$TARGET" || { echo "unknown target: $TARGET"; baml run --list; exit 1; }

Try / catch

out=$(baml run "$TARGET" 2>&1) || { echo "$out"; case "$out" in *"Did you mean"*) ;; esac; exit 1; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/ad209547a97b43d9. Report an issue: GitHub.