Skip to content

fix(plugin): name plugin install when mate plugin has no subcommand - #227

Merged
TornquistK merged 1 commit into
mainfrom
workset/name-the-plugin-subcommand
Dec 2, 2026
Merged

TornquistK merged 1 commit into
mainfrom
workset/name-the-plugin-subcommand

Conversation

@TornquistK

Copy link
Copy Markdown
Collaborator

Summary

Fixes one problem from the 2026-12-02 friction sweep (change name-the-plugin-subcommand).

Bare mate plugin treated the missing subcommand as an unknown one:

 runPluginCommand(subcommand, argv)
+  no subcommand
+    stderr: "mate: plugin command required. Use `mate plugin install <package>`."
+    exit 1
   "install"  → runPluginInstallCommand
   otherwise  → "Unknown plugin command: <name>" + global usage, exit 1   (unchanged)

The wording follows mate cap without a name (mate: capability name required. Use mate cap <...>.). The --help events of this fingerprint were already fixed by 93bb3ed.

plugin.test.ts also reset process.exitCode to undefined after each test. Bun ignores that, so the file exited 1 with every test passing. It now resets to ?? 0.

Evidence

  • Before (Mate 0.21.1, friction event): mate plugin → Unknown plugin command: with an empty name, then the whole global usage on stderr, exit 1.
  • After: runPluginCommand(undefined, []) writes only mate: plugin command required. Use mate plugin install . and sets exit code 1.
  • Tests: src/cli/commands/plugin/plugin.test.ts adds two tests:
    • a missing subcommand names plugin install without the global usage (red on ff9315f, green now)
    • an unknown subcommand keeps its name and the global usage (green before and after)
  • bun run format, bun run lint, bun run typecheck pass; packages/mate-core bun run test: 7004 pass, 22 skip, 0 fail.

OpenSpec change: name-the-plugin-subcommand

Friction: command:plugin:1 (the bare mate plugin event; its --help events were fixed by 93bb3ed)

Bare `mate plugin` printed "Unknown plugin command: " with an empty name and the whole global usage. It now prints one line naming `mate plugin install <package>` and exits 1. An unknown subcommand keeps its answer.

The plugin test file also reset process.exitCode to undefined, which Bun ignores, so the file exited 1 with every test passing.
@TornquistK
TornquistK merged commit 5f9c793 into main Dec 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant