xai-org/grok-build · error

No plugin.json found in {path}.

Error message

No plugin.json found in {path}.

What it means

`grok plugin tag` needs a version from plugin.json to build the v<version> git tag. If load_manifest reports the directory has no plugin.json (ManifestLoadResult::NotFound), the command bails with 'No plugin.json found in {path}.'

Source

Thrown at crates/codegen/xai-grok-pager/src/plugin_cmd.rs:724

            );
            Ok(())
        }
        Err(e) => bail!("Failed to load manifest: {e}"),
    }
}

fn cmd_tag(path: &str, push: bool, force: bool, dry_run: bool) -> Result<()> {
    let root = PathBuf::from(path);
    if !root.is_dir() {
        bail!("Not a directory: {path}");
    }
    let version = match load_manifest(&root) {
        Ok(ManifestLoadResult::Found(m)) => m.version.ok_or_else(|| {
            anyhow::anyhow!(
                "No `version` field in plugin.json. Set a version to use `grok plugin tag`."
            )
        })?,
        Ok(ManifestLoadResult::NotFound) => bail!("No plugin.json found in {path}."),
        Err(e) => bail!("Failed to load manifest: {e}"),
    };

    let tag = format!(
        "v{}",
        version
            .strip_prefix('v')
            .or_else(|| version.strip_prefix('V'))
            .unwrap_or(&version)
    );

    if !force {
        let out = std::process::Command::new("git")
            .args(["status", "--porcelain"])
            .current_dir(&root)
            .output()?;
        if !out.stdout.is_empty() {
            bail!("Working tree is dirty. Commit changes first, or use --force.");

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Create a plugin.json in the target directory with at least name and version fields
  2. Point the command at the directory that actually contains plugin.json
  3. If only tagging was needed, create the git tag manually: `git tag v1.0.0`

Example fix

// before: directory has no manifest, tag fails
// after: add plugin.json
{
  "name": "my-plugin",
  "version": "1.0.0"
}
Defensive patterns

Strategy: validation

Validate before calling

use std::path::Path;
fn ensure_manifest(dir: &Path) -> Result<(), String> {
    if !dir.join("plugin.json").is_file() {
        return Err(format!(
            "No plugin.json found in {}; create one with name+version",
            dir.display()
        ));
    }
    Ok(())
}

Type guard

fn has_manifest(dir: &std::path::Path) -> bool {
    dir.join("plugin.json").is_file()
}

Try / catch

match cmd_tag(dir, false, false, false) {
    Err(e) if e.to_string().contains("No plugin.json found") => {
        eprintln!("Create plugin.json with a version field first");
    }
    Ok(_) => {}
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Running `grok plugin tag <dir>` on a directory that does not contain a plugin.json file.

Common situations: Tagging a fresh plugin before creating its manifest; pointing at the repo root instead of the plugin subdirectory; plugin.json accidentally deleted or renamed.

Related errors


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/9e3afd98f46edd75. Report an issue: GitHub.