EonaCat.ConsoleKit 1.0.0

Prefix Reserved
dotnet add package EonaCat.ConsoleKit --version 1.0.0
                    
NuGet\Install-Package EonaCat.ConsoleKit -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EonaCat.ConsoleKit" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EonaCat.ConsoleKit" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="EonaCat.ConsoleKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EonaCat.ConsoleKit --version 1.0.0
                    
#r "nuget: EonaCat.ConsoleKit, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EonaCat.ConsoleKit@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EonaCat.ConsoleKit&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=EonaCat.ConsoleKit&version=1.0.0
                    
Install as a Cake Tool

EonaCat.ConsoleKit

A rich, zero-dependency C# library for building beautiful, interactive console applications.

Installation

dotnet add package EonaCat.ConsoleKit

Then import the namespace:

using EonaCat.ConsoleKit;

Features

1. Ink – Styled Output

Fluent colored and styled console output. Supports markup syntax, horizontal rules, and centered headers.

// Basic colored output
Ink.Write("Hello ", ConsoleColor.White);
Ink.WriteLine("World!", ConsoleColor.Cyan);

// Semantic shortcuts
Ink.Success("File saved.");
Ink.Error("Connection refused.");
Ink.Warning("Disk space low.");
Ink.Info("Server starting on :8080");
Ink.Muted("(debug information)");
Ink.Bold("Important!");

// Inline color markup
Ink.Markup("[green]✓ Done[/] — elapsed [yellow]3.2s[/]");

// Horizontal rule
Ink.Rule();                      // ─────────────────
Ink.Rule('=', ConsoleColor.Red); // custom character and color

// Centered header with double-line border
Ink.Header("My Application");
Ink.Header("Section", ConsoleColor.Magenta);

2. ProgressBar

Thread-safe animated progress bar. Implements IDisposable.

using var bar = new ProgressBar("Uploading", width: 50);

for (int i = 0; i <= 100; i += 5)
{
    bar.Report(i);
    await Task.Delay(100);
}

bar.Complete("Upload finished");
// or let Dispose() complete it automatically

Custom fill characters:

using var bar = new ProgressBar("Building", fill: '▓', empty: '░');
bar.Report(45);

3. Spinner

Animated Braille spinner for indeterminate operations.

using var spinner = new Spinner("Connecting to database...");
await Task.Delay(2000);
spinner.Complete("Connected");

// Or signal failure
spinner.Fail("Timeout after 30s");

4. Table

Unicode box-drawing table renderer with zebra striping.

var table = new Table("Name", "Role", "Status")
    { HeaderColor = ConsoleColor.Yellow, Zebra = true };

table.AddRow("Alice", "Admin",  "Active")
     .AddRow("Bob",   "Editor", "Inactive")
     .AddRow("Carol", "Viewer", "Active");

table.Render();

Output:

╔═══════╦════════╦══════════╗
║ Name  ║ Role   ║ Status   ║
╠═══════╬════════╬══════════╣
║ Alice ║ Admin  ║ Active   ║
║ Bob   ║ Editor ║ Inactive ║
║ Carol ║ Viewer ║ Active   ║
╚═══════╩════════╩══════════╝

5. ArgParser

Fluent CLI argument parser with short/long flags, default values, and auto-generated help.

var parser = new ArgParser("mytool", "Processes files at lightning speed")
    .AddOption("output", "o", "Output directory", defaultValue: "./out")
    .AddOption("format", "f", "Output format (json|csv|xml)", defaultValue: "json")
    .AddFlag("verbose", "v", "Enable verbose logging")
    .AddFlag("dry-run", "d", "Simulate without writing files");

var result = parser.Parse(args);

// Read values
string output   = result.GetOrDefault("output", "./out");
bool   verbose  = result.GetFlag("verbose");
int    retries  = result.GetInt("retries", 3);
string filename = result.Positional.FirstOrDefault() ?? "input.txt";

// Print help automatically
if (result.GetFlag("help"))
    parser.PrintHelp();

6. Prompt

Interactive prompts: text input, password, yes/no, single-select, and multi-select.

// Text input with optional default
string name = Prompt.Ask("Your name", defaultValue: "World");

// Password (masked with •)
string pass = Prompt.Password("Enter password");

// Confirmation
bool confirmed = Prompt.Confirm("Delete all files?", defaultYes: false);

// Arrow-key single selection
var env = Prompt.Select("Choose environment",
    new[] { "Development", "Staging", "Production" });

// Space-toggle multi-selection
var features = Prompt.MultiSelect("Enable features",
    new[] { "Dark mode", "Notifications", "Analytics", "Beta features" });

7. FileTransfer

Download, upload, and copy files with real-time progress bars.

// Download a file
bool ok = await FileTransfer.DownloadAsync(
    "https://example.com/data.zip",
    "/tmp/data.zip");

// Upload via HTTP multipart POST
bool uploaded = await FileTransfer.UploadAsync(
    "/tmp/report.pdf",
    "https://api.example.com/upload",
    fieldName: "document");

// Local copy with progress
await FileTransfer.CopyFileAsync("/src/large.bin", "/dst/large.bin");

// Format a byte count
string size = FileTransfer.FormatBytes(1_048_576); // → "1.0 MB"

8. Log

Leveled console (and optional file) logger with timestamps.

var log = new Log(Log.Level.Debug, logFile: "app.log");

log.Debug("Cache miss for key='user:42'");
log.Info("HTTP server listening on :8080");
log.Success("Build completed in 3.4s");
log.Warning("Memory usage above 80%");
log.Error("Failed to connect: timeout");

Output:

[14:32:01] [DEBUG]   Cache miss for key='user:42'
[14:32:01] [INFO]    HTTP server listening on :8080
[14:32:01] [SUCCESS] Build completed in 3.4s
[14:32:01] [WARNING] Memory usage above 80%
[14:32:01] [ERROR]   Failed to connect: timeout

9. Banner

Dismissable notification boxes with border decoration.

Banner.Show("Welcome to EonaCat.ConsoleKit!");
Banner.Success("Deployment complete — 4 services updated");
Banner.Warning("Rate limit approaching: 95/100 req/min");
Banner.Error("Critical: database connection pool exhausted");

// Custom icon and color
Banner.Show("Custom message", ConsoleColor.Magenta, icon: "★");

10. ConsoleUtils

Miscellaneous helpers: line clearing, key waits, countdowns, property lists, alerts.

// Clear the current line
ConsoleUtils.ClearLine();

// Wait for any key
ConsoleUtils.WaitForKey("Press any key to exit...");

// Countdown pause
ConsoleUtils.Countdown(5, "Restarting in");

// Two-column property list
ConsoleUtils.PrintProperties(new[]
{
    ("Version",    "2.1.0"),
    ("Build",      "release"),
    ("Commit",     "a3f9c12"),
});

// Beep + optional message
ConsoleUtils.Alert("Check complete.");

11. Menu – Interactive Numbered Menu

Arrow-key navigable menu with keyboard number shortcuts.

var options = new[] { "Start Server", "View Logs", "Configuration", "Exit" };
var choice  = Menu.Show("Main Menu", options);
Console.WriteLine($"You chose: {choice}");

// Menu with action callbacks
Menu.ShowWithActions("Tools", new[]
{
    ("Deploy",    () => Deploy()),
    ("Rollback",  () => Rollback()),
    ("Status",    () => PrintStatus()),
});

Features:

  • Arrow key navigation
  • Press 1–9 as shortcuts
  • Selected item printed in green after confirmation
  • Custom display delegate supported

12. Pager – Paginated List Viewer

Navigate large collections page by page without scrolling.

var logs = File.ReadAllLines("app.log");

Pager.Show(logs,
    pageSize: 20,
    title: "Application Logs");

// Custom display formatting
var users = GetAllUsers();
Pager.Show(users,
    pageSize: 15,
    display: u => $"{u.Id,6}  {u.Name,-30}  {u.Email}",
    title: "User Directory");

Navigation: ← previous page, → next page, Q/Esc to quit.

13. TreeNode – Tree View Renderer

Display hierarchical data in an ASCII tree.

var root = new TreeNode("Project", ConsoleColor.Cyan);

var src = root.Add("src", ConsoleColor.Yellow);
src.Add("Program.cs");
src.Add("ConsoleKit.cs", ConsoleColor.Green);

var tests = root.Add("tests", ConsoleColor.Yellow);
tests.Add("UnitTests.cs");
tests.Add("IntegrationTests.cs");

root.Add("README.md");
root.Add(".gitignore", ConsoleColor.DarkGray);

root.Render();

Output:

└── Project
    ├── src
    │   ├── Program.cs
    │   └── ConsoleKit.cs
    ├── tests
    │   ├── UnitTests.cs
    │   └── IntegrationTests.cs
    ├── README.md
    └── .gitignore

14. StatusDashboard – Live Status Panel

Update named fields in place; ideal for monitoring dashboards.

using var dash = new StatusDashboard("Service Monitor");

dash.Set("API",      "✓ Online",    ConsoleColor.Green);
dash.Set("Database", "✓ Online",    ConsoleColor.Green);
dash.Set("Cache",    "⚠ Degraded",  ConsoleColor.Yellow);
dash.Set("Queue",    "✗ Offline",   ConsoleColor.Red);

// Update live
await Task.Delay(1000);
dash.Set("Cache", "✓ Recovered", ConsoleColor.Green);

15. ConsoleTimer – Stopwatch Display

Animated elapsed-time counter updating in place.

using var timer = new ConsoleTimer("Build time");
await RunBuild();
var elapsed = timer.Stop();
Console.WriteLine($"Finished in {elapsed.TotalSeconds:F2}s");

// Or let Dispose stop it
using (var t = new ConsoleTimer("Processing"))
{
    ProcessData();
} // prints elapsed automatically

16. WordWrap – Auto-Wrapping Text

Wraps long text to the console width with optional indent.

var longText = "This is a very long paragraph that will be automatically " +
               "wrapped to fit within the current console window width without " +
               "cutting words in the middle.";

WordWrap.Write(longText, indent: 4, color: ConsoleColor.Gray);

// With custom max width
WordWrap.Write(longText, indent: 0, maxWidth: 60);

17. Toast – Timed Notification

Briefly shows a message at the bottom of the console, then auto-dismisses.

// Show for 2.5 seconds (default)
Toast.Show("File saved successfully!");

// Custom duration and color
Toast.Show("Sync complete — 42 records updated",
    durationMs: 4000,
    color: ConsoleColor.Green);

Toast.Show("Warning: API rate limit at 90%",
    durationMs: 5000,
    color: ConsoleColor.Yellow);

18. Sparkline – Inline Mini-Chart

Render a tiny histogram from any numeric series.

var cpuSamples = new[] { 12.0, 45, 67, 23, 89, 54, 32, 76, 91, 44 };
Sparkline.Render(cpuSamples, label: "CPU %", color: ConsoleColor.Green);

var memSeries = GetMemoryTimeSeries();
Sparkline.Render(memSeries, label: "RAM");

Output:

 CPU %: ▁▄▆▂▇▅▃▆█▄

19. Columns – Column Layout

Print a list of strings in evenly-spaced columns.

var commands = new[]
{
    "start", "stop", "restart", "reload",
    "status", "logs", "config", "help",
    "version", "update", "deploy", "rollback",
};

Columns.Print(commands, columnCount: 4, color: ConsoleColor.Cyan);

Output:

start       stop        restart     reload
status      logs        config      help
version     update      deploy      rollback

20. DiffViewer – Line Diff Highlighter

Side-by-side line comparison with color coding.

var original = File.ReadAllText("config.v1.json");
var updated  = File.ReadAllText("config.v2.json");

DiffViewer.Show(original, updated, "v1.0", "v2.0");

Output (red = removed, green = added, gray = unchanged):

═══════════════ Diff: v1.0 → v2.0 ═════════════════
  {
-   "port": 8080,
+   "port": 9090,
    "host": "localhost",
-   "debug": true
+   "debug": false
  }

21. Clipboard – System Clipboard

Copy text to the system clipboard (Windows, macOS, Linux).

string token = GenerateApiToken();
Clipboard.Copy(token);
Ink.Success($"Token copied to clipboard: {token}");

// Works cross-platform:
// - Windows: clip
// - macOS:   pbcopy
// - Linux:   xclip

22. CodeBlock – Syntax-Framed Block

Render code inside a rounded box with an optional language label.

CodeBlock.Render(
    "var x = Prompt.Ask(\"Name\");\nInk.Success($\"Hello, {x}!\");",
    language: "C#");

CodeBlock.Render(
    "SELECT * FROM users WHERE active = 1;",
    language: "SQL",
    borderColor: ConsoleColor.DarkGreen);

Output:

╭ C# ──────────────────────────────────╮
│ var x = Prompt.Ask("Name");          │
│ Ink.Success($"Hello, {x}!");         │
╰──────────────────────────────────────╯

23. Typewriter – Animated Text

Print text character by character for dramatic effect.

Typewriter.Write("Initializing AI core...", delayMs: 40, color: ConsoleColor.Green);

// With cancellation
var cts = new CancellationTokenSource();
Typewriter.Write("A very long message that can be cancelled...",
    delayMs: 50, ct: cts.Token);

24. HistoryPrompt – Readline-Style Input

Like Prompt.Ask but with ↑/↓ arrow key history navigation, cursor movement, and in-line editing.

// First call
string cmd1 = HistoryPrompt.Ask("Command");  // user types "build"

// Second call — press ↑ to recall "build"
string cmd2 = HistoryPrompt.Ask("Command");

// Access history
foreach (var entry in HistoryPrompt.History)
    Console.WriteLine(entry);

// Reset
HistoryPrompt.ClearHistory();

25. Wizard – Multi-Step Workflow

Guided step-by-step process with per-step spinners and fail-fast behaviour.

var wizard = new Wizard()
    .AddStep("Check prerequisites", () =>
    {
        Thread.Sleep(500);
        return File.Exists("/usr/bin/git");
    })
    .AddStep("Download dependencies", () =>
    {
        Thread.Sleep(1000);
        return true;
    })
    .AddStep("Compile project", () =>
    {
        Thread.Sleep(2000);
        return true;
    })
    .AddStep("Run tests", () =>
    {
        Thread.Sleep(800);
        return true;
    });

bool success = wizard.Run();

26. BarChart – Horizontal Bar Chart

Render a labeled horizontal bar chart from any numeric dictionary.

var stats = new Dictionary<string, double>
{
    ["Feature A"] = 87,
    ["Feature B"] = 42,
    ["Feature C"] = 100,
    ["Feature D"] = 65,
    ["Feature E"] = 23,
};

BarChart.Render(stats,
    maxBarWidth: 50,
    barColor: ConsoleColor.Cyan);

Output:

──────────────────────────────────────
  Feature A  ▕████████████████████████▏ 87.0
  Feature B  ▕████████████            ▏ 42.0
  Feature C  ▕██████████████████████████████▏ 100.0
  Feature D  ▕███████████████████     ▏ 65.0
  Feature E  ▕███████                 ▏ 23.0
──────────────────────────────────────

27. SystemInfo – Environment Details

Print a summary of the current runtime environment.

SystemInfo.Print();

Output:

════════════ System Information ════════════
  OS                       Windows 10.0.22621
  Machine                  DEV-WORKSTATION
  User                     alice
  CLR Version              8.0.0
  Processors               16
  64-bit                   True
  Working Dir              C:\Projects\MyApp
  Console Size             220×50

28. Retry – Resilient Operation Wrapper

Retry a failing async or sync operation with exponential backoff and live spinner feedback.

// Async
var result = await Retry.RunAsync(
    action: () => httpClient.GetStringAsync("https://api.example.com/data"),
    maxAttempts: 4,
    initialDelayMs: 250,
    label: "API fetch");

// Sync
var config = Retry.Run(
    action: () => LoadConfig("settings.json"),
    maxAttempts: 3,
    label: "Load config");

// Delays: attempt 2 → 250ms, attempt 3 → 500ms, attempt 4 → 1000ms

29. Section – Collapsible Console Panel

Group related output in a labeled, bordered section. Can optionally start collapsed.

using (new Section("Database Results"))
{
    table.Render();
}

// Collapsed section (shows collapsed, user presses any key to expand)
using (new Section("Advanced Details", collapsed: true))
{
    SystemInfo.Print();
    BarChart.Render(perfData);
}

Output:

 ▼ Database Results
 ─────────────────────────────
   [table content here]
 ─────────────────────────────

30. Theme – Color Theme Manager

Apply a named color theme to control output palette throughout the app.

// Apply a theme
Theme.Apply(Theme.Preset.Ocean);
Theme.Apply(Theme.Preset.Forest);
Theme.Apply(Theme.Preset.Sunset);

// Print all available themes with color swatches
Theme.PrintAll();

// Use theme colors in your own output
var (primary, accent, muted, success, warning, error) = Theme.Current;
Ink.WriteLine("Themed output", primary);

Available presets:

Preset Primary Accent Description
Default Gray Cyan Classic console look
Dark White Gray High-contrast dark
Ocean Cyan Blue Cool blue tones
Forest Green DarkGreen Nature greens
Sunset Yellow Magenta Warm sunset palette

Complete Example App

using EonaCat.ConsoleKit;

// Apply theme
Theme.Apply(Theme.Preset.Ocean);

// Show app header
Ink.Header("EonaCat.ConsoleKit Demo");
SystemInfo.Print();

// Countdown before starting
ConsoleUtils.Countdown(3, "Starting in");

// Interactive menu
var section = Menu.Show("Choose Demo", new[]
{
    "Table Demo",
    "Progress Demo",
    "Chart Demo",
    "Wizard Demo",
    "Diff Demo",
    "Exit",
});

switch (section)
{
    case "Table Demo":
        using (new Section("User Table"))
        {
            var t = new Table("ID", "Name", "Score")
                { HeaderColor = ConsoleColor.Cyan };
            t.AddRow(1, "Alice", 98)
             .AddRow(2, "Bob", 74)
             .AddRow(3, "Carol", 87);
            t.Render();
        }
        break;

    case "Progress Demo":
        using var bar = new ProgressBar("Processing", width: 50);
        for (int i = 0; i <= 100; i += 2)
        {
            bar.Report(i);
            Thread.Sleep(30);
        }
        bar.Complete("Done!");
        break;

    case "Chart Demo":
        BarChart.Render(new Dictionary<string, double>
        {
            ["Alpha"]   = 72,
            ["Beta"]    = 55,
            ["Gamma"]   = 91,
            ["Delta"]   = 38,
        });
        Sparkline.Render(new[] { 10.0, 45, 30, 80, 60, 95, 20, 55 }, "Trend");
        break;

    case "Wizard Demo":
        new Wizard()
            .AddStep("Initialize", () => { Thread.Sleep(300); return true; })
            .AddStep("Validate",   () => { Thread.Sleep(500); return true; })
            .AddStep("Deploy",     () => { Thread.Sleep(800); return true; })
            .Run();
        break;

    case "Diff Demo":
        DiffViewer.Show(
            "version: 1.0\nport: 8080\ndebug: true",
            "version: 2.0\nport: 9090\ndebug: false",
            "v1", "v2");
        break;
}

Toast.Show("Demo complete!", durationMs: 3000, color: ConsoleColor.Green);
ConsoleUtils.WaitForKey();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 233 6/12/2026