Report list of setup commands upon init, change setup handler names

This commit is contained in:
Dominik Jain committed 2026-04-07 21:28:32 +02:00
1 parent 4f7cd88950
commit 73ca8ef20f
2 files changed
+21 -4

No files matched your search

+13
View File
@@ -175,6 +175,19 @@ class TopLevelCommands(AutoRegisteringGroup):
serena_config.save()
click.echo(f"Configuration file: {serena_config.config_file_path}")
click.echo(f"Language backend: {language_backend}")
# check for auto-configurable clients
applicable_setup_handlers = []
for setup_handler in client_setup_handlers:
if setup_handler.is_applicable():
applicable_setup_handlers.append(setup_handler)
if len(applicable_setup_handlers) > 0:
click.echo(
"\nAuto-configurable clients detected.\nApply the following commands to configure the Serena MCP server (in a default configuration):"
)
for setup_handler in applicable_setup_handlers:
click.echo(f" serena setup {setup_handler.name}")
click.echo("\nSerena has been initialised successfully.\n")
@staticmethod
+8 -4
View File
@@ -29,7 +29,7 @@ class ClientSetupHandler(ABC):
class ClientSetupHandlerClaudeCode(ClientSetupHandler):
def __init__(self) -> None:
super().__init__("ClaudeCode")
super().__init__("claude-code")
def is_applicable(self) -> bool:
result = execute_shell_command("claude --version")
@@ -43,9 +43,13 @@ class ClientSetupHandlerClaudeCode(ClientSetupHandler):
return result.return_code == 0
class ClientSetupHandlerCodexCLI(ClientSetupHandler):
class ClientSetupHandlerCodex(ClientSetupHandler):
"""
Setup for Codex CLI and Codex App (shared config)
"""
def __init__(self) -> None:
super().__init__("CodexCLI")
super().__init__("codex")
def is_applicable(self) -> bool:
result = execute_shell_command("codex --version")
@@ -59,4 +63,4 @@ class ClientSetupHandlerCodexCLI(ClientSetupHandler):
return result.return_code == 0
client_setup_handlers = [ClientSetupHandlerClaudeCode(), ClientSetupHandlerCodexCLI()]
client_setup_handlers = [ClientSetupHandlerClaudeCode(), ClientSetupHandlerCodex()]