fix(cli): plugin commands listed but never dispatched in bin/moko #236

Closed
opened 2026-05-31 14:20:39 +00:00 by jmiller · 2 comments
Owner

Problem

bin/moko's loadPluginCommands() (lines 316-364) discovers plugin commands via getCommands() and displays them in the help listing, but never actually routes them for execution.

When a user runs a plugin-provided command, bin/moko returns "Unknown command" because only COMMAND_MAP entries are dispatched (line 200).

Related

  • #148 (feat: plugin CLI commands - populate getCommands())
  • Currently no plugins override getCommands() — they all return empty arrays

Proposal

  1. After COMMAND_MAP lookup fails, check plugin commands
  2. If a plugin command matches, resolve its script path and dispatch
  3. Pass plugin context (project type, config) to the dispatched script

Acceptance Criteria

  • Plugin-provided commands are executable via bin/moko
  • Plugin commands appear in php bin/moko list (already works)
  • Dispatch includes plugin type context
## Problem bin/moko's loadPluginCommands() (lines 316-364) discovers plugin commands via getCommands() and displays them in the help listing, but never actually routes them for execution. When a user runs a plugin-provided command, bin/moko returns "Unknown command" because only COMMAND_MAP entries are dispatched (line 200). ## Related - #148 (feat: plugin CLI commands - populate getCommands()) - Currently no plugins override getCommands() — they all return empty arrays ## Proposal 1. After COMMAND_MAP lookup fails, check plugin commands 2. If a plugin command matches, resolve its script path and dispatch 3. Pass plugin context (project type, config) to the dispatched script ## Acceptance Criteria - [ ] Plugin-provided commands are executable via bin/moko - [ ] Plugin commands appear in php bin/moko list (already works) - [ ] Dispatch includes plugin type context
jmiller added the buildpriority: high labels 2026-05-31 14:20:39 +00:00
Author
Owner

Branch created: feature/236-fix-cli-plugin-commands-listed-but-never

git fetch origin
git checkout feature/236-fix-cli-plugin-commands-listed-but-never
Branch created: [`feature/236-fix-cli-plugin-commands-listed-but-never`](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/src/branch/feature/236-fix-cli-plugin-commands-listed-but-never) ```bash git fetch origin git checkout feature/236-fix-cli-plugin-commands-listed-but-never ```
Author
Owner

Plugin command dispatch implemented in bin/moko. After COMMAND_MAP lookup fails, loadPluginCommands() is called as fallback. Plugin commands with a script field are now routable.

Plugin command dispatch implemented in `bin/moko`. After COMMAND_MAP lookup fails, `loadPluginCommands()` is called as fallback. Plugin commands with a `script` field are now routable.
Sign in to join this conversation.
No labels build priority: high
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/moko-platform#236