Spectre.Console

From the Spectre.Console repo:

A .NET library that makes it easier to create beautiful, cross platform, console applications. It is heavily inspired by the excellent Rich library for Python. For detailed usage instructions, please refer to the documentation at https://spectreconsole.net/.

Spectre.Console vs Terminal.GUI

Using Terminal.Gui, you can create applications that look more like traditional desktop apps than you can with Spectre.Console. But, Terminal.Gui has a critical dependency that introduces a limitation: It requires a graphical stack for rendering. Usually, this is fine: You'll be running your Terminal.Gui applications from a command prompt in Windows, or in a terminal from your Linux desktop. But, for something like a Linux server that boots to a CLI, your Terminal.Gui applications will not run because there's no graphical stack.

Spectre.Console applications do not follow the "desktop application" paradigm. They are closer to console applications, but with enhanced colors, and rendering of other things like tables, but in a scrolling view. Most importantly, though, Spectre.Console applications do not require a graphical environment. So, for a purely text-based environment, Spectre.Console fills this need.

Create the Project

https://github.com/jfcarr/dotnet-iot-tui/tree/main/src/SpectreClient

  1. Create the project, using console as the project type.
  2. Add package references:
    1. Spectre.Console.Cli (adds nice command line argument handling)
    2. Spectre.Console
  3. Add a project reference to SenseHatLib.csproj
  4. App settings:
    1. Copy the appsettings.default.json file to appsettings.json, and update the setting values.
    2. Add appsettings content entry to the .csproj file.
  5. Implement details in Program.cs