feat(cli): let external packages add nooa subcommands via entry points - #62
Merged
Conversation
sklinglernv
marked this pull request as ready for review
July 30, 2026 14:43
furgalep
reviewed
Jul 30, 2026
`nooa_cli.commands` discovered commands by scanning only its own directory,
so nothing outside this repo could add a `nooa` subcommand. Packages that
wanted to extend the CLI had to ship standalone console scripts instead,
changing the command name for every user.
Split `discover_commands()` into the existing built-in scan plus a new pass
over the `nooa_cli.commands` entry-point group, mirroring the existing
`nooa.skills` and `nooa.bundled_configs` groups:
[project.entry-points."nooa_cli.commands"]
tui = "my_package.cli.tui:command"
Built-ins are yielded first and win name collisions, so a third party cannot
shadow `eval` or `config`; each name is yielded exactly once. Every plugin
failure — broken distribution metadata, an entry point that fails to import,
or one resolving to a non-`click.Command` — is logged at WARNING and skipped,
since these are arbitrary third-party imports and must never make `nooa`
unusable. The built-in scan deliberately keeps raising `TypeError`: that is a
bug in this repo and should be loud. Plugins are sorted by entry-point name so
`nooa --help` does not depend on install order.
Two test-collection fixes were needed to make the new tests actually run:
`testpaths` pointed at `packages/nooa-cli/tests/{cli,integration}`, neither of
which exists, so nothing under `packages/nooa-cli/tests` was ever collected in
CI. Replacing both with the parent directory exposed a latent collision — the
empty `packages/nooa-cli/tests/__init__.py` made it a package named `tests`,
shadowing the root `tests` package that other modules import from. It is
unnecessary under the repo's `--import-mode=importlib`, and
`packages/nooa-bench/tests` already ships without one.
Signed-off-by: Severin Klingler <sklingler@nvidia.com>
sklinglernv
force-pushed
the
fix-cli-subcommands
branch
from
July 30, 2026 15:05
05683a8 to
7302a1f
Compare
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.
Adds a
nooa_cli.commandsentry-point group so packages outside this repo can contributenooasubcommands, instead of shipping standalone console scripts.discover_commands()is now the existing built-in scan plus an entry-point pass. Built-ins are yielded first and win name collisions; each name is yielded once. Plugin failures (broken metadata, failing import, non-click.Command) are logged and skipped — the built-in scan still raises, since that's a bug in this repo. Plugins are sorted by entry-point name so--helpdoesn't depend on install order.Mirrors the existing
nooa.skillsandnooa.bundled_configsgroups.Also included
The new tests wouldn't have run:
testpathspointed atpackages/nooa-cli/tests/{cli,integration}, neither of which exists, so nothing underpackages/nooa-cli/testswas collected in CI —test_cli_smoke.pyincluded. Pointing it at the parent exposed a collision: the emptypackages/nooa-cli/tests/__init__.pymade that a package namedtests, shadowing the roottestspackage. Deleted it;packages/nooa-bench/testsalready ships without one.Verification
11 new tests. Full suite 6385 passed / 5 skipped; ruff clean;
nooa --helpunchanged.🤖 Generated with Claude Code