@@ -216,8 +216,10 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
216216 )
217217 console .print (" [green]✓[/green] Git repository found" )
218218
219- # Step 2: Detect or validate platform
219+ # Step 2: Detect or validate platform(s)
220220 detector = PlatformDetector (project_path )
221+ platforms_to_add : list [str ] = []
222+ detected_adapters : list [AgentAdapter ] = []
221223
222224 if platform_name :
223225 # User specified platform - check if it's available
@@ -234,10 +236,11 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
234236 )
235237
236238 console .print (f" [green]✓[/green] { adapter .display_name } detected" )
237- platform_to_add = adapter .name
239+ platforms_to_add = [adapter .name ]
240+ detected_adapters = [adapter ]
238241 else :
239- # Auto-detect platform
240- console .print ("[yellow]→[/yellow] Auto-detecting AI platform ..." )
242+ # Auto-detect all available platforms
243+ console .print ("[yellow]→[/yellow] Auto-detecting AI platforms ..." )
241244 available_adapters = detector .detect_all_platforms ()
242245
243246 if not available_adapters :
@@ -251,17 +254,11 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
251254 "Please set up one of these platforms first, or use --platform to specify."
252255 )
253256
254- if len (available_adapters ) > 1 :
255- # Multiple platforms - ask user to specify
256- platform_names = ", " .join (a .display_name for a in available_adapters )
257- raise InstallError (
258- f"Multiple AI platforms detected: { platform_names } \n "
259- "Please specify which platform to use with --platform option."
260- )
261-
262- adapter = available_adapters [0 ]
263- console .print (f" [green]✓[/green] { adapter .display_name } detected" )
264- platform_to_add = adapter .name
257+ # Add all detected platforms
258+ for adapter in available_adapters :
259+ console .print (f" [green]✓[/green] { adapter .display_name } detected" )
260+ platforms_to_add .append (adapter .name )
261+ detected_adapters = available_adapters
265262
266263 # Step 3: Create .deepwork/ directory structure
267264 console .print ("[yellow]→[/yellow] Creating DeepWork directory structure..." )
@@ -304,12 +301,16 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
304301 if "platforms" not in config_data :
305302 config_data ["platforms" ] = []
306303
307- # Add platform if not already present
308- if platform_to_add not in config_data ["platforms" ]:
309- config_data ["platforms" ].append (platform_to_add )
310- console .print (f" [green]✓[/green] Added { adapter .display_name } to platforms" )
311- else :
312- console .print (f" [dim]•[/dim] { adapter .display_name } already configured" )
304+ # Add each platform if not already present
305+ added_platforms : list [str ] = []
306+ for i , platform in enumerate (platforms_to_add ):
307+ adapter = detected_adapters [i ]
308+ if platform not in config_data ["platforms" ]:
309+ config_data ["platforms" ].append (platform )
310+ added_platforms .append (adapter .display_name )
311+ console .print (f" [green]✓[/green] Added { adapter .display_name } to platforms" )
312+ else :
313+ console .print (f" [dim]•[/dim] { adapter .display_name } already configured" )
313314
314315 save_yaml (config_file , config_data )
315316 console .print (f" [green]✓[/green] Updated { config_file .relative_to (project_path )} " )
@@ -328,8 +329,9 @@ def _install_deepwork(platform_name: str | None, project_path: Path) -> None:
328329
329330 # Success message
330331 console .print ()
332+ platform_names = ", " .join (a .display_name for a in detected_adapters )
331333 console .print (
332- f"[bold green]✓ DeepWork installed successfully for { adapter . display_name } ![/bold green]"
334+ f"[bold green]✓ DeepWork installed successfully for { platform_names } ![/bold green]"
333335 )
334336 console .print ()
335337 console .print ("[bold]Next steps:[/bold]" )
0 commit comments