Repository navigation
cli: subcommand plugin seam (modelith.commands entry-point group) - #59
Merged
Merged
Conversation
Track 1a of the enterprise plugin architecture: lets a separately-installed package (the paid modelith-enterprise) add top-level `mdl` subcommands — e.g. `mdl ci` — with ZERO edits to the open CLI. One-way dependency: core never imports the plugin. - mdl_cli/plugins.py: load_command_plugins(app) discovers the 'modelith.commands' entry-point group and calls each plugin's register(app) against the root Typer app. Mirrors the config-resolver seam (mdl_reverse.remote_config): fail-soft (a broken or incompatible plugin is swallowed with a debug log, never bricks the free CLI) and idempotent (discovery runs once per process). - main(): run the loader after the built-in commands are declared (import time) and before the app is invoked, so a plugin sees — and may override — the built-ins. - pyproject.toml: declare the 'modelith.commands' group (shipping none) beside the existing 'modelith.config_resolvers', with the same 'example in a separate enterprise package' comment. Verified end to end with a throwaway installed plugin: 'mdl --help' shows the new command and it runs; uninstalling it cleanly removes the command and the CLI is unaffected (covenant: one-way). Tests cover a valid plugin appearing, a broken register swallowed, a failed load swallowed, the no-plugin normal case, once-per-process discovery, and the real CLI still starting with the seam wired. Full suite 1014 passed.
dbose
added a commit
that referenced
this pull request
Oct 18, 2026
0.7.1 -> 0.7.2. Ships the modelith.commands entry-point seam (PR #59): an installed package can add 'mdl' subcommands with no core edits. Minor-worthy new seam, but grouped here as a patch with the lock fix per the current cadence. Also fixes a release-hygiene miss: the 0.7.1 release bumped pyproject but did not re-run uv lock, leaving uv.lock pinned at 0.7.0. Re-locked so pyproject and uv.lock agree at 0.7.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the modelith.commands entry-point seam so an installed package (e.g. paid modelith-enterprise) can register new mdl subcommands with zero core edits — fail-soft, one-way dependency, verified end-to-end; 6 tests, full suite 1014 passed..