Skip to content

Wire the morphir extension sub-commands to their handlers #492

Open

Description

@DamianReeves

The morphir extension sub-commands are registered in src/Morphir.Tooling/Scenarios/ManagementScenario.cs, but they never call their handlers. Until 0.4.0-alpha.1 each one printed a stub message and exited 0. For example, install reported success without installing anything, and list always printed "No … installed". From 0.4.0-alpha.1 they fail with a "not implemented yet" error and a non-zero exit code, which links to this issue.

The handlers already exist in src/Morphir.Tooling/Features/Management/ExtensionHandlers.cs:

  • list, install <name>, use <name>, remove <name>, which <name> → ExtensionHandlers.HandleList/HandleInstall/HandleUse/HandleRemove/HandleWhich (no unit tests yet)

Scope

  • Wire each sub-command to its handler: resolve ArtifactPathResolver (and HttpClient for install) from the CLI's services, map the options (--platform, --local) and print the result.
  • Print human-readable results to stdout and send logs to stderr only. Add a --json option if it fits the other commands.
  • Serialize any JSON with a source-generated context. The standalone executables are trimmed, and reflection-based JSON fails there (see fix(release): run the deployment E2E tests, fail unimplemented commands, release as 0.4.0-alpha.1 #489).
  • Replace the "not implemented yet" error and its tests with real behavior.

Acceptance

  • Each sub-command calls its handler and returns the handler's success or failure as its exit code.
  • Unit tests for the handlers, plus CLI tests through CliTestHelper (tests/Morphir.Tooling.Tests).
  • E2E scenarios in tests/Morphir.E2E.Tests pass against the trimmed executable.

Related: #296 (closed, though the CLI was never wired), #297 (design), #302 (docs and tests), and #493 (archive extraction for install).

Activity

  1. DamianReeves commented on Nov 7, 2026

    @DamianReeves
    MemberAuthor

    Plan for this issue, from the Morphir extension model PRD (approved, landed in #501):

    • extension list — step 0, OpenSpec change add-extension-registry. It lists the extensions that each host knows (first the built-in C# and F# generators), with id, version, types, delivery and hosts, in text or --json. Implementation is starting now.
    • install, use, remove, which — PRD step 3. They will use the upstream content-addressed store, catalog and lock format under MORPHIR_HOME, plus per-level selection files and staged/ folders. The existing handlers in ExtensionHandlers.cs use a <platform>/<name>/<version> layout that the PRD does not keep, so they are not wired; the unused list handler is removed in step 0.

    Until step 3, install, use, remove and which keep failing with "not implemented yet" and a link to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliCLI related tasksenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions