Skip to content

Commit e80aaeb

Browse files
iamaeroplaneclaude
andcommitted
fix(cli): count aliases in removal confirmation command count (#2017)
The "N commands from AI agent" line in the removal confirmation was derived from len(manifest.commands) which counts command entries, not registered names. Extensions with aliases therefore showed the wrong count (e.g. 1 instead of 2 for a command with one alias). Use the registry's registered_commands dict instead — summing actual registered names across all agents — so the count reflects what will actually be removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c870cb8 commit e80aaeb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/specify_cli/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3123,9 +3123,13 @@ def extension_remove(
31233123
extension_id, display_name = _resolve_installed_extension(extension, installed, "remove")
31243124

31253125
# Get extension info for command and skill counts
3126-
ext_manifest = manager.get_extension(extension_id)
3127-
cmd_count = len(ext_manifest.commands) if ext_manifest else 0
31283126
reg_meta = manager.registry.get(extension_id)
3127+
# Count total registered commands across all agents (includes aliases)
3128+
registered_commands = reg_meta.get("registered_commands", {}) if reg_meta else {}
3129+
cmd_count = sum(
3130+
len(names) for names in registered_commands.values()
3131+
if isinstance(names, list)
3132+
)
31293133
raw_skills = reg_meta.get("registered_skills") if reg_meta else None
31303134
skill_count = len(raw_skills) if isinstance(raw_skills, list) else 0
31313135

0 commit comments

Comments
 (0)