SpectreHelpers is a collection of helper extensions for Spectre.Console that simplify common console application patterns, especially progress tracking with multiple concurrent tasks.
Install via NuGet:
dotnet add package 130Widgets.SpectreHelpers
For C# scripts (dotnet run app.cs):
#:package 130Widgets.SpectreHelpers@[1.0.0, 2.0.0)
The helpers make it easy to add and run multiple progress tasks in parallel:
using Spectre.Console;
await AnsiConsole.Progress()
.AddTask("Task 1", async progressTask =>
{
progressTask.Increment(10);
await Task.Delay(500);
})
.AddTask("Task 2", async progressTask =>
{
while (!progressTask.IsFinished)
{
await Task.Delay(250);
progressTask.Increment(10);
}
})
.StartAsync();This project is licensed under the MIT License. See the LICENSE file for details.