Spectre.Console - Open Source Sponsorship

Khalid Abuhakmeh |

Open source remains an exceptional platform where talented individuals can come together and share their knowledge, passion, and code with others. We know firsthand the power that open-source packages can have on the .NET ecosystem, and we want to do our part in continuing the success of endeavors that help bring those opportunities to the community.

In our third sponsorship, the team at Duende has chosen Spectre.Console as the following open source recipient as part of our ongoing commitment to supporting projects that empower individuals, teams, and organizations.

We also have a word from the project maintainer, Patrik Svensson:

"I love working on open source because it’s more than just writing code. It’s about learning, sharing, and building something with the community. The support and collaboration make the effort worthwhile, and it’s inspiring to see companies like Duende Software sponsoring OSS and helping it thrive.”Patrik Svensson

Thank you, Patrik, you inspire us as well 🙂

Now let's see at what Spectre.Console is all about.

What is Spectre.Console?

The command-line interface (CLI) has seen a resurgence over the past decade as the necessary user interface for developer tooling. Spectre.Console is a .NET library that makes it easier to create beautiful console applications by giving you access to standard components you may find in a CLI experience. These components include colors, styles, tables, charts, and much more. In fact, you can look at the following example output and let your imagination run wild at the possibilities.

Spectre.Console feature overview

Getting Started with Spectre.Console

To get started using Spectre.Console, first install the following NuGet package in any .NET console-based application.

dotnet add package Spectre.Console

Next, paste the following code into the Program.cs of your console application.

using Spectre.Console;

AnsiConsole.MarkupLine("[red]Hello[/], [green]World![/]");

Running the application, you’ll now see the output of the Hello, World! text displaying in shades of red and green.

Spectre.Console "Hello World" example

Let’s also explore the Table element, which can help display tabular data. Replace the previous code with the following.

using Spectre.Console;

var table = new Table()
    .Title("Duende IdentityServer Licenses")
    .AddColumns("Name", "Client IDs", "Price")
    .AddRow("Starter", "5", "$1,500 USD/yr")
    .AddRow("Business", "15", "$9,000 USD/yr")
    .AddRow("Enterprise", "∞", "$20,000 USD/yr");

AnsiConsole.Write(table);

Running the application now, we can see our neatly formatted table output.

Spectre.Console components

At Duende, we use Spectre.Console to give us information about our web site by running a simple command. It helps aggregate site information in an easy-to-access location.

Spectre.Console at Duende

As you can see, the opportunities for building a world-class CLI experience are endless. To learn more about Spectre.Console, we recommend visiting the official documentation and trying out all the library's elements.

Sponsorship Details

To support the Spectre.Console team and their outstanding work, Duende Software is sponsoring Spectre.Console for the next 12 months at $250 per month (totaling $3000 for the year). This sponsorship will help the maintainers cover expenses and invest in the project’s growth and promotion.

If you benefit from Spectre.Console, consider supporting the project as well. You can contribute in various ways, including financial contributions, code, documentation, or bug reports.