From 73ca8ef20f243977a1a104aa72ec79c5496fa029 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Tue, 7 Apr 2026 21:28:32 +0200 Subject: [PATCH] Report list of setup commands upon init, change setup handler names --- src/serena/cli.py | 13 +++++++++++++ src/serena/config/client_setup.py | 12 ++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/serena/cli.py b/src/serena/cli.py index 90ea178b..6e297cac 100644 --- a/src/serena/cli.py +++ b/src/serena/cli.py @@ -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 diff --git a/src/serena/config/client_setup.py b/src/serena/config/client_setup.py index c76f321e..ba0fc23d 100644 --- a/src/serena/config/client_setup.py +++ b/src/serena/config/client_setup.py @@ -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()]