Skip to content

cli: subcommand plugin seam (modelith.commands entry-point group) - #59

Merged
dbose merged 1 commit into
mainfrom
feat-cli-command-seam
Oct 18, 2026
Merged

dbose merged 1 commit into
mainfrom
feat-cli-command-seam

Conversation

@dbose

@dbose dbose commented Oct 18, 2026

Copy link
Copy Markdown
Owner

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..

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
dbose merged commit 01e8e31 into main Oct 18, 2026
2 checks 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.
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