The lowly console application has gotten a sad reputation in the .NET ecosystem. Generally, the project format is relegated to the arena of the demonstration. We’re all guilty of starting and abandoning that ConsoleApp341
project. It is time the console app gets the respect it deserves.
The flourishing of terminal technologies are starting a renaissance of enhanced user experiences. From iTerm2, Hyper, and Windows Terminal, all these tools add some spice to an otherwise drab and boring console experience. These tools allow a user to customize their experience, but developers also want to add some programmatic flair to their console apps.
In this post, we’re going to see how we can spice up our console projects and upgrade the user experience using some great open-source projects. Presented in no particular order, here are some fantastic ways to enhance our console app experiences.
Colorful.Console
Colorful.Console is a Nuget package that gives us enhanced control of the output of any console text rendering. We can use colors from System.Drawing.Color
to define the color scheme of our console apps.
Not only that, Colorful.Console, allows us to write color ASCII output using FIGlet
fonts.
The output is straight out of a hacker’s dream.
I recommend visiting the documentation site and seeing all the ways this library can change the console experience.
ConsoleTables
ConsoleTables package is a bit of shameless promotion. The library is written by me, Khalid Abuhakmeh. The library allows developers to easily output an array of items into a formatted table in the console’s output.
Who hasn’t wanted to output a table in a console application before?
Since publishing ConsoleTables, many other developers have created unique versions solving this problem. Some might even be better, so check them out.
ShellProgressBar
Console applications, like many other applications, can perform long-running tasks. ShellProgressBar is a fantastic library that outputs some visually stunning progress bars. It can also nest progress bars as children. Look at the following hypnotic GIF.
Usage is straightforward.
Thank you, Martijn Laarman, for an excellent library.
GUI.CS
GUI.CS is a bonkers console UI toolkit. It offers a full-blown toolbox to build a user interface reminiscent of the early days of computing.
The UI toolbox includes:
- Buttons
- Labels
- Text Entry
- Text View
- User Inputs
- Windows
- Menus
- ScrollBars
It is incredible what developers can do in a console application. Written by Miguel De Icaza, this library is the pinnacle of console technology. Let us take a look at the sample console application.
This sample has everything and the kitchen sink in it.
Conclusion
As developers, we can get be enamored with GUIs, and rightfully so. They empower us to be productive. The console application is just as powerful. Next time you build a console application, be sure to reach for some of these libraries to add some flair to your solution. Regardless of the user’s terminal, they should have similar experiences with these libraries. Give them a try and let me know what you think. Thank you for reading, and please leave your comments below.