Spectre.Console.Extensions.Hosting
Spectre Console CommandApp for Microsoft.Extensions.Hosting
Install / Use
/learn @juro-org/Spectre.Console.Extensions.HostingREADME
Spectre.Console.Extensions.Hosting
Adds Spectre.Console CommandApp extensions for Microsoft.Extensions.Hosting.
Table of Contents
Install
Install the Spectre.Console.Extensions.Hosting NuGet package into your app.
Install-Package Spectre.Console.Extensions.Hosting
Usage
After the installation you can use the extension UseSpectreConsole for IHostBuilder.
For this you must configure the SpectreConsole CommandApp in your application`s Program.cs file:
public static async Task<int> Main(string[] args)
{
await Host.CreateDefaultBuilder(args)
.UseConsoleLifetime()
.UseSpectreConsole<DefaultCommand>()
.ConfigureServices(
(_, services) => { services.AddSingleton<IGreeter, HelloWorldGreeter>(); })
.RunConsoleAsync();
return Environment.ExitCode;
}
It is also possible to customize the command configurations:
Host.CreateDefaultBuilder(args)
...
.UseSpectreConsole(config =>
{
config.AddCommand<AddCommand>("add");
config.AddCommand<CommitCommand>("commit");
config.AddCommand<RebaseCommand>("rebase");
#if DEBUG
config.PropagateExceptions();
config.ValidateExamples();
#endif
})
...
Examples
Examples are located in the samples folder. It is planned to further adopt CLI examples from Spectre.Console.
Maintainer
Jürgen Rosenthal-Buroh @JuergenRB
Contributing
pectre.Console.Extensions.Hosting follows the Contributor Covenant Code of Conduct.
We accept Pull Requests.
Small note: If editing the Readme, please conform to the standard-readme specification.
License
Related Skills
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
47PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
snap-vis-manager
The planning agent for the snap-vis project. Coordinates other specialized agents and manages the overall project roadmap.
devplan-mcp-server
3MCP server for generating development plans, project roadmaps, and task breakdowns for Claude Code. Turn project ideas into paint-by-numbers implementation plans.
