ConsolePlus is a .NET library that makes it easier to create beautiful, cross-platform console
applications. It provides a rich, styled output engine (colors, markup, emoji, banners), robust
input helpers, terminal-capability detection, ANSI escape sequence control, and screen/buffer
management — all behind one clean, static entry point: ConsolePlus.
ConsolePlus is heavily inspired by the excellent Spectre.Console and serves as the core foundation for PromptPlus.
| Capability | What you get |
|---|---|
| 🎨 Rich colors | 148 CSS named colors, HEX, RGB, 4-bit/8-bit/24-bit (TrueColor) with automatic down-sampling |
| 🏷️ Markup | Inline [red]...[/] style tags with auto-closing, background colors, hierarchical nesting, and raw fallback on errors |
| 😀 Emoji | :smiley: shortcodes, typed names via EmojiName/EmojiValue, and public group helpers (EmojiTravelAndPlaces, EmojiSymbols, etc.) |
| 🖋️ Styling | Foreground/background colors, inversion, and overflow strategies (crop / ellipsis) |
| 🧱 Widgets | FIGlet banners and dash separators |
| ⌨️ Input | Standard reads plus an Emacs-style line editor (sync & async) |
| 🖥️ Screen control | Cursor movement, alternate/secondary buffer, clear, resize events |
| 🧭 Capabilities | Automatic detection of ANSI, Unicode, color depth, TTY and CI environments |
| 🔤 ANSI | Low-level IAnsiCommands emitter for direct escape-sequence control |
| 🪟 Legacy Windows | Automatic ANSI support on pre-Windows 10 via bundled ANSICON |
| ♿ Accessibility | WCAG luminance/contrast helpers to keep text readable |
dotnet add package ConsolePlusOr via the Package Manager Console:
Install-Package ConsolePlusSupported target frameworks: .NET 8, .NET 9, .NET 10.
using ConsolePlusLibrary;
// Everything is exposed through the static ConsolePlus class.
ConsolePlus.Clear();
// Markup: foreground, background ("on"/":") and nesting
ConsolePlus.WriteLine("[Yellow]Hello, [Red on White]ConsolePlus!");
// A FIGlet banner
ConsolePlus.Banner("ConsolePlus", Color.Teal, DashOptions.SingleBorderUpDown);
// Styled output with a Style object
ConsolePlus.WriteLine("Styled text", new Style(Color.White, Color.Navy));
// Emoji (3 equivalent approaches)
ConsolePlus.WriteLine(":rocket: Ready to launch!"); // 1) Shortcode
ConsolePlus.WriteLine($"{EmojiTravelAndPlaces.Rocket} Ready to launch!"); // 2) Group helper class
ConsolePlus.WriteLine($"{(EmojiValue)EmojiName.Rocket} Ready to launch!"); // 3) EmojiName + EmojiValue
// Another example with heart
ConsolePlus.WriteLine(":red_heart: I love ConsolePlus");
ConsolePlus.WriteLine($"{EmojiSmileysAndEmotion.RedHeart} I love ConsolePlus");
ConsolePlus.WriteLine($"{(EmojiValue)EmojiName.RedHeart} I love ConsolePlus");
// Read a line using the Emacs-style editor
var name = ConsolePlus.ReadLineEmacs();
ConsolePlus.WriteLine($"Welcome, [Aqua]{name}[/]!");Start here and follow the guides in order, or jump straight to the topic you need.
- API Documentation — complete API reference (auto-generated from XML comments)
- Getting Started — install, first app, and how initialization works
- Writing Output —
Write,WriteLine,WriteFormat, blank lines, clearing - Reading Input — keys, lines, and the Emacs-style editor
- Markup Language — inline color tags, escaping, and emoji
- Emoji —
:shortcode:tokens, typed names (EmojiName/EmojiValue), group helper classes (EmojiActivities,EmojiTravelAndPlaces, ...), and the full emoji catalog by group - Colors — color systems, factory methods, contrast helpers, and the full visual palette
- Styles & Overflow — the
Stylestruct and text overflow strategies
- Widgets: Banners & Dashes — FIGlet banners and separators
- Cursor & Screen Control — cursor, buffers, resize events, ANSI commands
- Profiles & Capabilities — capability detection and configuration
- Environment Detection — automatic CI/CD and terminal detection
- ConsolePlus + PromptPlus — add intelligent, professional interactive controls
- Advanced API — driver access, thread-safe output, fragments, the Emacs buffer, and string/culture/key helpers
- Test Driver Maintenance — how the
VirtualTerminaltest driver is kept in sync with PromptPlus (contributor-facing, not part of the public API)
ConsolePlus focuses on console fundamentals — styled output, colors, capabilities and screen control. When you need intelligent, professional interactive controls on top of that foundation (select lists, multi-select, inputs with validation, masked secrets, confirmations, calendars, progress bars, input history, and more), reach for PromptPlus.
PromptPlus is built directly on top of ConsolePlus and exposes it through PromptPlus.Console and
PromptPlus.Widgets, so everything documented here is available while you build fully interactive
command-line experiences.
using PromptPlusLibrary;
// PromptPlus surfaces ConsolePlus through PromptPlus.Console / PromptPlus.Widgets
PromptPlus.Console.WriteLine("[Green]Powered by ConsolePlus[/]");
PromptPlus.Widgets.Banner("PromptPlus", Color.Bisque);👉 Learn more in the ConsolePlus + PromptPlus guide.
ConsolePlus documents its significant architectural and design decisions as Architecture Decision Records (ADR), following the AdrPlus convention. Each record captures the context, the decision, the alternatives considered, and the consequences — so the reasoning behind the library's design stays traceable over time.
👉 See the ADR index for the full list of decisions.
ConsolePlus is licensed under the MIT License.
Portions are inspired by and adapted from Spectre.Console (© 2020 Patrik Svensson, Phil Scott, Nils Andresen), also under the MIT license.
Emoji-datasource is licensed under the UNICODE LICENSE V3.