π€ New: pick the right ConsolePlus/PromptPlus layer and control conversationally with the ConsolePlus + PromptPlus Plugin β works with Claude Code or GitHub Copilot to choose the layer, check whether an interactive control can run in your context, pick the right one of PromptPlus's 21 controls, implement it, and audit existing usage. Learn more β
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 |
| π¬ Demo Mode | Scripted keyboard input (opt-in) to auto-record GIFs/videos of console apps β see Demo Mode |
dotnet add package ConsolePlus.netOr via the Package Manager Console:
Install-Package ConsolePlus.netSupported 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
- Demo Mode β scripted keyboard input for recording GIFs/videos of console apps
- Test Driver Maintenance β how the
VirtualTerminaltest driver is kept in sync with PromptPlus (contributor-facing, not part of the public API) - API Documentation Guide β how
docs/api/is generated and regenerated (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.
Prefer describing what you need in plain language instead of driving the API by hand? The official ConsolePlus + PromptPlus Plugin lets Claude Code or GitHub Copilot choose and implement the right control for you:
- A skill (
select-promptplus-control) that decides whether the need is ConsolePlus rendering or aPromptPlus.Controlsinteractive control, checks whether that control can even run in the target context (redirected input, CI, hosted services), picks the right one of PromptPlus's 21 controls, and implements it against the real, version-pinned fluent API β not a guess from memory. - A
promptplus-auditoragent that audits existing ConsolePlus/PromptPlus usage in a codebase (the redirected-input guard gap, uncheckedIsAborted,IWidgetsnamespace mix-ups, globalConfigvs..Options()) and produces a read-only report. - A
promptplus-precommit-checkagent that catches the two cheapest bug-risk patterns on just the pending diff, before a commit/PR.
Applies to console-type .NET projects only β enforced automatically by a hook on Claude Code, or checked by the skill itself on Copilot, which has no hook mechanism.
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.