nikivdev/code · error

unsupported external CLI manifest version {} in {}

Error message

unsupported external CLI manifest version {} in {}

What it means

`read_manifest` parses an external CLI manifest TOML and requires `version == 1`. Any other version is rejected with this error naming the found version and manifest path, since the library only understands the v1 manifest schema.

Source

Thrown at src/external_cli.rs:539

    let record: ExternalCliLinkRecord =
        toml::from_str(&content).with_context(|| format!("failed to parse {}", path.display()))?;
    if record.version != LINK_RECORD_VERSION {
        bail!(
            "unsupported external CLI link record version {} in {}",
            record.version,
            path.display()
        );
    }
    Ok(record)
}

fn read_manifest(path: &Path) -> Result<ExternalCliManifest> {
    let content =
        fs::read_to_string(path).with_context(|| format!("failed to read {}", path.display()))?;
    let manifest: ExternalCliManifest =
        toml::from_str(&content).with_context(|| format!("failed to parse {}", path.display()))?;
    if manifest.version != 1 {
        bail!(
            "unsupported external CLI manifest version {} in {}",
            manifest.version,
            path.display()
        );
    }
    if manifest.exec.run.is_empty() {
        bail!("missing exec.run in {}", path.display());
    }
    Ok(manifest)
}

#[cfg(test)]
mod tests {
    use super::*;

    fn write_tool(root: &Path, id: &str) -> PathBuf {
        let tool_root = root.join(id);
        fs::create_dir_all(&tool_root).expect("create tool root");

View on GitHub (pinned to a747e741ae)

Solutions

  1. Change the manifest's `version` to `1` if its schema is the v1 format and the edit was accidental.
  2. Regenerate or rewrite the manifest using the v1 schema (version = 1, plus valid `id` and `[exec] run`).
  3. Upgrade the library/tooling to a release that supports the manifest version you have, if a newer schema is intended.
  4. Check the manifest's provenance — it may belong to a different tool ecosystem.

Example fix

# before (tool.toml)
version = 2

# after
version = 1
Defensive patterns

Strategy: validation

Validate before calling

fn check_manifest_version(path: &Path) -> Result<(), String> {
    let text = std::fs::read_to_string(path).map_err(|e| e.to_string())?;
    let v: toml::Value = toml::from_str(&text).map_err(|e| e.to_string())?;
    let ver = v.get("version").and_then(|v| v.as_integer()).unwrap_or(-1);
    if ver == 1 { Ok(()) } else { Err(format!("{}: manifest version {ver} != 1", path.display())) }
}

Try / catch

match loader.read_manifest(&path) {
    Err(e) if e.to_string().contains("unsupported external CLI manifest version") => {
        eprintln!("{e}; migrating manifest to v1 schema");
        migrate_manifest_to_v1(&path)?;
        loader.read_manifest(&path)
    }
    other => other,
}

Prevention

When it happens

Trigger: Calling `list_external_cli_tools`, `install_external_cli_link`, `resolve_external_cli_tool_in_roots`, or `resolved_from_link_record` on a manifest whose `version` field is not exactly 1.

Common situations: Manifest written for a future/other tool version; hand-edited version field; manifests generated by a newer exporter using a v2 schema; copy-pasted manifests from a different project.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/e78f80ef435d002c. Report an issue: GitHub.