iOfficeAI/OfficeCLI · error · CliException

unsupported_plugin_kind

unsupported_plugin_kind

Error message

Plugin '{resolved.Manifest.Name}' is not a dump-reader; lint only applies to dump-reader plugins.

What it means

The lint command only applies to plugins whose manifest advertises the 'dump-reader' kind, because lint's contract is 'the plugin's emitted batch uses prop keys the target schema recognises'. Exporters and format-handlers have different contracts (binary output, vocabulary block) and are not schema-validatable this way.

Source

Thrown at src/officecli/CommandBuilder.Plugins.cs:246

        cmd.SetAction(result => { var json = result.GetValue(jsonOption); return SafeRun(() =>
        {
            var target = result.GetValue(nameArg) ?? "";
            var fixturePath = result.GetValue(fixtureOption);
            var resolved = ResolveByNameOrPath(target)
                ?? throw new CliException($"Plugin not found: '{target}'")
                {
                    Code = "plugin_not_found",
                    Suggestion = "Run `officecli plugins list` to see installed plugins, or provide the absolute path to the plugin executable.",
                };

            // Only dump-readers are lintable today — the lint contract is
            // "the plugin's emitted batch must use prop keys the schema
            // recognises". Exporters and format-handlers have their own
            // contracts (binary output, vocabulary block) that don't go
            // through the schema validator.
            if (!resolved.Manifest.Kinds.Contains("dump-reader"))
                throw new CliException(
                    $"Plugin '{resolved.Manifest.Name}' is not a dump-reader; lint only applies to dump-reader plugins.")
                {
                    Code = "unsupported_plugin_kind",
                    Suggestion = "Run `officecli plugins info <name>` to see what kinds the plugin advertises.",
                };

            // Resolve a fixture: explicit arg → env var. No bundled fallback —
            // a fixture is a per-plugin concern; the plugin author (or CI)
            // pins it via --fixture or $OFFICECLI_LINT_FIXTURE.
            var srcExt = resolved.Manifest.Extensions.FirstOrDefault() ?? "";
            fixturePath ??= Environment.GetEnvironmentVariable("OFFICECLI_LINT_FIXTURE");
            if (string.IsNullOrEmpty(fixturePath) || !File.Exists(fixturePath))
                throw new CliException(
                    $"No lint fixture available for plugin '{resolved.Manifest.Name}'" +
                    (string.IsNullOrEmpty(srcExt) ? "" : $" ({srcExt})") + ". " +
                    "Pass --fixture <path>, or set OFFICECLI_LINT_FIXTURE.")
                {
                    Code = "lint_fixture_missing",

View on GitHub (pinned to 1ced45e900)

Solutions

  1. Check the plugin's kinds: 'officecli plugins info <name>'.
  2. Only run lint on dump-reader plugins.
  3. If the plugin should be a dump-reader, add 'dump-reader' to its manifest Kinds.

Example fix

// before
officecli plugins lint my-exporter
// after
officecli plugins info my-exporter   # confirm kinds
# lint only dump-readers
officecli plugins lint my-dump-reader
Defensive patterns

Strategy: validation

Validate before calling

var resolved = ResolveByNameOrPath(name)
    ?? throw new ArgumentException("plugin not found");
if (!resolved.Manifest.Kinds.Contains("dump-reader"))
    throw new ArgumentException(
        $"Lint is dump-reader only; '{resolved.Manifest.Name}' advertises: {string.Join(",", resolved.Manifest.Kinds)}.");

Type guard

static bool IsLintable(PluginManifest m) => m.Kinds.Contains("dump-reader");

Prevention

When it happens

Trigger: 'officecli plugins lint <plugin>' where the plugin's manifest Kinds does not contain 'dump-reader' (e.g. an exporter-only or format-handler plugin).

Common situations: Trying to lint a plugin that only exports or handles formats; a plugin whose manifest is missing the 'dump-reader' kind declaration.

Related errors


AI-assisted analysis of iOfficeAI/OfficeCLI@1ced45e900 (2026-08-13). Data as JSON: /api/errors/404ea10104ec13af. Report an issue: GitHub.