BoundaryML/baml · error
--manifest-base-url requires a value
Error message
--manifest-base-url requires a value
What it means
The `--manifest-base-url` flag used by `baml toolchain` subcommands consumes the next argument as its value. When the flag is the last argument and nothing follows it, `parse_manifest_base_url` throws this error instead of silently treating the missing URL as an empty string.
Solutions
- Append the URL value: `--manifest-base-url https://example.com/manifests/` (trailing slashes are trimmed automatically).
- Quote the variable and verify it is non-empty before invoking: `[ -n "$URL" ]`.
- Omit the flag entirely if you want the default manifest source.
Example fix
# before URL="" baml toolchain install nightly --manifest-base-url $URL # after URL="https://mirrors.example.com/baml" baml toolchain install nightly --manifest-base-url "$URL"
Defensive patterns
Strategy: validation
Validate before calling
URL="${MANIFEST_BASE_URL:-}"
cmd=(baml toolchain install nightly)
if [ -n "$URL" ]; then
[ "$URL" = "${URL#-}" ] || { echo "bad URL" >&2; exit 1; }
cmd+=(--manifest-base-url "$URL")
fi
"${cmd[@]}" Type guard
function hasFlagValue(args: string[], flag: string): boolean {
const i = args.indexOf(flag);
return i !== -1 && i + 1 < args.length && args[i + 1].length > 0;
} Try / catch
try:
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
if "--manifest-base-url requires a value" in e.stderr.decode():
raise SystemExit("--manifest-base-url was given without a URL") Prevention
- Always place the URL immediately after --manifest-base-url, never let it end a command line.
- Quote variables: `--manifest-base-url "$URL"` so empty values are visible failures.
- Omit the flag entirely when no custom manifest source is needed.
When it happens
Trigger: Running e.g. `baml toolchain install nightly --manifest-base-url` with no value after the flag.
Common situations: Shell scripts where the URL variable is empty or unset (`--manifest-base-url $URL` expanding to nothing), copy-paste dropping the URL, or line-wrapped commands losing the last token.
Understand the failure class
Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.
Related errors
- unknown toolchain command
- usage: baml toolchain install <canary|nightly|version>
- usage: baml toolchain pin <canary|nightly|version|path>
- usage: baml toolchain pin…
- usage: baml toolchain uninstall
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/da6e9be76f2ebf73.
Report an issue: GitHub.
Appendix: source
Thrown at baml_language/crates/baml/src/main.rs:409
}
Some(other) => Err(anyhow!(
"unknown toolchain command {other:?}\n\n{TOOLCHAIN_HELP}"
)),
}
}
fn is_help_arg(arg: &str) -> bool {
matches!(arg, "--help" | "-h" | "help")
}
fn parse_manifest_base_url(mut args: Vec<String>) -> Result<(Vec<String>, Option<String>)> {
let mut manifest_base_url = None;
let mut i = 0;
while i < args.len() {
if args[i] == "--manifest-base-url" {
let value = args
.get(i + 1)
.ok_or_else(|| anyhow!("--manifest-base-url requires a value"))?
.trim_end_matches('/')
.to_string();
args.drain(i..=i + 1);
manifest_base_url = Some(value);
} else {
i += 1;
}
}
Ok((args, manifest_base_url))
}
fn pass_through(args: Vec<String>) -> Result<i32> {
let selector = active_selector()?;
if let Some(cli) = path_selector(&selector.selector) {
return exec_path_toolchain(cli, &selector, args);
}
let version = concrete_version_for_selector(&selector)?;
let cli = toolchain_cli_path(&version);View on GitHub (pinned to bd85ce9dee)