Commands\AddCommand.cs (18)
122InteractionService.DisplayError(AddCommandStrings.SourceWithCredentialsNotSupported);
133InteractionService.DisplaySourceTrustWarning(ExecutionContext);
159if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, Telemetry, cancellationToken: cancellationToken))
210var result = await InteractionService.ShowStatusAsync(
224var result = await InteractionService.ShowStatusAsync(
243InteractionService.DisplayNuGetSearchLimitWarning();
246InteractionService.DisplayNuGetSearchFailureWarnings(failedSources);
292InteractionService.DisplaySubtleMessage(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PolyglotIntegrationsHidden, hiddenIntegrationCount));
365InteractionService.DisplayError(AddCommandStrings.SourceWithCredentialsNotSupported);
406InteractionService.DisplayMessage(KnownEmojis.Package, Aspire.Cli.Resources.TemplatingStrings.NuGetConfigCreatedOrUpdatedConfirmationMessage);
469InteractionService.DisplayMessage(KnownEmojis.Information, AddCommandStrings.StoppedRunningInstance);
479success = await InteractionService.ShowStatusAsync(
494InteractionService.DisplayLines(outputCollector.GetLines());
499InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version));
506return HandleProjectLocatorException(ex, InteractionService, Telemetry);
523InteractionService.DisplayLines(outputCollector.GetLines());
743var allVersions = await InteractionService.ShowStatusAsync(
833InteractionService.DisplaySubtleMessage(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.NoPackagesMatchedSearchTerm, searchTerm));
Commands\AgentInitCommand.cs (40)
284> 1 when _hostEnvironment.SupportsInteractiveInput => await InteractionService.PromptForSelectionAsync(
306var workspaceRootPath = await InteractionService.PromptForFilePathAsync(
346InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AgentCommandStrings.InitCommand_InvalidEnvironments,
361var detectedEnvironments = await InteractionService.ShowStatusAsync(
375selectedClients = await InteractionService.PromptForSelectionsAsync(
389InteractionService.DisplaySubtleMessage(AgentCommandStrings.InitCommand_NoConfigurationSelected);
450InteractionService.DisplayMessage(KnownEmojis.Information, AgentCommandStrings.InitCommand_SkillSourcesExplanation);
451InteractionService.DisplaySourceDetails(sourceDetails);
452if (InteractionService.DisplaySourceTrustWarning(ExecutionContext))
454InteractionService.DisplayEmptyLine();
464var selectedSkillNames = await InteractionService.PromptForSelectionsAsync(
482InteractionService.DisplayError(skillConfigurationError);
495configureMcp = await InteractionService.PromptConfirmAsync(
511InteractionService.DisplaySubtleMessage(AgentCommandStrings.InitCommand_NoConfigurationSelected);
517scope = await InteractionService.PromptForSelectionAsync(
562InteractionService.DisplayMessage(KnownEmojis.FileFolder, removedSkillCopies.Count == 1
572InteractionService.DisplayError(failure);
624InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, AgentCommandStrings.InitCommand_InstalledPlaywrightCli);
627InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, message!);
630InteractionService.DisplayError(message!);
635InteractionService.DisplaySubtleMessage(AgentCommandStrings.InitCommand_PlaywrightCliSkipped);
646InteractionService.DisplayError(ex.Message);
650InteractionService.DisplayEmptyLine();
700InteractionService.DisplayMessage(emoji, message);
710InteractionService.DisplayError(ex.Message);
713InteractionService.DisplaySubtleMessage(
742InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, AgentCommandStrings.ConfigurationCompletedWithErrors);
746InteractionService.DisplaySuccess(McpCommandStrings.InitCommand_ConfigurationComplete);
875InteractionService.DisplaySubtleMessage(ex.Message);
885InteractionService.DisplayMessage(
903InteractionService.DisplaySubtleMessage(message);
1002InteractionService.DisplayError(
1040InteractionService.DisplayMessage(KnownEmojis.Robot, message, allowMarkup: true);
1041InteractionService.DisplayEmptyLine();
1063InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AgentCommandStrings.InitCommand_FailedTarget,
1065InteractionService.DisplayEmptyLine();
1076InteractionService.DisplayMessage(KnownEmojis.Robot, message);
1123InteractionService.DisplayMessage(KnownEmojis.FileFolder, string.Join(Environment.NewLine,
1168=> InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, string.Join(Environment.NewLine,
1200return await InteractionService.PromptConfirmAsync(prompt, removeSkillCopiesBinding, cancellationToken);
Commands\BaseCommand.cs (12)
77InteractionService.DisplayCancellationMessage(CancellationMessage, consoleOverride);
95InteractionService.Console = ConsoleOutput.Error;
105await FlushExtensionInteractionServiceAsync(InteractionService).ConfigureAwait(false);
137InteractionService.DisplayError(miscasedOptionError);
197ConfigSourceService.DisplayGitOutput(InteractionService, ex.GitOutput);
203MarkupHelpers.SafeLink(InteractionService, readmeUrl));
232&& ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _)
242InteractionService.DisplayError(result.ErrorMessage, allowMarkup: result.ErrorMessageHasMarkup);
261InteractionService.DisplayMessage(
263string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.SeeLogsAt, MarkupHelpers.SafeFileLink(InteractionService, _executionContext.LogFilePath)),
271InteractionService.DisplayMessage(
273string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.SeeAppHostLogsAt, MarkupHelpers.SafeFileLink(InteractionService, ExecutionContext.AppHostCliLogFilePath)),
Commands\ConfigCommand.cs (45)
50var subcommand = await InteractionService.PromptForSelectionAsync(
89var key = await InteractionService.PromptForStringAsync(ConfigCommandStrings.GetCommand_PromptForKey, required: true, cancellationToken: cancellationToken);
99InteractionService.DisplayPlainText(value);
104InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
154var key = await InteractionService.PromptForStringAsync(ConfigCommandStrings.SetCommand_PromptForKey, required: true, cancellationToken: cancellationToken);
155var value = await InteractionService.PromptForStringAsync(ConfigCommandStrings.SetCommand_PromptForValue, required: true, cancellationToken: cancellationToken);
156var isGlobal = await InteractionService.PromptForSelectionAsync(
171InteractionService.DisplayError(feature.Description);
176InteractionService.DisplayError(ErrorStrings.LegacyAppHostPathCannotBeSetWithConfigCommand);
182InteractionService.DisplayError(ErrorStrings.GlobalAppHostPathCannotBeSetWithConfigCommand);
189InteractionService.DisplaySuccess(isGlobal
199InteractionService.DisplayError(ex.Message);
206InteractionService.DisplayError(errorMessage);
238if (InteractionService is ExtensionInteractionService extensionInteractionService)
256InteractionService.DisplayMessage(KnownEmojis.Information, ConfigCommandStrings.NoConfigurationValuesFound);
261InteractionService.DisplayMarkupLine($" [dim]{ConfigCommandStrings.ListCommand_AllFeaturesHint.EscapeMarkup()}[/]");
281InteractionService.DisplayEmptyLine();
305InteractionService.DisplayEmptyLine();
306InteractionService.DisplayMarkdown($"**{ConfigCommandStrings.AvailableFeaturesHeader}:**");
313InteractionService.DisplayMarkupLine($" [cyan]{feature.Name.EscapeMarkup()}[/] [dim](default: {defaultText})[/]");
314InteractionService.DisplayMarkupLine($" [dim]{feature.Description.EscapeMarkup()}[/]");
316InteractionService.DisplayEmptyLine();
317InteractionService.DisplayMarkupLine($" [dim]{ConfigCommandStrings.SetFeatureHint.EscapeMarkup()}[/]");
321InteractionService.DisplayMarkupLine($" [dim]{ConfigCommandStrings.ListCommand_AllFeaturesHint.EscapeMarkup()}[/]");
360InteractionService.DisplayRenderable(table);
397var key = await InteractionService.PromptForStringAsync(ConfigCommandStrings.DeleteCommand_PromptForKey, required: true, cancellationToken: cancellationToken);
402InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
406var isGlobal = await InteractionService.PromptForSelectionAsync(
425InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedGlobally, key));
429InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedLocally, key));
436InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
444InteractionService.DisplayError(errorMessage);
493if (InteractionService is ConsoleInteractionService consoleService)
500InteractionService.DisplayPlainText(json);
505InteractionService.DisplayMarkdown($"**{ConfigCommandStrings.InfoCommand_LocalSettingsPath}:**");
506InteractionService.DisplayPlainText($" {localPath}");
507InteractionService.DisplayEmptyLine();
508InteractionService.DisplayMarkdown($"**{ConfigCommandStrings.InfoCommand_GlobalSettingsPath}:**");
509InteractionService.DisplayPlainText($" {globalPath}");
510InteractionService.DisplayEmptyLine();
511InteractionService.DisplayMarkdown($"**{ConfigCommandStrings.InfoCommand_AvailableFeatures}:**");
514InteractionService.DisplayMarkupLine($" [cyan]{feature.Name.EscapeMarkup()}[/] - {feature.Description.EscapeMarkup()} [dim](default: {feature.DefaultValue})[/]");
516InteractionService.DisplayEmptyLine();
517InteractionService.DisplayMarkdown($"**{ConfigCommandStrings.InfoCommand_SettingsProperties}:**");
521InteractionService.DisplayMarkupLine($" {requiredText}[cyan]{property.Name.EscapeMarkup()}[/] ([yellow]{property.Type.EscapeMarkup()}[/]) - {property.Description.EscapeMarkup()}");
Commands\DescribeCommand.cs (11)
174return CommandResult.FromExitCode(AppHostConnectionResultHandler.DisplayFailureAsInformation(result, InteractionService));
219AppHostFollowDisconnectHelpers.WriteStatusMessage(InteractionService, connection);
243InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, DescribeCommandStrings.ResourceNotFound, resourceName));
259InteractionService.DisplayRawText(diagram, ConsoleOutput.Standard);
267InteractionService.DisplayRawText(json, ConsoleOutput.Standard);
319InteractionService.DisplayRawText(json, ConsoleOutput.Standard);
381InteractionService.DisplayMessage(KnownEmojis.Information, "No resources found.");
412nameMarkup = MarkupHelpers.SafeLink(InteractionService, resourceUrl, displayName);
422InteractionService.DisplayRenderable(table);
444InteractionService.DisplayMarkupLine($"{ColorResourceName(state.DisplayName, $"[[{state.DisplayName.EscapeMarkup()}]]")} {stateText}{healthText}{endpointsStr}");
488? MarkupHelpers.SafeLink(InteractionService, url, text)
Commands\ExportCommand.cs (10)
104_connectionResolver, InteractionService, _httpClientFactory, _logger, passedAppHostProjectFile, dashboardUrl, apiKey, requireDashboard: false, cancellationToken);
113InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, ExportCommandStrings.DashboardNotAvailable);
124TelemetryCommandHelpers.DisplayTelemetryError(InteractionService, errorInfo);
150var (telemetryResources, allSnapshots) = await InteractionService.ShowStatusAsync(ExportCommandStrings.GatheringResources, async () =>
169InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ExportCommandStrings.ResourceNotFound, resourceName));
175InteractionService.DisplayMessage(KnownEmojis.Information, ExportCommandStrings.NoResourcesFound);
200await InteractionService.ShowStatusAsync(ExportCommandStrings.GatheringConsoleLogs, async () =>
210await InteractionService.ShowStatusAsync(ExportCommandStrings.GatheringStructuredLogs, async () =>
217await InteractionService.ShowStatusAsync(ExportCommandStrings.GatheringTraces, async () =>
227InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, string.Format(CultureInfo.CurrentCulture, ExportCommandStrings.ExportComplete, fullPath));
Commands\InitCommand.cs (26)
213InteractionService,
229InteractionService.DisplayEmptyLine();
230InteractionService.DisplayMessage(
235InteractionService.DisplayEmptyLine();
239InteractionService.DisplaySubtleMessage($" {command}");
258InteractionService.DisplayMessage(
352InteractionService.DisplayMessage(KnownEmojis.Package, TemplatingStrings.NuGetConfigCreatedOrUpdatedConfirmationMessage);
358InteractionService.DisplayMessage(KnownEmojis.Information, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FileAlreadyExistsSkipping, "apphost.cs"));
374InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.CreatedFile, "apphost.cs"));
445InteractionService.DisplayMessage(KnownEmojis.Package, TemplatingStrings.NuGetConfigCreatedOrUpdatedConfirmationMessage);
450InteractionService.DisplayMessage(KnownEmojis.Information, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FileAlreadyExistsSkipping, $"{appHostDirName}/"));
490InteractionService.DisplayError(ex.Message);
495InteractionService.DisplayError(ex.Message);
504InteractionService.DisplayError(ex.Message);
521InteractionService.DisplayLines(installOutcome.OutputLines);
522InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.TemplateInstallationFailed, installOutcome.ExitCode));
528var result = await InteractionService.ShowStatusAsync(
543InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FailedToCreateAppHostFromTemplate, result));
547InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.CreatedFile, $"{appHostDirName}/"));
562InteractionService.DisplayMessage(KnownEmojis.Information, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FileAlreadyExistsSkipping, existingAppHostFileName));
570InteractionService.DisplayMessage(KnownEmojis.Information, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FileAlreadyExistsSkipping, displayPath));
599InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.CreatedFile, displayPath));
625InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FailedToParseExistingConfig, AspireConfigFile.FileName, configPath, ex.Message));
626InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FixOrRemoveConfigAndRerun, AspireConfigFile.FileName));
721InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.CreatedFile, AspireConfigFile.FileName));
916InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.CreatedFile, fileName));
Commands\IntegrationSearchCommand.cs (13)
88var result = await InteractionService.ShowStatusAsync(
98var result = await InteractionService.ShowStatusAsync(
108InteractionService.DisplayNuGetSearchLimitWarning();
111InteractionService.DisplayNuGetSearchFailureWarnings(failedSources);
142InteractionService.DisplaySubtleMessage(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PolyglotIntegrationsHidden, hiddenIntegrationCount));
150return HandleProjectLocatorException(ex, InteractionService, Telemetry);
191InteractionService.DisplayRawText(json, ConsoleOutput.Standard);
202InteractionService.DisplayError(AddCommandStrings.NoPolyglotCompatibleIntegrationsFound);
206InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.NoIntegrationPackagesMatchedSearchTerm, searchTerm));
210InteractionService.DisplayError(AddCommandStrings.NoPackagesFound);
218InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.FoundIntegrationPackagesMatchingSearchTerm, results.Length, searchTerm));
222InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.FoundIntegrationPackages, results.Length));
238InteractionService.DisplayRenderable(table);
Commands\PipelineCommandBase.cs (31)
187if (ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _)
229var startDebugSession = ExtensionHelper.IsExtensionHost(InteractionService, out _, out _) && parseResult.GetValue(RootCommand.StartDebugSessionOption);
316InteractionService.DisplayMessage(KnownEmojis.Bug, InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost);
319var backchannel = await InteractionService.ShowStatusAsync(GetProgressMessage(parseResult), (Func<Task<IAppHostCliBackchannel>>)(async () =>
338&& ExtensionHelper.IsExtensionHost(InteractionService, out _, out _))
370InteractionService.DisplayRawText(json, ConsoleOutput.Standard);
417InteractionService.DisplayLines(outputCollector.GetLines());
450return HandleProjectLocatorException(ex, InteractionService, Telemetry);
477InteractionService.DisplayError(errorMessage);
480InteractionService.DisplayLines(outputCollector.GetLines());
490InteractionService.DisplayError(errorMessage);
493InteractionService.DisplayLines(outputCollector.GetLines());
503InteractionService.DisplayError(errorMessage);
506InteractionService.DisplayLines(outputCollector.GetLines());
806InteractionService.DisplaySubtleMessage($"[[DEBUG]] Step {stepCounter++}: {statusText}", allowMarkup: true);
815InteractionService.DisplaySubtleMessage($"[[DEBUG]] Step {activity.Data.Id}: {status} - {statusText}", allowMarkup: true);
837InteractionService.DisplaySubtleMessage(formattedMessage, allowMarkup: true);
848InteractionService.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {status} - {statusText}", allowMarkup: true);
852InteractionService.DisplaySubtleMessage($"[[DEBUG]] {completionMessage}", allowMarkup: true);
858InteractionService.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {statusText}", allowMarkup: true);
870InteractionService.DisplaySubtleMessage($"[[DEBUG]] {OperationCompletedPrefix}: {status} - {statusText}", allowMarkup: true);
1206InteractionService.DisplayError(error);
1212InputType.Text => await InteractionService.PromptForStringAsync(
1218InputType.SecretText => await InteractionService.PromptForStringAsync(
1227InputType.Boolean => (await InteractionService.PromptConfirmAsync(promptText, binding: PromptBinding.CreateDefault(ParseBooleanValue(input.Value)), cancellationToken: cancellationToken)).ToString().ToLowerInvariant(),
1243return await InteractionService.PromptForStringAsync(promptText, binding: PromptBinding.CreateDefault(input.Value), required: input.Required, cancellationToken: cancellationToken);
1257var (value, displayText) = await InteractionService.PromptForSelectionAsync(
1265return await InteractionService.PromptForStringAsync(promptText, binding: PromptBinding.CreateDefault(input.Value), required: input.Required, cancellationToken: cancellationToken);
1285return await InteractionService.PromptForStringAsync(
1358var value = await InteractionService.PromptForFilePathAsync(
1375var singleValue = await InteractionService.PromptForFilePathAsync(
Commands\RenderCommand.cs (67)
129InteractionService.DisplayEmptyLine();
132var choice = await InteractionService.PromptForSelectionAsync(
204InteractionService.DisplayError($"Unknown render scenario '{choice}'.");
205InteractionService.DisplayPlainText("Use 'aspire render --list-scenarios' to see supported values.");
219InteractionService.DisplayPlainText($"{choice.Key}: {choice.Value}");
222InteractionService.DisplayEmptyLine();
226InteractionService.DisplayPlainText($"{scenario.Key}: {scenario.Value}");
234InteractionService.DisplayMessage(emoji, $"DisplayMessage with {emoji.Name}");
237InteractionService.DisplayEmptyLine();
238InteractionService.DisplayMessage(KnownEmojis.Rocket, "This is a much longer message that is designed to test how text wraps when the terminal window is narrow. It should wrap cleanly beneath the text column without pushing content under the emoji icon on the left side of the display.");
239InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, "Successfully deployed the application to the remote environment. The deployment included 14 services, 3 databases, and 2 message brokers. All health checks passed and the application is now accepting traffic on the configured endpoints.");
240InteractionService.DisplayError("Something went terribly wrong while attempting to connect to the remote application host. The connection timed out after 30 seconds. Please verify that the host is running and that the network configuration allows traffic on the specified port.");
247InteractionService.DisplayError("This is an error message.");
248InteractionService.DisplaySuccess("Operation completed successfully.");
249InteractionService.DisplaySubtleMessage("This is a subtle hint.");
250InteractionService.DisplayCancellationMessage();
252InteractionService.DisplayEmptyLine();
253InteractionService.DisplayError("Failed to resolve package 'Aspire.Hosting.Azure.CosmosDB' version 9.2.0. The package source 'https://api.nuget.org/v3/index.json' returned a 503 Service Unavailable response. Please check your network connection and try again, or configure an alternative package source in your NuGet.config file.");
254InteractionService.DisplaySuccess("All 47 integration tests passed successfully across 2 target frameworks (net10.0, net11.0). Total execution time: 2 minutes and 14 seconds. Code coverage increased from 78.3% to 82.1%.");
262await InteractionService.ShowStatusAsync(
277await InteractionService.ShowStatusAsync(
292await InteractionService.ShowStatusAsync(
316var selected = await InteractionService.PromptForSelectionAsync(
329var selected = await InteractionService.PromptForSelectionAsync(
335InteractionService.DisplayMessage(KnownEmojis.Rocket, $"Deploying to {selected}...");
341InteractionService.DisplayMessage(KnownEmojis.Rocket, "Starting mixed methods test...");
342InteractionService.DisplayEmptyLine();
344InteractionService.DisplaySuccess("Step 1 complete!");
345InteractionService.DisplaySubtleMessage("This is a subtle hint.");
346InteractionService.DisplayMessage(KnownEmojis.MagnifyingGlassTiltedLeft, "Searching for [packages]...");
347InteractionService.DisplayEmptyLine();
349InteractionService.DisplayMarkupLine("[bold green]Bold green markup[/] and [dim]dim text[/]");
350InteractionService.DisplayPlainText("Plain text with [brackets] that should appear literally.");
351InteractionService.DisplayEmptyLine();
353await InteractionService.ShowStatusAsync(
362InteractionService.ShowStatus(
367InteractionService.DisplayEmptyLine();
369var name = await InteractionService.PromptForStringAsync(
374InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, $"You entered: {name}");
376var confirmed = await InteractionService.PromptConfirmAsync(
383InteractionService.DisplaySuccess("Confirmed!");
387InteractionService.DisplayError("Cancelled.");
390InteractionService.DisplayEmptyLine();
391InteractionService.DisplayMessage(KnownEmojis.StopSign, "Mixed methods test complete.");
407InteractionService.DisplayMessage(KnownEmojis.Information, "This demo fires background log messages while a prompt is active.");
408InteractionService.DisplayMessage(KnownEmojis.Information, "Logs are buffered and flushed after the prompt completes.");
409InteractionService.DisplayEmptyLine();
427var answer = await InteractionService.PromptForStringAsync(
436InteractionService.DisplayEmptyLine();
437InteractionService.DisplaySuccess($"You entered: {answer}");
438InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, "Buffered log lines should appear above this message.");
448InteractionService.DisplaySubtleMessage($"Temporary file created at {filePath}", allowMarkup: false);
450InteractionService.DisplayPlainText($"Supports links: {InteractionService.SupportsLinks}");
451InteractionService.DisplayMarkupLine($"SafeLink: {MarkupHelpers.SafeLink(InteractionService, "https://www.aspire.dev/", "Aspire documentation")}");
452InteractionService.DisplayMarkupLine($"SafeFileLink: {MarkupHelpers.SafeFileLink(InteractionService, filePath)}");
463return InteractionService.DisplayIncompatibleVersionError(ex, ex.AspireHostingVersion ?? ex.RequiredCapability);
471InteractionService.DisplayPlainText($"=== {scenario.Title} ===");
579InteractionService.DisplayEmptyLine();
580InteractionService.DisplaySubtleMessage($"ProcessPublishingActivitiesDebugAsync returned succeeded={succeeded}", allowMarkup: false);
589InteractionService.DisplayEmptyLine();
590InteractionService.DisplaySubtleMessage($"ProcessAndDisplayPublishingActivitiesAsync returned succeeded={succeeded}", allowMarkup: false);
846InteractionService.DisplayMarkdown(MarkdownShowcase);
853InteractionService.DisplayRawText(plainText);
870InteractionService.DisplayRawText(writer.ToString());
Commands\RunCommand.cs (25)
182var isExtensionHost = ExtensionHelper.IsExtensionHost(InteractionService, out _, out _);
211if (!AppHostStartupTimeout.TryGetTimeoutSeconds(_configuration, InteractionService, out var timeoutSeconds))
228&& ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _)
354InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, RunCommandStrings.IsolatedModeRunningInstanceWarning);
447InteractionService.DisplayLines(outputCollector.GetLines());
459InteractionService.DisplayMessage(KnownEmojis.Bug, InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost);
494InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, RunCommandStrings.DashboardFailedToStart);
500InteractionService,
507if (ExtensionHelper.IsExtensionHost(InteractionService, out var extInteractionService, out _))
540var showCtrlC = !ExtensionHelper.IsExtensionHost(InteractionService, out _, out _);
544return new Markup($"[bold]{resource.EscapeMarkup()}[/] [grey]has endpoint[/] {MarkupHelpers.SafeLink(InteractionService, endpoint)}");
616await InteractionService.DisplayLiveAsync(
631InteractionService.DisplayRenderable(BuildStaticEndpointRenderable(resource, endpoint, isFirstEndpoint));
653InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, "No longer receiving logs from AppHost.");
716return HandleProjectLocatorException(ex, InteractionService, Telemetry);
722return CommandResult.FromExitCode(InteractionService.DisplayIncompatibleVersionError(ex, ex.AspireHostingVersion ?? ex.RequiredCapability));
926DisplayRecentAppHostStartupOutput(InteractionService, outputCollector, appHostStartupOutputStartIndex);
954DisplayRecentAppHostStartupOutput(InteractionService, outputCollector, appHostStartupOutputStartIndex);
967DisplayRecentAppHostStartupOutput(InteractionService, outputCollector, appHostStartupOutputStartIndex);
976var resolution = await InteractionService.ShowStatusAsync(
1002backchannel = await InteractionService.ShowStatusAsync(
1016var pendingLogCapture = CaptureAppHostLogsAsync(_fileLoggerProvider, backchannel, InteractionService, logCaptureCancellationSource.Token);
1028dashboardUrls = await InteractionService.ShowStatusAsync(
1080if (ExtensionHelper.IsExtensionHost(InteractionService, out _, out _))
1085InteractionService.DisplayRenderable(BuildCtrlCRenderable(longestLocalizedLengthWithColon));
Commands\StopCommand.cs (25)
199InteractionService.DisplayError(appHostFile is null
207InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, StopCommandStrings.AmbiguousAppHostPid, processId));
237InteractionService.DisplayError(StopCommandStrings.CouldNotDetermineAppHostPath);
269InteractionService.DisplayError(errorMessage);
307InteractionService.DisplayMessage(KnownEmojis.Information, SharedCommandStrings.AppHostNotRunning);
311InteractionService.DisplayError(SharedCommandStrings.AppHostNotRunning);
320InteractionService.DisplayMessage(KnownEmojis.Information, SharedCommandStrings.AppHostNotRunning);
342InteractionService.DisplayError(string.Format(CultureInfo.InvariantCulture, StopCommandStrings.MultipleAppHostsNonInteractive, s_appHostOption.Name, s_allOption.Name));
367return new StopAppHostResult(AppHostConnectionResultHandler.DisplayFailureAsInformation(result, InteractionService), null);
405InteractionService.DisplayMessage(KnownEmojis.Information, string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.AppHostNotRunningAtPath, displayPath));
437var cleanupResult = await InteractionService.ShowStatusAsync(
442InteractionService.DisplayPlainText("");
446InteractionService.DisplayError(StopCommandStrings.DcpCleanupUnavailable);
453InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, StopCommandStrings.DcpCleanupFailed, appHostDisplayPath, details));
457InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, StopCommandStrings.PersistentResourcesCleaned, appHostDisplayPath));
476InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, StopCommandStrings.DcpCleanupCompatibilityCheckFailed);
482InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, StopCommandStrings.DcpCleanupCompatibilityCheckFailed);
507InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, string.Format(
555InteractionService.DisplayMessage(KnownEmojis.Information, SharedCommandStrings.AppHostNotRunning);
596InteractionService.DisplayMessage(KnownEmojis.Package, string.Format(CultureInfo.CurrentCulture, StopCommandStrings.FoundRunningAppHost, appHostIdentifier));
599InteractionService.DisplayMessage(KnownEmojis.StopSign, string.Format(CultureInfo.CurrentCulture, StopCommandStrings.SendingStopSignal, appHostIdentifier));
601var stopped = await InteractionService.ShowStatusAsync(
608InteractionService.DisplayPlainText("");
618InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, StopCommandStrings.AppHostStoppedSuccessfully, appHostIdentifier));
623InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, StopCommandStrings.FailedToStopAppHost, appHostIdentifier));
Commands\TelemetrySpansCommand.cs (9)
92_connectionResolver, InteractionService, _httpClientFactory, _logger, passedAppHostProjectFile, dashboardUrl, apiKey, requireDashboard: true, cancellationToken);
130InteractionService.DisplayError($"Resource '{resource}' not found.");
156TelemetryCommandHelpers.DisplayTelemetryError(InteractionService, errorInfo);
173InteractionService.DisplayRawText(SharedAIHelpers.SerializeSpansToJson(resourceSpans, getResourceName, dashboardUrl), ConsoleOutput.Standard);
191await foreach (var line in reader.ReadLinesWithDisconnectHandlingAsync(InteractionService, cancellationToken))
198InteractionService.DisplayRawText(SharedAIHelpers.SerializeSpansToJson(resourceSpans, getResourceName, dashboardUrl), ConsoleOutput.Standard);
216TelemetryCommandHelpers.DisplayNoData(InteractionService, "spans");
269var spanIdLink = TelemetryCommandHelpers.FormatTraceLink(InteractionService, dashboardUrl, traceId, shortSpanId, spanId: spanId);
274InteractionService.DisplayMarkupLine($"[grey]{timestamp}[/] [{statusColor}]{statusText}[/] [white]{durationStr,8}[/] [{resourceColor}]{resourceName.EscapeMarkup()}[/]: {escapedName} [grey]{spanIdLink}[/]");
Commands\TelemetryTracesCommand.cs (21)
90_connectionResolver, InteractionService, _httpClientFactory, _logger, passedAppHostProjectFile, dashboardUrl, apiKey, requireDashboard: true, cancellationToken);
112TelemetryCommandHelpers.DisplayTelemetryError(InteractionService, errorInfo);
145InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TelemetryCommandStrings.TraceNotFound, traceId));
162InteractionService.DisplayRawText("[]", ConsoleOutput.Standard);
167InteractionService.DisplayRawText(SharedAIHelpers.SerializeTraceToJson(trace, getResourceName, dashboardUrl), ConsoleOutput.Standard);
197InteractionService.DisplayError($"Resource '{resource}' not found.");
222InteractionService.DisplayRawText(SharedAIHelpers.SerializeTracesToJson(resourceSpans, getResourceName, dashboardUrl), ConsoleOutput.Standard);
239TelemetryCommandHelpers.DisplayNoData(InteractionService, "traces");
297var traceLink = TelemetryCommandHelpers.FormatTraceLink(InteractionService, dashboardUrl, info.TraceId, shortTraceId);
302InteractionService.DisplayRenderable(table);
303InteractionService.DisplayMarkupLine($"[grey]Showing {traceInfos.Count} of {response?.TotalCount ?? traceInfos.Count} traces[/]");
335var traceLink = TelemetryCommandHelpers.FormatTraceLink(InteractionService, dashboardUrl, traceId, shortTraceId);
339InteractionService.DisplayMarkupLine($"[bold]Trace:[/] {traceLink}");
340InteractionService.DisplayMarkupLine("[dim]No spans found[/]");
349InteractionService.DisplayMarkupLine($"[bold]Trace:[/] {traceLink}");
350InteractionService.DisplayMarkupLine($"[bold]Duration:[/] {TelemetryCommandHelpers.FormatDuration(totalDuration)} [bold]Spans:[/] {spans.Count}");
351InteractionService.DisplayEmptyLine();
395InteractionService.DisplayEmptyLine(); // Blank line between resources
398InteractionService.DisplayMarkupLine($"{indent}[bold {resourceColor}]{span.ResourceName.EscapeMarkup()}[/]");
411var spanIdLink = TelemetryCommandHelpers.FormatTraceLink(InteractionService, dashboardUrl, traceId, shortenedSpanId, spanId: span.SpanId);
420InteractionService.DisplayMarkupLine($"{indent}{connector} [dim]{spanIdLink}[/] {displayName} [{statusColor}]{statusText}[/] [dim]{durationStr}[/]");
Commands\UpdateCommand.cs (45)
248InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.DotNetToolSelfUpdateMessage);
249InteractionService.DisplayPlainText($" {dotNetToolUpdateCommand}");
259InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.NpmSelfUpdateMessage);
260InteractionService.DisplayPlainText($" {npmUpdateCommand}");
355var allChannels = await InteractionService.ShowStatusAsync(
392InteractionService.DisplayMessage(KnownEmojis.Information, string.Format(
447channel = await InteractionService.PromptForSelectionAsync(
524var shouldUpdateCli = await InteractionService.PromptConfirmAsync(
534InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.DotNetToolSelfUpdateMessage);
535InteractionService.DisplayPlainText($" {dotNetToolUpdateCommand}");
542InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.NpmSelfUpdateMessage);
543InteractionService.DisplayPlainText($" {npmUpdateCommand}");
576var shouldUpdateCli = await InteractionService.PromptConfirmAsync(
588return HandleProjectLocatorException(ex, InteractionService, Telemetry);
643InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.PendingMigrationsHeader);
646InteractionService.DisplaySubtleMessage($" - {descriptor.Title}");
649InteractionService.DisplaySubtleMessage(UpdateCommandStrings.PendingMigrationsHint);
657InteractionService.DisplaySubtleMessage(DotNetAppHostProject.UsesObsoleteAppHostSdk(projectFile)
663InteractionService.DisplayMessage(KnownEmojis.Gear, MigrationStrings.AvailableMigrationsHeader);
666InteractionService.DisplaySubtleMessage($" - {descriptor.Title}");
672var confirmed = await InteractionService.PromptConfirmAsync(
678InteractionService.DisplaySubtleMessage(MigrationStrings.MigrationCancelled);
697InteractionService.DisplayMessage(KnownEmojis.PoliceCarLight, UpdateCommandStrings.MigrationApplyFailedWarning);
769InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.ProjectUpdateSkippedAfterCliUpdateMessage);
773var shouldUpdateCli = await InteractionService.PromptConfirmAsync(
786InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.DotNetToolSelfUpdateMessage);
787InteractionService.DisplayPlainText($" {dotNetToolUpdateCommand}");
788InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.ProjectUpdateSkippedAfterCliUpdateMessage);
795InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.NpmSelfUpdateMessage);
796InteractionService.DisplayPlainText($" {npmUpdateCommand}");
797InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.ProjectUpdateSkippedAfterCliUpdateMessage);
804InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.ProjectUpdateSkippedAfterCliUpdateMessage);
848InteractionService.DisplayMessage(KnownEmojis.Information, UpdateCommandStrings.NixSelfUpdateMessage);
849InteractionService.DisplayPlainText(" nix profile upgrade aspire-cli");
850InteractionService.DisplayPlainText(" nix flake update <input-name>");
890InteractionService.DisplayError(
898channel = await InteractionService.PromptForSelectionAsync(
916InteractionService.DisplayMessage(KnownEmojis.Package, $"Current CLI location: {currentExePath}");
917InteractionService.DisplayMessage(KnownEmojis.UpButton, $"Updating to channel: {channel}");
964await InteractionService.ShowStatusAsync(
973InteractionService.DisplayMessage(KnownEmojis.Package, UpdateCommandStrings.ExtractedNewCli);
995InteractionService.DisplayMessage(KnownEmojis.FloppyDisk, "Backing up current CLI...");
1007InteractionService.DisplayMessage(KnownEmojis.Wrench, $"Installing new CLI to {installDir}...");
1031InteractionService.DisplayMessage(KnownEmojis.Information, $"Note: {installDir} is not in your PATH. Add it to use the updated CLI globally.");
1117InteractionService.DisplaySuccess($"Updated to version: {version}");
Commands\WaitCommand.cs (7)
92return CommandResult.FromExitCode(AppHostConnectionResultHandler.DisplayFailureAsError(result, InteractionService, CliExitCodes.FailedToFindProject));
113var exitCode = await InteractionService.ShowStatusAsync(
131InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.ResourceNotFound, resourceName));
137InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.WaitTimedOut, resourceName, statusLabel, timeoutSeconds));
142InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.ResourceEnteredFailedState, resourceName, response.State ?? response.ErrorMessage));
147InteractionService.DisplayPlainText("");
152InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.ResourceReachedTargetStatus, resourceName, statusLabel, elapsed.TotalSeconds));