xai-org/grok-build · error
No `version` field in plugin.json. Set a version to use `gro
Error message
No `version` field in plugin.json. Set a version to use `grok plugin tag`.
What it means
`grok plugin tag` derives a git tag from the manifest version, but the loaded plugin.json has no `version` field (`m.version` is None). The command refuses to tag without a version and tells the user to add one.
Source
Thrown at crates/codegen/xai-grok-pager/src/plugin_cmd.rs:720
println!(
"No plugin.json found. Grok discovers skills, agents, and hooks \
automatically from standard directories. A manifest is only needed \
for custom paths or metadata."
);
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"])View on GitHub (pinned to bc7f02eddd)
Solutions
- Add a `"version": "x.y.z"` field to plugin.json in the plugin root
- Re-run `grok plugin tag <path>`
- If version lives elsewhere (e.g. Cargo.toml), mirror it into plugin.json since tagging only reads the manifest
Example fix
// before (plugin.json)
{ "name": "my-plugin" }
// after
{ "name": "my-plugin", "version": "0.1.0" } Defensive patterns
Strategy: validation
Validate before calling
let m: serde_json::Value = serde_json::from_str(&std::fs::read_to_string("plugin.json")?)?;
if m.get("version").and_then(|v| v.as_str()).is_none() {
eprintln!("plugin.json needs a \"version\" field before grok plugin tag");
} Try / catch
match manifest.version {
Some(v) => tag_with(v),
None => eprintln!("add \"version\": \"x.y.z\" to plugin.json to use grok plugin tag"),
} Prevention
- Always include name+version+description in plugin.json scaffolds
- Keep plugin.json version in sync with Cargo.toml/package version
- Add a CI check that manifest version is present and semver
When it happens
Trigger: Running `grok plugin tag <path>` on a plugin whose plugin.json omits `version` (or has it only under an unrecognized key), so `load_manifest` yields Found with `version: None`.
Common situations: Minimal plugin manifests that skip versioning; manifest hand-written without version; version accidentally removed during a refactor.
Related errors
- Failed to load manifest: {e}
- No plugin.json found in {path}.
- Manifest validation failed: {e}
- Working tree is dirty. Commit changes first, or use --force.
- Failed to create tag: {stderr}
AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31).
Data as JSON: /api/errors/ba994ffbdd003058.
Report an issue: GitHub.