NikiforovAll / cli-with-spectre-console

An example CLI application based on Spectre.Console

Home Page:https://nikiforovall.github.io/dotnet/2022/01/22/building-console-application-with-spectre-console.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.NET Bots Gallery with Spectre.Console

Spectre.Console provides application model to bind args[] to git-style commands.

var app = new CommandApp();

app.Configure(c =>
{
    c.AddCommand<ExportBots>("scrape");
    c.AddCommand<ListBots>("list");
    c.AddCommand<DownloadBot>("download")
        .WithExample(new[] {"download", "--random"});
});

await app.RunAsync(args);

Demo

dotnet run -- -h

help

dotnet run -- scrape

list

dotnet run -- list

โž•๐ŸŽ‰ https://www.nuget.org/packages/Spectre.Console.Extensions.Table

list

dotnet run -- download

โž•๐ŸŽ‰ https://www.nuget.org/packages/Spectre.Console.Extensions.Progress

download

Reference

About

An example CLI application based on Spectre.Console

https://nikiforovall.github.io/dotnet/2022/01/22/building-console-application-with-spectre-console.html


Languages

Language:C# 90.4%Language:Dockerfile 9.6%