Skip to content

Commit 27f6702

Browse files
authored
Merge pull request #12 from zhujian0805/main
feat: implement plugin conflict resolution and marketplace:plugin naming
2 parents 0b8bc0d + 2bbb230 commit 27f6702

File tree

6 files changed

+521
-26
lines changed

6 files changed

+521
-26
lines changed

code_assistant_manager/cli/plugins/plugin_discovery_commands.py

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _display_marketplace_footer(info, marketplace: str, total: int, limit: int)
9393
)
9494

9595
typer.echo(
96-
f"\n{Colors.CYAN}Install with:{Colors.RESET} cam plugin install <plugin-name>@{marketplace}"
96+
f"\n{Colors.CYAN}Install with:{Colors.RESET} cam plugin install <marketplace>:<plugin-name>"
9797
)
9898
typer.echo()
9999

@@ -343,7 +343,7 @@ def browse_marketplace(
343343
def view_plugin(
344344
plugin: str = typer.Argument(
345345
...,
346-
help="Plugin name to view (e.g., 'document-skills' or 'document-skills@anthropic-agent-skills')",
346+
help="Plugin name to view (e.g., 'document-skills' or 'awesome-plugins:document-skills')",
347347
),
348348
app_type: str = typer.Option(
349349
"claude",
@@ -356,7 +356,7 @@ def view_plugin(
356356
357357
Shows the plugin description, version, category, and source marketplace.
358358
You can specify just the plugin name or include the marketplace name
359-
with the @ format (e.g., 'plugin-name@marketplace').
359+
with the : format (e.g., 'marketplace:plugin-name').
360360
"""
361361
from code_assistant_manager.cli.option_utils import resolve_single_app
362362
from code_assistant_manager.plugins.fetch import fetch_repo_info
@@ -365,10 +365,14 @@ def view_plugin(
365365
manager = PluginManager()
366366

367367
# Parse plugin name and marketplace if provided
368-
parts = plugin.split("@")
368+
parts = plugin.split(":")
369369
plugin_name = parts[0]
370370
marketplace_filter = parts[1] if len(parts) > 1 else None
371371

372+
# Support legacy @ syntax for backward compatibility
373+
if "@" in plugin_name and not marketplace_filter:
374+
plugin_name, marketplace_filter = plugin_name.split("@", 1)
375+
372376
all_repos = manager.get_all_repos()
373377
if not all_repos:
374378
typer.echo(f"{Colors.YELLOW}No plugin repositories configured{Colors.RESET}")
@@ -457,7 +461,7 @@ def view_plugin(
457461

458462
typer.echo()
459463
typer.echo(
460-
f"{Colors.CYAN}Install:{Colors.RESET} cam plugin install {plugin_name}@{found_marketplace}"
464+
f"{Colors.CYAN}Install:{Colors.RESET} cam plugin install {found_marketplace}:{plugin_name}"
461465
)
462466
typer.echo()
463467

@@ -615,8 +619,14 @@ def show_app_info(app: str, show_cam_config: bool = True):
615619
if enabled_plugins:
616620
typer.echo(f"\n {Colors.GREEN}Enabled:{Colors.RESET}")
617621
for plugin_key in sorted(enabled_plugins.keys()):
618-
# Parse plugin key (format: plugin-name@marketplace or just plugin-name)
619-
if "@" in plugin_key:
622+
# Parse plugin key (format: marketplace:plugin-name or plugin-name)
623+
if ":" in plugin_key:
624+
marketplace, plugin_name = plugin_key.split(":", 1)
625+
typer.echo(
626+
f" {Colors.GREEN}{Colors.RESET} {plugin_name} ({marketplace})"
627+
)
628+
elif "@" in plugin_key:
629+
# Legacy @ syntax support
620630
plugin_name, marketplace = plugin_key.split("@", 1)
621631
typer.echo(
622632
f" {Colors.GREEN}{Colors.RESET} {plugin_name} ({marketplace})"
@@ -627,7 +637,14 @@ def show_app_info(app: str, show_cam_config: bool = True):
627637
if disabled_plugins:
628638
typer.echo(f"\n {Colors.RED}Disabled:{Colors.RESET}")
629639
for plugin_key in sorted(disabled_plugins.keys()):
630-
if "@" in plugin_key:
640+
# Parse plugin key (format: marketplace:plugin-name or plugin-name)
641+
if ":" in plugin_key:
642+
marketplace, plugin_name = plugin_key.split(":", 1)
643+
typer.echo(
644+
f" {Colors.RED}{Colors.RESET} {plugin_name} ({marketplace})"
645+
)
646+
elif "@" in plugin_key:
647+
# Legacy @ syntax support
631648
plugin_name, marketplace = plugin_key.split("@", 1)
632649
typer.echo(
633650
f" {Colors.RED}{Colors.RESET} {plugin_name} ({marketplace})"
@@ -791,8 +808,14 @@ def show_app_info(app: str, show_cam_config: bool = True):
791808
if enabled_plugins:
792809
typer.echo(f"\n {Colors.GREEN}Enabled:{Colors.RESET}")
793810
for plugin_key in sorted(enabled_plugins.keys()):
794-
# Parse plugin key (format: plugin-name@marketplace or just plugin-name)
795-
if "@" in plugin_key:
811+
# Parse plugin key (format: marketplace:plugin-name or plugin-name)
812+
if ":" in plugin_key:
813+
marketplace, plugin_name = plugin_key.split(":", 1)
814+
typer.echo(
815+
f" {Colors.GREEN}{Colors.RESET} {plugin_name} ({marketplace})"
816+
)
817+
elif "@" in plugin_key:
818+
# Legacy @ syntax support
796819
plugin_name, marketplace = plugin_key.split("@", 1)
797820
typer.echo(
798821
f" {Colors.GREEN}{Colors.RESET} {plugin_name} ({marketplace})"
@@ -803,7 +826,14 @@ def show_app_info(app: str, show_cam_config: bool = True):
803826
if disabled_plugins:
804827
typer.echo(f"\n {Colors.RED}Disabled:{Colors.RESET}")
805828
for plugin_key in sorted(disabled_plugins.keys()):
806-
if "@" in plugin_key:
829+
# Parse plugin key (format: marketplace:plugin-name or plugin-name)
830+
if ":" in plugin_key:
831+
marketplace, plugin_name = plugin_key.split(":", 1)
832+
typer.echo(
833+
f" {Colors.RED}{Colors.RESET} {plugin_name} ({marketplace})"
834+
)
835+
elif "@" in plugin_key:
836+
# Legacy @ syntax support
807837
plugin_name, marketplace = plugin_key.split("@", 1)
808838
typer.echo(
809839
f" {Colors.RED}{Colors.RESET} {plugin_name} ({marketplace})"

0 commit comments

Comments
 (0)