@@ -33,33 +33,37 @@ class ClientRegistry:
3333 # Client configuration manager for system-wide client settings
3434 _client_config_manager = ClientConfigManager ()
3535
36- # Dictionary mapping client keys to manager instances
36+ # Dictionary mapping client keys to manager classes
3737 _CLIENT_MANAGERS = {
38- "claude-code" : ClaudeCodeManager () ,
39- "claude-desktop" : ClaudeDesktopManager () ,
40- "windsurf" : WindsurfManager () ,
41- "cursor" : CursorManager () ,
42- "cline" : ClineManager () ,
43- "continue" : ContinueManager () ,
44- "goose-cli" : GooseClientManager () ,
45- "5ire" : FiveireManager () ,
46- "roo-code" : RooCodeManager () ,
47- "trae" : TraeManager () ,
48- "vscode" : VSCodeManager () ,
38+ "claude-code" : ClaudeCodeManager ,
39+ "claude-desktop" : ClaudeDesktopManager ,
40+ "windsurf" : WindsurfManager ,
41+ "cursor" : CursorManager ,
42+ "cline" : ClineManager ,
43+ "continue" : ContinueManager ,
44+ "goose-cli" : GooseClientManager ,
45+ "5ire" : FiveireManager ,
46+ "roo-code" : RooCodeManager ,
47+ "trae" : TraeManager ,
48+ "vscode" : VSCodeManager ,
4949 }
5050
5151 @classmethod
52- def get_client_manager (cls , client_name : str ) -> Optional [BaseClientManager ]:
52+ def get_client_manager (cls , client_name : str , config_path_override : Optional [ str ] = None ) -> Optional [BaseClientManager ]:
5353 """
5454 Get the client manager for a given client name
5555
5656 Args:
5757 client_name: Name of the client
58+ config_path_override: Optional path to override the default config file location
5859
5960 Returns:
6061 BaseClientManager: Client manager instance or None if not found
6162 """
62- return cls ._CLIENT_MANAGERS .get (client_name )
63+ manager_class = cls ._CLIENT_MANAGERS .get (client_name )
64+ if manager_class :
65+ return manager_class (config_path_override = config_path_override )
66+ return None
6367
6468 @classmethod
6569 def get_all_client_managers (cls ) -> Dict [str , BaseClientManager ]:
@@ -69,7 +73,7 @@ def get_all_client_managers(cls) -> Dict[str, BaseClientManager]:
6973 Returns:
7074 Dict[str, BaseClientManager]: Dictionary mapping client names to manager instances
7175 """
72- return cls ._CLIENT_MANAGERS
76+ return { name : manager () for name , manager in cls ._CLIENT_MANAGERS . items ()}
7377
7478 @classmethod
7579 def detect_installed_clients (cls ) -> Dict [str , bool ]:
@@ -79,7 +83,7 @@ def detect_installed_clients(cls) -> Dict[str, bool]:
7983 Returns:
8084 Dict[str, bool]: Dictionary mapping client names to installed status
8185 """
82- return {client_name : manager .is_client_installed () for client_name , manager in cls ._CLIENT_MANAGERS .items ()}
86+ return {client_name : manager () .is_client_installed () for client_name , manager in cls ._CLIENT_MANAGERS .items ()}
8387
8488 @classmethod
8589 def get_client_info (cls , client_name : str ) -> Dict [str , str ]:
@@ -105,7 +109,7 @@ def get_all_client_info(cls) -> Dict[str, Dict[str, str]]:
105109 Returns:
106110 Dict[str, Dict[str, str]]: Dictionary mapping client names to display information
107111 """
108- return {client_name : manager .get_client_info () for client_name , manager in cls ._CLIENT_MANAGERS .items ()}
112+ return {client_name : manager () .get_client_info () for client_name , manager in cls ._CLIENT_MANAGERS .items ()}
109113
110114 @classmethod
111115 def get_active_client (cls ) -> str | None :
0 commit comments