Spectre.Console.Cli Documentation

Build powerful command-line applications with Spectre.Console.Cli

Welcome to the Spectre.Console.Cli documentation! Spectre.Console.Cli is a modern framework for building command-line applications in .NET with a focus on type safety and developer experience.

What is Spectre.Console.Cli?

Spectre.Console.Cli is a command-line parsing library that helps you build CLI applications with:

  • Type-Safe Commands: Strongly-typed command definitions with compile-time checking
  • Automatic Help Generation: Beautiful, consistent help text generated from your code
  • Command Hierarchies: Support for complex command structures with subcommands
  • Dependency Injection: Built-in support for DI containers
  • Validation: Input validation with custom error messages
  • Convention over Configuration: Sensible defaults that follow CLI best practices

Installation

Install Spectre.Console.Cli via NuGet:

dotnet add package Spectre.Console.Cli

Getting Started

Tutorials

New to Spectre.Console.Cli? Start here:

How-To Guides

Practical guides for specific tasks:

Reference

API documentation and quick lookups:

Explanation

Concepts and design decisions: