@@ -174,8 +174,10 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
174174 )
175175 console .print (" [green]✓[/green] Git repository found" )
176176
177- # Step 2: Detect or validate platform
177+ # Step 2: Detect or validate platform(s)
178178 detector = PlatformDetector (project_path )
179+ platforms_to_add : list [str ] = []
180+ detected_adapters : list [AgentAdapter ] = []
179181
180182 if platform_name :
181183 # User specified platform - check if it's available
@@ -192,10 +194,11 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
192194 )
193195
194196 console .print (f" [green]✓[/green] { adapter .display_name } detected" )
195- platform_to_add = adapter .name
197+ platforms_to_add = [adapter .name ]
198+ detected_adapters = [adapter ]
196199 else :
197- # Auto-detect platform
198- console .print ("[yellow]→[/yellow] Auto-detecting AI platform ..." )
200+ # Auto-detect all available platforms
201+ console .print ("[yellow]→[/yellow] Auto-detecting AI platforms ..." )
199202 available_adapters = detector .detect_all_platforms ()
200203
201204 if not available_adapters :
@@ -209,17 +212,11 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
209212 "Please set up one of these platforms first, or use --platform to specify."
210213 )
211214
212- if len (available_adapters ) > 1 :
213- # Multiple platforms - ask user to specify
214- platform_names = ", " .join (a .display_name for a in available_adapters )
215- raise InstallError (
216- f"Multiple AI platforms detected: { platform_names } \n "
217- "Please specify which platform to use with --platform option."
218- )
219-
220- adapter = available_adapters [0 ]
221- console .print (f" [green]✓[/green] { adapter .display_name } detected" )
222- platform_to_add = adapter .name
215+ # Add all detected platforms
216+ for adapter in available_adapters :
217+ console .print (f" [green]✓[/green] { adapter .display_name } detected" )
218+ platforms_to_add .append (adapter .name )
219+ detected_adapters = available_adapters
223220
224221 # Step 3: Create .deepwork/ directory structure
225222 console .print ("[yellow]→[/yellow] Creating DeepWork directory structure..." )
@@ -256,12 +253,16 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
256253 if "platforms" not in config_data :
257254 config_data ["platforms" ] = []
258255
259- # Add platform if not already present
260- if platform_to_add not in config_data ["platforms" ]:
261- config_data ["platforms" ].append (platform_to_add )
262- console .print (f" [green]✓[/green] Added { adapter .display_name } to platforms" )
263- else :
264- console .print (f" [dim]•[/dim] { adapter .display_name } already configured" )
256+ # Add each platform if not already present
257+ added_platforms : list [str ] = []
258+ for i , platform in enumerate (platforms_to_add ):
259+ adapter = detected_adapters [i ]
260+ if platform not in config_data ["platforms" ]:
261+ config_data ["platforms" ].append (platform )
262+ added_platforms .append (adapter .display_name )
263+ console .print (f" [green]✓[/green] Added { adapter .display_name } to platforms" )
264+ else :
265+ console .print (f" [dim]•[/dim] { adapter .display_name } already configured" )
265266
266267 save_yaml (config_file , config_data )
267268 console .print (f" [green]✓[/green] Updated { config_file .relative_to (project_path )} " )
@@ -280,8 +281,9 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
280281
281282 # Success message
282283 console .print ()
284+ platform_names = ", " .join (a .display_name for a in detected_adapters )
283285 console .print (
284- f"[bold green]✓ DeepWork installed successfully for { adapter . display_name } ![/bold green]"
286+ f"[bold green]✓ DeepWork installed successfully for { platform_names } ![/bold green]"
285287 )
286288 console .print ()
287289 console .print ("[bold]Next steps:[/bold]" )
0 commit comments