| File: Commands\McpInitCommand.cs | Web Access |
| Project: src\src\Aspire.Cli\Aspire.Cli.csproj (aspire) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; using Aspire.Cli.Agents; using Aspire.Cli.Agents.AspireSkills; using Aspire.Cli.Agents.Playwright; using Aspire.Cli.Git; using Aspire.Cli.Projects; using Aspire.Cli.Resources; namespace Aspire.Cli.Commands; /// <summary> /// Legacy command 'aspire mcp init' that delegates to the new AgentInitCommand. /// This is kept for backward compatibility but is hidden from help. /// </summary> internal sealed class McpInitCommand : BaseCommand { private readonly AgentInitCommand _agentInitCommand; public McpInitCommand( IAgentEnvironmentDetector agentEnvironmentDetector, IAspireSkillsInstaller aspireSkillsInstaller, PlaywrightCliInstaller playwrightCliInstaller, IGitRepository gitRepository, ILanguageDiscovery languageDiscovery, Aspire.Cli.Agents.Hooks.ITelemetryHookConfigurator telemetryHookConfigurator, CommonCommandServices services) : base("init", McpCommandStrings.InitCommand_Description, services) { // Create the AgentInitCommand to delegate execution to _agentInitCommand = new AgentInitCommand( agentEnvironmentDetector, aspireSkillsInstaller, playwrightCliInstaller, gitRepository, languageDiscovery, telemetryHookConfigurator, services); } protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken) { // Display deprecation warning InteractionService.DisplayMarkupLine($"[yellow]⚠ {McpCommandStrings.DeprecatedCommandWarning}[/]"); InteractionService.DisplayEmptyLine(); // Delegate to the new AgentInitCommand return await _agentInitCommand.ExecuteCommandAsync(parseResult, cancellationToken); } }