You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Display overlay routing (§5.13) — LazyModuleGroup now reads metadata["display"]["cli"] for alias and description when building the command list and routing get_command(). Commands are exposed under their CLI alias instead of raw module_id.
_alias_map: built from metadata["display"]["cli"]["alias"] (with module_id fallback), enabling apcore-cli alias-name invocation.
_descriptor_cache: populated during alias map build to avoid double registry.get_definition() calls in get_command().
_alias_map_built flag only set on successful build, allowing retry after transient registry errors.
Display overlay in JSON output — format_module_list(..., "json") now reads metadata["display"]["cli"] for id, description, and tags, consistent with the table output branch.
Changed
_ERROR_CODE_MAP.get(error_code, 1): guarded with isinstance(error_code, str) to prevent None-key lookup.
Runtime companion: apcore-toolkit >= 0.4.0 enables DisplayResolver and ConventionScanner (graceful fallback when not installed).
Tests
TestDisplayOverlayAliasRouting (6 tests): list_commands uses CLI alias, get_command by alias, cache hit path, module_id fallback, build_module_command alias and description.
test_format_list_json_falls_back_to_scanner_when_no_overlay: JSON output falls back to scanner values.
Added (Grouped Commands — FE-09)
GroupedModuleGroup(LazyModuleGroup) — organizes modules into nested click.Group subcommands based on namespace prefixes. Auto-groups by first . segment, with display.cli.group override from binding.yaml.
_resolve_group() — 3-tier group resolution: explicit display.cli.group > first . segment of CLI alias > top-level.
_build_group_map() — lazy, idempotent group map builder with builtin collision detection and shell-safe group name validation.
format_help() — collapsed root help with Commands, Modules, and Groups sections (with command counts).
_LazyGroup(click.Group) — nested group that lazily builds subcommands from module descriptors.
list --flat flag — opt-in flat display mode for list command; default is now grouped display.
format_grouped_module_list() — Rich table output grouped by namespace.
apcore-cli init module <id> — scaffolding command with --style (decorator, convention, binding) and --description options. Generates module templates in the appropriate directory.
--commands-dir CLI option — path to a convention commands directory. When set, ConventionScanner from apcore-toolkit scans for plain functions and registers them as modules.
Tests (Convention Module Discovery)
6 new tests in tests/test_init_cmd.py covering all three styles and options.