Skip to content

Add tool, distribution, and extension management commands for Morphir CLI#5

Merged
DamianReeves merged 4 commits intomainfrom
copilot/add-morphir-management-tools
Dec 23, 2025
Merged

Add tool, distribution, and extension management commands for Morphir CLI#5
DamianReeves merged 4 commits intomainfrom
copilot/add-morphir-management-tools

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 23, 2025

Implements complete package management for the Morphir CLI (addressing morphir-dotnet #296), enabling NPM-like management of tools, distributions, and extensions with native Rust performance.

Changes

New Commands

Tool Management

  • morphir tool install <name> [--version] - Install tools with version pinning
  • morphir tool list - Display installed tools in formatted table
  • morphir tool update <name> [--version] - Update tools to specified or latest version
  • morphir tool uninstall <name> - Remove tools from registry

Distribution Management

  • morphir dist install <name> [--version] - Install Morphir distributions
  • morphir dist list - Display installed distributions in formatted table
  • morphir dist update <name> [--version] - Update distributions to specified or latest version
  • morphir dist uninstall <name> - Remove distributions from registry

Extension Management

  • morphir extension install <name> [--version] - Install Morphir extensions
  • morphir extension list - Display installed extensions in formatted table
  • morphir extension update <name> [--version] - Update extensions to specified or latest version
  • morphir extension uninstall <name> - Remove extensions from registry

Implementation

  • Tool registry persisted at ~/.morphir/tools.json using serde JSON serialization
  • Distribution registry persisted at ~/.morphir/distributions.json
  • Extension registry persisted at ~/.morphir/extensions.json
  • New commands/tool.rs module with ToolRegistry and ToolInfo structs
  • New commands/dist.rs module with DistRegistry and DistInfo structs
  • New commands/extension.rs module with ExtensionRegistry and ExtensionInfo structs
  • Version handling via Option<String> with DEFAULT_VERSION constant for flexibility
  • Integrated into main CLI using clap subcommands and starbase AppSession
  • All three command groups follow consistent patterns for reliability and ease of use

Dependencies Added

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
dirs = "6.0"

Example Usage

# Install and manage tools
$ morphir tool install morphir-scala --version 3.0.0
✓ Successfully installed tool 'morphir-scala' (version: 3.0.0)

$ morphir tool list
Tool Name            Version         Description
----------------------------------------------------------------------
morphir-scala        3.0.0           Morphir tool: morphir-scala
morphir-go           latest          Morphir tool: morphir-go

Total: 2 tool(s) installed

# Install and manage distributions
$ morphir dist install morphir-jvm-dist --version 2.5.0
✓ Successfully installed distribution 'morphir-jvm-dist' (version: 2.5.0)

$ morphir dist list
Distribution         Version         Description
----------------------------------------------------------------------
morphir-jvm-dist     2.5.0           Morphir distribution: morphir-jvm-dist

Total: 1 distribution(s) installed

# Install and manage extensions
$ morphir extension install scala-backend --version 1.8.0
✓ Successfully installed extension 'scala-backend' (version: 1.8.0)

$ morphir extension list
Extension            Version         Description
----------------------------------------------------------------------
scala-backend        1.8.0           Morphir extension: scala-backend

Total: 1 extension(s) installed
Original prompt

This section details on the original issue you should resolve

<issue_title>Create tools for managing morphir distributions, tools, and extensions.</issue_title>
<issue_description>The github issue found here: finos/morphir-dotnet#296 speaks to managing morphir distribution, tools, and extensions in the morphir-dotnet repo. We have decided that we would like the native speed of Rust and would like to implement the equivalent functionality for the morphir CLI offered by the morphir rust toolchain.
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 23, 2025 21:27
- Add tool install, list, update, and uninstall commands
- Create ToolRegistry for persisting tool information
- Store tool registry in ~/.morphir/tools.json
- Update README with tool management documentation

Co-authored-by: DamianReeves <957246+DamianReeves@users.noreply.github.com>
- Add DEFAULT_VERSION constant for version management
- Change version field to Option<String> for consistency
- Update all version handling to use the constant

Co-authored-by: DamianReeves <957246+DamianReeves@users.noreply.github.com>
Copilot AI changed the title [WIP] Create tools for managing morphir distributions and extensions Add tool management commands for Morphir CLI Dec 23, 2025
Copilot AI requested a review from DamianReeves December 23, 2025 21:36
@DamianReeves
Copy link
Copy Markdown
Member

@copilot What about the other commands

@DamianReeves
Copy link
Copy Markdown
Member

@copilot you only implemented the tool commands what about the dist and extension commands

- Implement morphir dist install/list/update/uninstall commands
- Implement morphir extension install/list/update/uninstall commands
- Add DistRegistry stored in ~/.morphir/distributions.json
- Add ExtensionRegistry stored in ~/.morphir/extensions.json
- Update README with dist and extension command documentation
- All commands follow same pattern as tool commands

Co-authored-by: DamianReeves <957246+DamianReeves@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Dec 23, 2025

@copilot you only implemented the tool commands what about the dist and extension commands

I've now implemented both dist and extension management commands in commit 5cfc929.

The CLI now provides three complete command groups:

Tool Management:

  • morphir tool install/list/update/uninstall
  • Registry: ~/.morphir/tools.json

Distribution Management:

  • morphir dist install/list/update/uninstall
  • Registry: ~/.morphir/distributions.json

Extension Management:

  • morphir extension install/list/update/uninstall
  • Registry: ~/.morphir/extensions.json

All three follow the same consistent pattern with version pinning, formatted output, and proper error handling.

Copilot AI changed the title Add tool management commands for Morphir CLI Add tool, distribution, and extension management commands for Morphir CLI Dec 23, 2025
@DamianReeves DamianReeves marked this pull request as ready for review December 23, 2025 22:41
@DamianReeves DamianReeves merged commit 8af55e6 into main Dec 23, 2025
1 check passed
@DamianReeves DamianReeves deleted the copilot/add-morphir-management-tools branch December 23, 2025 22:45
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.

Create tools for managing morphir distributions, tools, and extensions.

2 participants