Open
Description
The IInteractionService
that is currently used by CLI commands for prompting and output display is currently internal. While #9807 covers making the prompt-related APIs public, this issue overs making the APIs related to output streaming public. Something like the following:
public interface IOutputInteractionService
{
void DisplayMessage(string emoji, string message);
void DisplaySuccess(string message);
void DisplayError(string errorMessage);
void DisplaySubtleMessage(string message);
void DisplayLines(IEnumerable<(string Stream, string Line)> lines);
}
The implementors can resolve the service from the DI container and use it to stream outputs:
public Task DeployAsync(DeployingContext context)
{
var outputService = context.ServiceProvider.GetService<IOutputInteractionService>();
outputService.DisplaySuccess("Successfully deployed to FooBar");
}