Skip to content

Guide · Open source

How to use Spectre.Console: install and build styled .NET console output

Updated · written with AI from the project's own documentation and checked against our catalogue data

Spectre.Console is a .NET library for making command-line programs easier to read, with styled text, colors, tables, grids and panels. This guide is for C# and .NET developers who write terminal tools. By the end you will know how to add the package to a project and where to find the detailed documentation for building formatted console output.

Spectre.Consolespectreconsole/spectre.console · ★ 11.7k · MIT

Quick start

  1. 1Confirm the .NET SDK is installed. Spectre.Console is a C# library, so you need the .NET SDK. The README does not state a minimum version.
  2. 2Open your project directory. Move into the folder of the .NET project that will use the library.
  3. 3Add the NuGet package. Run dotnet add package Spectre.Console to reference the library in your project.
  4. 4Read the documentation. Open https://spectreconsole.net for detailed instructions on styled text, tables, grids and panels.
  5. 5Try the examples. Browse the examples repository at https://github.com/spectreconsole/examples to see working code.

What Spectre.Console does

Spectre.Console is a library, not a standalone program. You call it from your own C# code to format what your console application prints. The README describes it as a .NET library that makes it easier to create beautiful, cross platform, console applications.

It is heavily inspired by the Python library Rich, and its feature list includes tables, grids, panels and a Rich-inspired markup language.

  • Tables, grids and panels for structured terminal output
  • Markup language for styling text, inspired by Rich
  • Bold, dim, italic, underline, strikethrough and blinking text
  • 3/4/8/24-bit colors, with the library detecting terminal capabilities and downgrading colors as needed
  • Written with unit testing in mind

Install Spectre.Console with the NuGet package

The fastest way to get started is to install the NuGet package. You need the .NET SDK installed; the README does not state a required version, so check the project website for details.

Run the following command in the directory of your .NET project.

dotnet add package Spectre.Console

Write your first formatted output

Once the package is referenced, you can use the library from your C# code. The README does not include a code sample, so the detailed usage examples are on the project website at https://spectreconsole.net. The examples repository at https://github.com/spectreconsole/examples also shows the library in action.

Start with small pieces such as styled text or a single table, then add layout like panels and grids as your output grows.

Find the documentation and examples

Detailed instructions for using Spectre.Console are on the project website, https://spectreconsole.net. The project also maintains an examples repository, which the README links to as the place to see it in action.

The README also lists translations in Japanese, Brazilian Portuguese, Chinese, Farsi and Turkish.

  • Documentation: https://spectreconsole.net
  • Examples: https://github.com/spectreconsole/examples

Check whether it fits your project

The library suits C# or .NET developers writing command-line tools, developers who want formatted tables or panels, and teams building console apps that must run across operating systems. The README notes it was written with unit testing in mind.

It is not a good fit for people who do not write .NET code, or for projects that need a GUI or desktop window rather than a terminal interface.

What people use it for

  • Building a command-line tool that prints results as a formatted table
  • Showing grouped information in panels inside a terminal app
  • Writing console apps that display consistently on different operating systems
  • Adding colored, styled status text to long-running .NET command-line jobs

Frequently asked questions

Is Spectre.Console free to use?

Yes. The README states that Spectre.Console is provided as-is under the MIT license. The license file is named LICENSE in the repository.

How do I install Spectre.Console?

Run dotnet add package Spectre.Console in your .NET project directory. The README describes installing the NuGet package as the fastest way to get started.

What do I need to run Spectre.Console?

You need the .NET SDK. The README does not state which version is required, so check the project website for details.

Is Spectre.Console the same as Rich?

No. Spectre.Console is a .NET library that is heavily inspired by the Python library Rich. It brings a similar approach, including a Rich-inspired markup language, to C# console apps.

What are alternatives to Spectre.Console?

The project's comparable projects are Rich, Terminal.Gui and Colorful.Console. Terminal.Gui is a different kind of tool aimed at building terminal user interfaces, so consider the goal of your app when choosing.

Does Spectre.Console work across operating systems?

The README describes it as a library for creating cross platform console applications. It also says the library detects terminal capabilities and downgrades colors as needed.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Spectre.Console is a good choice for C# and .NET developers who want clearer, better-formatted terminal output with tables, panels and colored text. It is MIT-licensed and installs with a single NuGet command. Skip it if you do not write .NET code or if you need a graphical desktop interface rather than a terminal.

Install options & downloads