Skip to content
ConsoleMonster

Live dashboards

Recorded runs of ConsoleMonster's live showcases, replayed frame by frame. Threads post updates; the session draws about 15 frames a second.

dotnet run -- 12 120×4024-bitFull

Recorded from a real run of the program below in a 120×40 window. The session drew 15 frames a second; this replay samples 3 of them per second to keep the file small.

The stress test

32 workers post lane updates as fast as they can while four threads write to Console.Out and Console.Error at random. The workers never touch the console: the session coalesces everything into about 15 frames a second and captures the stray output into the log region.

Updates posted in 12.7 s
1,479,756
Average update rate
116,206/s
Frames drawn
191 (15.0 fps)
Dropped updates and errors
0 / 0
CPU, share of one core
26.1%

Measured by the program itself during the recording above (.NET 8). It prints this line when the session ends.

Result line
STRESS seconds=12.7 workers=32 posted=1479756 avgRate=116206/s peakRate=131823/s frames=191 fps=15.0 cpuOneCore=26.1% cpuMachine=0.8% captured=208 dropped=0 errors=0 runtime=.NET 8.0.34
macOS stress recording
dotnet run -- 12 macOS120×4024-bitFull
macOS result
STRESS seconds=12.6 workers=32 posted=9933785 avgRate=787757/s peakRate=891871/s frames=190 fps=15.1 cpuOneCore=144.2% cpuMachine=8.0% captured=212 dropped=0 errors=0 runtime=.NET 8.0.34
C#Program.cs
// A stress test: 32 workers post thousands of updates a second while a noisy "library" writes to Console.Out and
// Console.Error from four threads. Workers never touch the console; the session draws about 15 frames a second and
// captures the stray lines into the output panel. Run it for N seconds: dotnet run -- 12
int seconds = args.Length > 0 ? int.Parse(args[0], CultureInfo.InvariantCulture) : 12;
const int Workers = 32;
Lanes lanes = new Lanes("workers")
{
    MaxLabelWidth = 10,
    ShowDetail = true
};
for (int i = 0; i < Workers; i++)
{
    lanes.Add("w" + i, "worker " + (i + 1).ToString("00", CultureInfo.InvariantCulture), 100000);
}

KeyValueList stats = new KeyValueList("stats")
    .Add("Updates posted", "0")
    .Add("Updates applied", "0")
    .Add("Update rate", "-")
    .Add("Frames", "0")
    .Add("Frame rate", "-")
    .Add("CPU", "-")
    .Add("CPU share", "-")
    .Add("Captured lines", "0")
    .Add("Dropped / errors", "0 / 0");
Sparkline rate = new Sparkline("rate").Height(3).Unit("/s");
LineChart cpu = new LineChart("cpu").Height(6).Minimum(0).Unit("%");
cpu.Series("cpu", ThemeToken.Accent2);
Dashboard dashboard = Ui.Dashboard().Title("[bold]Stress test[/]")
    .Subtitle(Workers + " workers · random Console.WriteLine · " + seconds + "s")
    .Content(body => body
        .Columns(columns => columns.Content(c => c.Add(new Panel(lanes, "Workers").Fill(2.2))
            .Add(new Panel(new Rows(
                    stats,
                    new Rule("updates/s"),
                    rate,
                    new Rule("CPU % (100% = one core)"),
                    cpu), "Session").Fill(1))))
        .Add(new Panel(new LogRegion { PreferredHeight = 6 }, "Captured output").Fill()));
string result = string.Empty;
using (LiveSession session = new LiveSession(dashboard))
{
    session.Run(s => result = Drive(s));
}

Console.WriteLine(result);
string Drive(LiveSession session)
// … 151 more lines in the full program
Full program
using ConsoleMonster;
using System.Diagnostics;
using System.Globalization;
using ConsoleMonster.Layout;
using ConsoleMonster.Live;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;

// A stress test: 32 workers post thousands of updates a second while a noisy "library" writes to Console.Out and
// Console.Error from four threads. Workers never touch the console; the session draws about 15 frames a second and
// captures the stray lines into the output panel. Run it for N seconds: dotnet run -- 12
int seconds = args.Length > 0 ? int.Parse(args[0], CultureInfo.InvariantCulture) : 12;
const int Workers = 32;
Lanes lanes = new Lanes("workers")
{
    MaxLabelWidth = 10,
    ShowDetail = true
};
for (int i = 0; i < Workers; i++)
{
    lanes.Add("w" + i, "worker " + (i + 1).ToString("00", CultureInfo.InvariantCulture), 100000);
}

KeyValueList stats = new KeyValueList("stats")
    .Add("Updates posted", "0")
    .Add("Updates applied", "0")
    .Add("Update rate", "-")
    .Add("Frames", "0")
    .Add("Frame rate", "-")
    .Add("CPU", "-")
    .Add("CPU share", "-")
    .Add("Captured lines", "0")
    .Add("Dropped / errors", "0 / 0");
Sparkline rate = new Sparkline("rate").Height(3).Unit("/s");
LineChart cpu = new LineChart("cpu").Height(6).Minimum(0).Unit("%");
cpu.Series("cpu", ThemeToken.Accent2);
Dashboard dashboard = Ui.Dashboard().Title("[bold]Stress test[/]")
    .Subtitle(Workers + " workers · random Console.WriteLine · " + seconds + "s")
    .Content(body => body
        .Columns(columns => columns.Content(c => c.Add(new Panel(lanes, "Workers").Fill(2.2))
            .Add(new Panel(new Rows(
                    stats,
                    new Rule("updates/s"),
                    rate,
                    new Rule("CPU % (100% = one core)"),
                    cpu), "Session").Fill(1))))
        .Add(new Panel(new LogRegion { PreferredHeight = 6 }, "Captured output").Fill()));
string result = string.Empty;
using (LiveSession session = new LiveSession(dashboard))
{
    session.Run(s => result = Drive(s));
}

Console.WriteLine(result);
string Drive(LiveSession session)
{
    LanesHandle lanesHandle = lanes.Handle(session);
    KeyValueHandle statsHandle = stats.Handle(session);
    SparklineHandle rateHandle = rate.Handle(session);
    SparklineHandle cpuHandle = cpu.Handle(session);
    long captured = 0;
    using CancellationTokenSource stop = CancellationTokenSource.CreateLinkedTokenSource(
        session.Cancellation);
    Thread[] workers = new Thread[Workers];
    for (int i = 0; i < Workers; i++)
    {
        int id = i;
        workers[i] = new Thread(() => Worker(id, lanesHandle, stop.Token))
        {
            IsBackground = true
        };
        workers[i].Start();
    }

    Thread[] noisy = new Thread[4];
    for (int i = 0; i < noisy.Length; i++)
    {
        int id = i;
        noisy[i] = new Thread(() => FakeLibrary(id, stop.Token, ref captured))
        {
            IsBackground = true
        };
        noisy[i].Start();
    }

    Process process = Process.GetCurrentProcess();
    Stopwatch wall = Stopwatch.StartNew();
    TimeSpan cpuStart = process.TotalProcessorTime;
    TimeSpan lastCpu = cpuStart;
    double lastWall = 0;
    long lastPosted = 0;
    double peakRate = 0;
    while (wall.Elapsed.TotalSeconds < seconds && !session.Cancellation.IsCancellationRequested)
    {
        Thread.Sleep(500);
        process.Refresh();
        double now = wall.Elapsed.TotalSeconds;
        TimeSpan cpuNow = process.TotalProcessorTime;
        double interval = now - lastWall;
        double core = (cpuNow - lastCpu).TotalMilliseconds / (interval * 1000) * 100;
        long posted = session.EventsPosted;
        double perSecond = (posted - lastPosted) / interval;
        peakRate = Math.Max(peakRate, perSecond);
        lastCpu = cpuNow;
        lastWall = now;
        lastPosted = posted;
        rateHandle.Add(perSecond);
        cpuHandle.Add(core, "cpu");
        statsHandle.Set("Updates posted", NumberFormat.Grouped(posted));
        statsHandle.Set("Updates applied", NumberFormat.Grouped(session.EventsApplied));
        statsHandle.Set("Update rate", NumberFormat.Grouped(perSecond) + "/s");
        statsHandle.Set("Frames", NumberFormat.Grouped(session.FramesRendered));
        statsHandle.Set("Frame rate",
            (session.FramesRendered / now).ToString("0.0", CultureInfo.InvariantCulture) + " fps");
        statsHandle.Set("CPU",
            core.ToString("0",
                CultureInfo.InvariantCulture) + "% (" + (core / 100).ToString("0.0",
                    CultureInfo.InvariantCulture) + " cores)");
        statsHandle.Set("CPU share",
            (core / Environment.ProcessorCount).ToString("0.0",
                CultureInfo.InvariantCulture) + "% of " + Environment.ProcessorCount + " cores");
        statsHandle.Set("Captured lines", NumberFormat.Grouped(Interlocked.Read(ref captured)));
        statsHandle.Set("Dropped / errors", session.EventsDropped + " / " + session.ApplyErrors);
    }

    stop.Cancel();
    foreach (Thread t in workers)
    {
        t.Join();
    }

    foreach (Thread t in noisy)
    {
        t.Join();
    }

    for (int i = 0; i < Workers; i++)
    {
        lanesHandle.Complete("w" + i, StatusKind.Pass);
    }

    Thread.Sleep(300);
    process.Refresh();
    double elapsed = wall.Elapsed.TotalSeconds;
    double avgCore = (process.TotalProcessorTime - cpuStart).TotalMilliseconds
        / (elapsed * 1000) * 100;
    return string.Format(CultureInfo.InvariantCulture,
        ("STRESS seconds={0:0.0} workers={1} posted={2} avgRate={3:0}/s "
            + "peakRate={4:0}/s frames={5} fps={6:0.0} cpuOneCore={7:0.0}% "
            + "cpuMachine={8:0.0}% captured={9} dropped={10} errors={11} runtime={12}"),
        elapsed, Workers, session.EventsPosted, session.EventsPosted / elapsed, peakRate,
        session.FramesRendered, session.FramesRendered / elapsed, avgCore,
        avgCore / Environment.ProcessorCount, Interlocked.Read(ref captured), session.EventsDropped,
        session.ApplyErrors,
        System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription);
}

void Worker(int id, LanesHandle handle, CancellationToken token)
{
    string key = "w" + id;
    Random random = new Random(id * 7919);
    string[] steps = { "parsing", "resolving", "evaluating", "scoring", "writing" };
    handle.Start(key, "starting");
    int n = 0;
    while (!token.IsCancellationRequested)
    {
        for (int burst = 0; burst < 40; burst++)
        {
            double roll = random.NextDouble();
            StatusKind outcome = roll < 0.03
                ? StatusKind.Fail
                : roll < 0.1 ? StatusKind.Warn : StatusKind.Pass;
            handle.Advance(key, outcome,
                (n++ % 97 == 0) ? steps[random.Next(steps.Length)] + " item " + n : null);
        }

        Thread.Sleep(1);
    }
}

void FakeLibrary(int id, CancellationToken token, ref long captured)
{
    Random random = new Random(1000 + id);
    string[] messages =
    {
        "FakeLib: cache miss for key {0}", "FakeLib: retrying request {0} (attempt 2)",
        "FakeLib: connection pool at {0}% capacity", "FakeLib: GC pause {0} ms",
        "FakeLib: flushed {0} records"
    };
    while (!token.IsCancellationRequested)
    {
        Thread.Sleep(random.Next(40, 400));
        string text = string.Format(CultureInfo.InvariantCulture,
            messages[random.Next(messages.Length)], random.Next(1, 999));
        if (random.NextDouble() < 0.15)
        {
            Console.Error.WriteLine("ERROR " + text);
        }
        else
        {
            Console.WriteLine(text);
        }

        Interlocked.Increment(ref captured);
    }
}

An assessment run with workers and a check map

RunDashboard hosts checks that run four at a time. The map puts each category against each target and colours the cell by its worst outcome, the workers line shows how many are busy, and problems are ranked by severity as they arrive.

dotnet run 24-bitFull

Every way a check can end

Besides passed, warning, failed and skipped, a check can end as Error (it threw or timed out, so there is no verdict), Investigate (a human needs to look) or NotRun (deliberately not executed, here because dc06 is offline). Each has its own symbol on every glyph tier and its own count.

The program

C#Program.cs
// Nightly checks: six categories on six domain controllers, four at a time. Each result lands in the
// category x target map, coloured by the worst outcome. Invented targets, results and timings.
string[] categories = { "Replication", "DNS", "Kerberos", "Certificates", "Group Policy", "Time" };
string[] targets = { "dc01", "dc02", "dc03", "dc04", "dc05", "dc06" };
List<RunItem> items = new List<RunItem>();
foreach (string target in targets)
{
    foreach (string category in categories)
    {
        items.Add(new RunItem(category, target + ".corp.example", category));
    }
}

// What the checks find: everything else passes. dc06 is offline, so its checks are not run.
Dictionary<string, (StatusKind Outcome, string Message, Severity? Severity)> findings = new()
{
    ["Replication dc03"] = (StatusKind.Fail, "no inbound replication from dc05 for 4h", Severity.High),
    ["Certificates dc05"] = (StatusKind.Fail, "CA certificate expires in 9 days", Severity.Critical),
    ["DNS dc02"] = (StatusKind.Warn, "scavenging is disabled on 2 zones", null),
    ["Group Policy dc05"] = (StatusKind.Warn, "SYSVOL has 37 files in the DFSR backlog", null),
    ["Kerberos dc04"] = (StatusKind.Error, "WinRM did not answer within 30 s", null),
    ["Certificates dc01"] = (StatusKind.Investigate, "2 templates let the requester supply a name", null),
    ["Time dc03"] = (StatusKind.Skip, "the PDC emulator is checked from dc01", null)
};
SimulatedClock clock = new SimulatedClock();
RunTracker tracker = new RunTracker(items, clock.Read);
RunDashboard dashboard = new RunDashboard(tracker)
{
    Title = "Nightly checks",
    ShowMap = true,
    Workers = 4
};
LiveSessionOptions options = new LiveSessionOptions
{
    Clock = clock.Read,
    Summary = new RunSummary(tracker) { Title = "Nightly checks" }
};
using (LiveSession session = new LiveSession(dashboard, options))
{
    session.Run(Check);
}

// Four workers take the checks in order; the simulated clock moves to whichever finishes next.
// … 50 more lines in the full program
Full program
using ConsoleMonster.Live;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;

// Nightly checks: six categories on six domain controllers, four at a time. Each result lands in the
// category x target map, coloured by the worst outcome. Invented targets, results and timings.
string[] categories = { "Replication", "DNS", "Kerberos", "Certificates", "Group Policy", "Time" };
string[] targets = { "dc01", "dc02", "dc03", "dc04", "dc05", "dc06" };
List<RunItem> items = new List<RunItem>();
foreach (string target in targets)
{
    foreach (string category in categories)
    {
        items.Add(new RunItem(category, target + ".corp.example", category));
    }
}

// What the checks find: everything else passes. dc06 is offline, so its checks are not run.
Dictionary<string, (StatusKind Outcome, string Message, Severity? Severity)> findings = new()
{
    ["Replication dc03"] = (StatusKind.Fail, "no inbound replication from dc05 for 4h", Severity.High),
    ["Certificates dc05"] = (StatusKind.Fail, "CA certificate expires in 9 days", Severity.Critical),
    ["DNS dc02"] = (StatusKind.Warn, "scavenging is disabled on 2 zones", null),
    ["Group Policy dc05"] = (StatusKind.Warn, "SYSVOL has 37 files in the DFSR backlog", null),
    ["Kerberos dc04"] = (StatusKind.Error, "WinRM did not answer within 30 s", null),
    ["Certificates dc01"] = (StatusKind.Investigate, "2 templates let the requester supply a name", null),
    ["Time dc03"] = (StatusKind.Skip, "the PDC emulator is checked from dc01", null)
};
SimulatedClock clock = new SimulatedClock();
RunTracker tracker = new RunTracker(items, clock.Read);
RunDashboard dashboard = new RunDashboard(tracker)
{
    Title = "Nightly checks",
    ShowMap = true,
    Workers = 4
};
LiveSessionOptions options = new LiveSessionOptions
{
    Clock = clock.Read,
    Summary = new RunSummary(tracker) { Title = "Nightly checks" }
};
using (LiveSession session = new LiveSession(dashboard, options))
{
    session.Run(Check);
}

// Four workers take the checks in order; the simulated clock moves to whichever finishes next.
void Check(LiveSession session)
{
    const int Workers = 4;
    Queue<int> queue = new Queue<int>(Enumerable.Range(0, items.Count));
    List<(int Index, TimeSpan End)> running = new List<(int Index, TimeSpan End)>();
    while (queue.Count > 0 || running.Count > 0)
    {
        while (running.Count < Workers && queue.Count > 0)
        {
            int index = queue.Dequeue();
            tracker.StartItem(index, "collecting");
            running.Add((index, clock.Elapsed + Duration(index)));
        }

        (int Index, TimeSpan End) next = running.MinBy(r => r.End);
        while (clock.Elapsed < next.End)
        {
            TimeSpan slice = TimeSpan.FromTicks(Math.Min(TimeSpan.FromMilliseconds(250).Ticks,
                (next.End - clock.Elapsed).Ticks));
            session.Delay(slice);
            clock.Advance(slice);
        }

        running.Remove(next);
        RunItem item = items[next.Index];
        string key = item.Group + " " + item.Target.Split('.')[0];
        if (item.Target.StartsWith("dc06"))
        {
            tracker.FinishItem(next.Index, StatusKind.NotRun, "dc06 is offline");
        }
        else if (findings.TryGetValue(key, out var finding))
        {
            item.Severity = finding.Severity;
            tracker.FinishItem(next.Index, finding.Outcome, finding.Message, default,
                finding.Outcome == StatusKind.Error);
        }
        else
        {
            tracker.FinishItem(next.Index, StatusKind.Pass);
        }
    }

    tracker.Complete();
    session.Delay(TimeSpan.FromMilliseconds(1500));
}

// Checks take 0.8 to 3.3 seconds; an offline target answers at once.
TimeSpan Duration(int index) => items[index].Target.StartsWith("dc06")
    ? TimeSpan.FromMilliseconds(100)
    : TimeSpan.FromSeconds(0.8 + index * 7 % 11 * 0.25);

Recorded once, replayed exactly

This program runs no rules: it replays a recording of 1,440 events into a dashboard that knows nothing about the recording, because every update is addressed to a widget by name. The same dashboard could be fed by a live run.

dotnet run -- assessment-run.jsonl 2 24-bitFull

The recording

LiveRecorder writes one JSON object per applied event: the time in milliseconds, the target, the operation, the key and the values. LiveRecordingReader reads it back with no dependencies. Live sessions record with RecordingPath or RecordWriter, and Invoke-ConsoleDashboard with -RecordingPath.

JSON linesassessment-run.jsonl, first lines
{"consolemonster":"recording","version":1}
{"t":1,"target":"dashboard","op":"status","text":"discovering forest","state":"running"}
{"t":1,"target":"phases","op":"state","key":"Discover","state":"running"}
{"t":1,"target":"lanes","op":"add","key":"dom-ad","text":"ad.adatum.com (domain)","total":16}
{"t":1,"target":"lanes","op":"add","key":"dom-eu","text":"eu.ad.adatum.com (domain)","total":16}
{"t":1,"target":"lanes","op":"add","key":"dc1","text":"DC01.ad.adatum.com","total":30}
{"t":1,"target":"lanes","op":"add","key":"dc2","text":"DC02.ad.adatum.com","total":30}
{"t":1,"target":"lanes","op":"add","key":"dc3","text":"DC03.ad.adatum.com","total":30}
{"t":1,"target":"lanes","op":"add","key":"dc4","text":"DC04.ad.adatum.com","total":30}

Download the whole recording (1,440 events).

The program

Phases, lanes for twelve targets, a stacked bar and a key/value list, a braille line chart, a histogram, a bar chart and a log region, replayed from the file at the speed you give. Below 60×20 the dashboard shows one status line plus the phases and the lanes that fit.

C#Program.cs
// Replays a recorded assessment into its dashboard: every line of the recording is an update addressed to a widget
// by name, so the layout knows nothing about where the updates come from (a live run, or this file).
//   dotnet run -- assessment-run.jsonl 6     (the recording, and the speed)
string path = args.Length > 0 ? args[0] : "assessment-run.jsonl";
double speed = args.Length > 1 ? double.Parse(args[1], CultureInfo.InvariantCulture) : 1;
const int TotalRules = 332;
const int Workers = 6;
Phases phases = new Phases().Set("Discover").Set("Collect").Set("Evaluate").Set("Report");
StackedBar results = new StackedBar("results")
    .Add("Passed", 0, ThemeToken.Pass)
    .Add("Warnings", 0, ThemeToken.Warn)
    .Add("Failed", 0, ThemeToken.Fail)
    .Add("Skipped", 0, ThemeToken.Skip);
KeyValueList summary = new KeyValueList("summary")
    .Add("Evaluated", "0 / " + TotalRules)
    .Add("Average rate", "-")
    .Add("Remaining", "-")
    .Add("Targets done", "0 / 12")
    .Add("Targets failing", "0");
LineChart throughput = new LineChart("throughput").Height(7);
throughput.Series("completed", ThemeToken.Accent);
throughput.Series("failed", ThemeToken.Fail);
Histogram durations = new Histogram(new double[] { 0, 0.25, 0.5, 1, 2, 4, 8 }, "durations")
    .Height(6)
    .Unit("s");
BarChart findings = new BarChart("findings").Role(ThemeToken.Fail);
foreach (string category in new[]
{
    "Domain controllers", "Replication", "DNS", "Kerberos", "Security", "Group Policy", "Accounts",
    "PKI"
}

)
{
    findings.Add(category, 0);
}

Lanes targets = new Lanes
{
    MaxLabelWidth = 28
};
Dashboard dashboard = Ui.Dashboard().Title("[bold]Nightly checks[/]")
    .Subtitle("ad.adatum.com forest assessment · 12 targets · " + TotalRules + " rules")
    .Content(body => body
        .Add(new Prioritized(new Padding(phases, 1, 0, 1, 1), 10, 1, 30))
        .Columns(columns => columns.Content(c => c.Add((new Panel(
            new Prioritized(targets, 8, 4, 40),
            "Targets") { HeaderRight = Workers + " workers" }).Fill(2.3))
            .Add(new Panel(new Rows(results, new Rule(), summary), "Results").Fill(1))))
        .Columns(columns => columns.Content(c => c.Add((new Panel(throughput,
            "Throughput") { HeaderRight = "rules/s" }).Fill(1.2))
            .Add(new Panel(durations, "Rule duration").Fill(1))
            .Add(new Panel(findings, "Failures by category").Fill(1))))
        .Add(new Panel(new LogRegion { PreferredHeight = 6 }, "Log").Fill()));

// Below 60 x 20 the dashboard shows one status line, the phases and the lanes that fit.
dashboard.MinimumSize = new Size(60, 20);
dashboard.CompactSummary = () =>
{
    double done = results.Segments.Sum(s => s.Value);
    double failed = results.Segments.First(s => s.Label == "Failed").Value;
    double warned = results.Segments.First(s => s.Label == "Warnings").Value;
    return done + "/" + TotalRules + " · [fail]✗" + failed + "[/] [warn]"
        + GlyphSet.Full.Get(Glyph.Warning) + warned + "[/]";
};
using StreamReader recording = new StreamReader(path);
LiveSession.Replay(
    dashboard,
    recording,
    new LiveSessionOptions { Summary = new RunSummary(targets) },
    speed);
// A widget written by hand (IWidget): the run summary printed to the scrollback when the session ends.
// … 39 more lines in the full program
Full program
using ConsoleMonster;
using System.Globalization;
using ConsoleMonster.Canvas;
using ConsoleMonster.Glyphs;
using ConsoleMonster.Layout;
using ConsoleMonster.Live;
using ConsoleMonster.Styling;
using ConsoleMonster.Text;
using ConsoleMonster.Widgets;

// Replays a recorded assessment into its dashboard: every line of the recording is an update addressed to a widget
// by name, so the layout knows nothing about where the updates come from (a live run, or this file).
//   dotnet run -- assessment-run.jsonl 6     (the recording, and the speed)
string path = args.Length > 0 ? args[0] : "assessment-run.jsonl";
double speed = args.Length > 1 ? double.Parse(args[1], CultureInfo.InvariantCulture) : 1;
const int TotalRules = 332;
const int Workers = 6;
Phases phases = new Phases().Set("Discover").Set("Collect").Set("Evaluate").Set("Report");
StackedBar results = new StackedBar("results")
    .Add("Passed", 0, ThemeToken.Pass)
    .Add("Warnings", 0, ThemeToken.Warn)
    .Add("Failed", 0, ThemeToken.Fail)
    .Add("Skipped", 0, ThemeToken.Skip);
KeyValueList summary = new KeyValueList("summary")
    .Add("Evaluated", "0 / " + TotalRules)
    .Add("Average rate", "-")
    .Add("Remaining", "-")
    .Add("Targets done", "0 / 12")
    .Add("Targets failing", "0");
LineChart throughput = new LineChart("throughput").Height(7);
throughput.Series("completed", ThemeToken.Accent);
throughput.Series("failed", ThemeToken.Fail);
Histogram durations = new Histogram(new double[] { 0, 0.25, 0.5, 1, 2, 4, 8 }, "durations")
    .Height(6)
    .Unit("s");
BarChart findings = new BarChart("findings").Role(ThemeToken.Fail);
foreach (string category in new[]
{
    "Domain controllers", "Replication", "DNS", "Kerberos", "Security", "Group Policy", "Accounts",
    "PKI"
}

)
{
    findings.Add(category, 0);
}

Lanes targets = new Lanes
{
    MaxLabelWidth = 28
};
Dashboard dashboard = Ui.Dashboard().Title("[bold]Nightly checks[/]")
    .Subtitle("ad.adatum.com forest assessment · 12 targets · " + TotalRules + " rules")
    .Content(body => body
        .Add(new Prioritized(new Padding(phases, 1, 0, 1, 1), 10, 1, 30))
        .Columns(columns => columns.Content(c => c.Add((new Panel(
            new Prioritized(targets, 8, 4, 40),
            "Targets") { HeaderRight = Workers + " workers" }).Fill(2.3))
            .Add(new Panel(new Rows(results, new Rule(), summary), "Results").Fill(1))))
        .Columns(columns => columns.Content(c => c.Add((new Panel(throughput,
            "Throughput") { HeaderRight = "rules/s" }).Fill(1.2))
            .Add(new Panel(durations, "Rule duration").Fill(1))
            .Add(new Panel(findings, "Failures by category").Fill(1))))
        .Add(new Panel(new LogRegion { PreferredHeight = 6 }, "Log").Fill()));

// Below 60 x 20 the dashboard shows one status line, the phases and the lanes that fit.
dashboard.MinimumSize = new Size(60, 20);
dashboard.CompactSummary = () =>
{
    double done = results.Segments.Sum(s => s.Value);
    double failed = results.Segments.First(s => s.Label == "Failed").Value;
    double warned = results.Segments.First(s => s.Label == "Warnings").Value;
    return done + "/" + TotalRules + " · [fail]✗" + failed + "[/] [warn]"
        + GlyphSet.Full.Get(Glyph.Warning) + warned + "[/]";
};
using StreamReader recording = new StreamReader(path);
LiveSession.Replay(
    dashboard,
    recording,
    new LiveSessionOptions { Summary = new RunSummary(targets) },
    speed);
// A widget written by hand (IWidget): the run summary printed to the scrollback when the session ends.
sealed class RunSummary : IWidget
{
    private readonly Lanes _lanes;
    public RunSummary(Lanes lanes) => _lanes = lanes;
    public Size Measure(Constraints constraints,
        RenderContext context) => Content().Measure(constraints, context);
    public void Render(Region region, RenderContext context) => Content().Render(region, context);
    private IWidget Content()
    {
        Table table = new Table()
            .Border(TableBorder.Minimal)
            .Title("[bold]Run summary[/]")
            .Column("Target", c => c.Wrap(false))
            .Column("Status")
            .Column("Passed")
            .Column("Failed")
            .Column("Warnings")
            .Column("Skipped")
            .Column("Duration");
        int passed = 0, failed = 0, warned = 0, skipped = 0;
        foreach (Lane lane in _lanes.Items)
        {
            string duration = lane.Started.HasValue && lane.Finished.HasValue
                ? NumberFormat.Duration(lane.Finished.Value - lane.Started.Value)
                : "-";
            table.Row(Markup.Escape(lane.Label), TableCell.ForStatus(lane.Status),
                lane.Passed.ToString(), lane.Failed.ToString(), lane.Warned.ToString(),
                lane.Skipped.ToString(), duration);
            passed += lane.Passed;
            failed += lane.Failed;
            warned += lane.Warned;
            skipped += lane.Skipped;
        }

        table.Footer("[bold]Total[/]", string.Empty, passed.ToString(), failed.ToString(),
            warned.ToString(), skipped.ToString(), string.Empty);
        return new Padding(table, 1, 1, 1, 1);
    }
}

A build pipeline, from C# and PowerShell

A module build: phases, steps with timings, module facts, overall progress and the tool output. The C# program writes to Console.Out like a real tool, and the PowerShell script calls Write-Host and Write-Warning from the dashboard's runspace; both land in the Output panel. Each run was recorded in a 110×32 window.

dotnet run 110×3224-bitFull

The PowerShell script

PowerShellExample-BuildPipeline.ps1
# A simulated module build pipeline: phases, steps with timings, module facts and the tool output.
# The script runs in a runspace ConsoleMonster owns: Write-Host, Write-Warning and Write-Verbose land in the log
# region instead of writing over the live screen.

$steps = @(
    @{ Phase = 'Prepare'; Key = 'config'; Label = 'Read Build/project.build.json'; Seconds = 0.5; Result = 'Pass' }
    @{ Phase = 'Restore'; Key = 'restore'; Label = 'Restore NuGet packages'; Seconds = 1.5; Result = 'Pass' }
    @{ Phase = 'Build'; Key = 'core'; Label = 'Compile ConsoleMonster (3 frameworks)'; Seconds = 2.5; Result = 'Pass' }
    @{ Phase = 'Build'; Key = 'ps'; Label = 'Compile ConsoleMonster.PowerShell'; Seconds = 1.5; Result = 'Pass' }
    @{ Phase = 'Test'; Key = 'xunit'; Label = 'Run xUnit tests'; Seconds = 2.5; Result = 'Pass' }
    @{ Phase = 'Test'; Key = 'pester'; Label = 'Run Pester tests'; Seconds = 2.0; Result = 'Warn' }
    @{ Phase = 'Docs'; Key = 'docs'; Label = 'Generate help (38 commands)'; Seconds = 1.5; Result = 'Pass' }
    @{ Phase = 'Package'; Key = 'pack'; Label = 'Pack module and NuGet package'; Seconds = 1.5; Result = 'Pass' }
    @{ Phase = 'Publish'; Key = 'publish'; Label = 'Publish to PowerShell Gallery'; Seconds = 0.3; Result = 'Skip' }
)

$dashboard = New-ConsoleDashboard -Title '[bold]Module build[/]' -Subtitle 'Build-Module ConsoleMonster' -Gap 1 -Content {
    New-ConsoleStatusList -Layout Strip -WidgetId phases -Content { 'Prepare', 'Restore', 'Build', 'Test', 'Docs', 'Package', 'Publish' }
    New-ConsoleColumns -Content {
        New-ConsolePanel -Title 'Steps' -Weight 1.5 -Content { New-ConsoleStatusList -WidgetId steps -Content { $steps.Label } }
        New-ConsolePanel -Title 'Module' -Content {
            New-ConsoleKeyValue -WidgetId module -InputObject ([ordered] @{ Module = 'ConsoleMonster'; Version = '2.0.0'; Frameworks = 'netstandard2.0 · net472 · net8.0'; Elapsed = '-' })
            New-ConsoleRule
            New-ConsoleProgress -WidgetId overall -Label 'Overall' -Total $steps.Count
        }
    }
    New-ConsolePanel -Title 'Output' -Fill -Content { New-ConsoleLogRegion }
}

# Planned step durations drive the displayed clocks; dashboard waits keep normal playback paced in real time.
$clock = New-Object ConsoleMonster.Live.SimulatedClock -ArgumentList (0)
Invoke-ConsoleDashboard $dashboard -Clock $clock -ArgumentList $clock, $steps {
    param($Clock, $Steps)
    $phase = $null
    $index = 0
    foreach ($step in $Steps) {
        if ($step.Phase -ne $phase) {
            if ($phase) {
                Update-Console -Key $phase -Status Pass -WidgetId 'phases'
            }
            $phase = $step.Phase
            Update-Console -Key $phase -Status Running -WidgetId 'phases'
        }
        Update-Console -WidgetId steps -Key $step.Label -Status Running
        Write-Host "$($step.Label)..."
        Wait-ConsoleDashboard -Seconds $step.Seconds
        $Clock.Advance($step.Seconds)
        if ($step.Result -eq 'Warn') {
            Write-Warning '1 Pester test skipped on PowerShell 7 (requires conhost)'
        }
        Update-Console -WidgetId steps -Key $step.Label -Status $step.Result -Detail ($step.Seconds.ToString('0.0', [cultureinfo]::InvariantCulture) + 's')
        $index++
        Update-Console -WidgetId overall -Value $index
        Update-Console -WidgetId module -Key Elapsed -Value ($Clock.Elapsed.TotalSeconds.ToString('0.0', [cultureinfo]::InvariantCulture) + 's')
    }
    Update-Console -Key $phase -Status Skip -WidgetId 'phases'
    Update-Console -WidgetId overall -Status Pass
    Write-Host 'Build completed: Artefacts\Packed\ConsoleMonster-PowerShellModule.v2.0.0.zip'
    Wait-ConsoleDashboard -Seconds 2
}
Full program
Import-Module ConsoleMonster

# A simulated module build pipeline: phases, steps with timings, module facts and the tool output.
# The script runs in a runspace ConsoleMonster owns: Write-Host, Write-Warning and Write-Verbose land in the log
# region instead of writing over the live screen.

$steps = @(
    @{ Phase = 'Prepare'; Key = 'config'; Label = 'Read Build/project.build.json'; Seconds = 0.5; Result = 'Pass' }
    @{ Phase = 'Restore'; Key = 'restore'; Label = 'Restore NuGet packages'; Seconds = 1.5; Result = 'Pass' }
    @{ Phase = 'Build'; Key = 'core'; Label = 'Compile ConsoleMonster (3 frameworks)'; Seconds = 2.5; Result = 'Pass' }
    @{ Phase = 'Build'; Key = 'ps'; Label = 'Compile ConsoleMonster.PowerShell'; Seconds = 1.5; Result = 'Pass' }
    @{ Phase = 'Test'; Key = 'xunit'; Label = 'Run xUnit tests'; Seconds = 2.5; Result = 'Pass' }
    @{ Phase = 'Test'; Key = 'pester'; Label = 'Run Pester tests'; Seconds = 2.0; Result = 'Warn' }
    @{ Phase = 'Docs'; Key = 'docs'; Label = 'Generate help (38 commands)'; Seconds = 1.5; Result = 'Pass' }
    @{ Phase = 'Package'; Key = 'pack'; Label = 'Pack module and NuGet package'; Seconds = 1.5; Result = 'Pass' }
    @{ Phase = 'Publish'; Key = 'publish'; Label = 'Publish to PowerShell Gallery'; Seconds = 0.3; Result = 'Skip' }
)

$dashboard = New-ConsoleDashboard -Title '[bold]Module build[/]' -Subtitle 'Build-Module ConsoleMonster' -Gap 1 -Content {
    New-ConsoleStatusList -Layout Strip -WidgetId phases -Content { 'Prepare', 'Restore', 'Build', 'Test', 'Docs', 'Package', 'Publish' }
    New-ConsoleColumns -Content {
        New-ConsolePanel -Title 'Steps' -Weight 1.5 -Content { New-ConsoleStatusList -WidgetId steps -Content { $steps.Label } }
        New-ConsolePanel -Title 'Module' -Content {
            New-ConsoleKeyValue -WidgetId module -InputObject ([ordered] @{ Module = 'ConsoleMonster'; Version = '2.0.0'; Frameworks = 'netstandard2.0 · net472 · net8.0'; Elapsed = '-' })
            New-ConsoleRule
            New-ConsoleProgress -WidgetId overall -Label 'Overall' -Total $steps.Count
        }
    }
    New-ConsolePanel -Title 'Output' -Fill -Content { New-ConsoleLogRegion }
}

# Planned step durations drive the displayed clocks; dashboard waits keep normal playback paced in real time.
$clock = New-Object ConsoleMonster.Live.SimulatedClock -ArgumentList (0)
Invoke-ConsoleDashboard $dashboard -Clock $clock -ArgumentList $clock, $steps {
    param($Clock, $Steps)
    $phase = $null
    $index = 0
    foreach ($step in $Steps) {
        if ($step.Phase -ne $phase) {
            if ($phase) {
                Update-Console -Key $phase -Status Pass -WidgetId 'phases'
            }
            $phase = $step.Phase
            Update-Console -Key $phase -Status Running -WidgetId 'phases'
        }
        Update-Console -WidgetId steps -Key $step.Label -Status Running
        Write-Host "$($step.Label)..."
        Wait-ConsoleDashboard -Seconds $step.Seconds
        $Clock.Advance($step.Seconds)
        if ($step.Result -eq 'Warn') {
            Write-Warning '1 Pester test skipped on PowerShell 7 (requires conhost)'
        }
        Update-Console -WidgetId steps -Key $step.Label -Status $step.Result -Detail ($step.Seconds.ToString('0.0', [cultureinfo]::InvariantCulture) + 's')
        $index++
        Update-Console -WidgetId overall -Value $index
        Update-Console -WidgetId module -Key Elapsed -Value ($Clock.Elapsed.TotalSeconds.ToString('0.0', [cultureinfo]::InvariantCulture) + 's')
    }
    Update-Console -Key $phase -Status Skip -WidgetId 'phases'
    Update-Console -WidgetId overall -Status Pass
    Write-Host 'Build completed: Artefacts\Packed\ConsoleMonster-PowerShellModule.v2.0.0.zip'
    Wait-ConsoleDashboard -Seconds 2
}
C#Program.cs
// A simulated module build as a live dashboard: phases, steps with timings, module facts, a progress bar and the tool's own
// output. The build writes to Console.Out like any tool; the session captures those lines into the Output panel.
Step[] plan =
{
    new("Prepare", "config", "Read Build/project.build.json", 0.4, StatusKind.Pass,
        "Loaded project.build.json (3 projects, version 2.0.X)",
        "Resolved version 2.0.0 from PowerShell Gallery (current 0.0.4)"),
    new("Prepare", "manifest", "Update Orion.psd1", 0.5, StatusKind.Pass,
        "ModuleVersion 0.0.4 -> 2.0.0", "CmdletsToExport: 38 binary cmdlets"),
    // … 32 more lines in the full program
};
Phases phases = new Phases();
foreach (string phase in new[]
{
    "Prepare", "Restore", "Build", "Test", "Docs", "Sign", "Package", "Publish"
}

)
{
    phases.Set(phase);
}

StatusList steps = new StatusList("steps");
foreach (Step step in plan)
{
    steps.Set(step.Key, step.Label, StatusKind.Pending);
}

KeyValueList module = new KeyValueList("module")
    .Add("Module", "[bold]Orion[/]")
    .Add("Version", "0.0.4 [muted]→[/] [bold]2.0.0[/]")
    .Add("Frameworks", "netstandard2.0 · net472 · net8.0")
    .Add("PowerShell", "5.1 Desktop · 7.x Core")
    .Add("Run mode", "Build [muted](publish disabled)[/]")
    .Add("Elapsed", "-");
ProgressBar progress = new ProgressBar("Overall", "overall").Total(plan.Length).LabelWidth(8);
Dashboard dashboard = Ui.Dashboard().Title("[bold]Module build[/]")
    .Subtitle("Build-Module Orion")
    .Content(body => body
        .Add(new Padding(phases, 1, 0, 1, 1))
        .Columns(columns => columns.Content(c => c.Add(new Panel(steps, "Steps").Fill(1.5))
            .Add(new Panel(new Rows(module, new Rule(), progress), "Module").Fill(1))))
        .Add(new Panel(new LogRegion { PreferredHeight = 8 }, "Output").Fill()));
Table summary = new Table()
    .Border(TableBorder.Minimal)
    .Title("[bold]Build summary[/] [muted]Orion 2.0.0[/]")
    .Column("Phase")
    .Column("Step", c => c.Flexible())
    .Column("Result")
    .Column("Duration");

// Planned step durations drive the displayed clocks; session delays keep normal playback paced in real time.
SimulatedClock clock = new SimulatedClock();
using (LiveSession session = new LiveSession(
    dashboard,
    new LiveSessionOptions { Clock = clock.Read, Summary = new Padding(summary, 1, 1, 1, 1) }))
{
    session.Run(Build);
}

void Build(LiveSession session)
// … 90 more lines in the full program
record Step(string Phase, string Key, string Label, double Seconds, StatusKind Result,
    params string[] Output);
Full program
using ConsoleMonster;
using ConsoleMonster.Layout;
using ConsoleMonster.Live;
using ConsoleMonster.Styling;
using ConsoleMonster.Text;
using ConsoleMonster.Widgets;

// A simulated module build as a live dashboard: phases, steps with timings, module facts, a progress bar and the tool's own
// output. The build writes to Console.Out like any tool; the session captures those lines into the Output panel.
Step[] plan =
{
    new("Prepare", "config", "Read Build/project.build.json", 0.4, StatusKind.Pass,
        "Loaded project.build.json (3 projects, version 2.0.X)",
        "Resolved version 2.0.0 from PowerShell Gallery (current 0.0.4)"),
    new("Prepare", "manifest", "Update Orion.psd1", 0.5, StatusKind.Pass,
        "ModuleVersion 0.0.4 -> 2.0.0", "CmdletsToExport: 38 binary cmdlets"),
    new("Restore", "restore", "Restore NuGet packages", 1.6, StatusKind.Pass,
        "Restored Orion.csproj (in 412 ms)",
        "Restored Orion.PowerShell.csproj (in 380 ms)"),
    new("Build", "core-ns", "Compile Orion (netstandard2.0)", 1.8, StatusKind.Pass,
        "Orion -> bin\\Release\\netstandard2.0\\Orion.dll"),
    new("Build", "core-fx", "Compile Orion (net472)", 1.5, StatusKind.Pass,
        "Orion -> bin\\Release\\net472\\Orion.dll"),
    new("Build", "core-net", "Compile Orion (net8.0)", 1.4, StatusKind.Pass,
        "Orion -> bin\\Release\\net8.0\\Orion.dll"),
    new("Build", "ps", "Compile Orion.PowerShell", 1.9, StatusKind.Pass,
        "Orion.PowerShell -> bin\\Release\\net472\\Orion.PowerShell.dll",
        "Orion.PowerShell -> bin\\Release\\net8.0\\Orion.PowerShell.dll"),
    new("Test", "xunit", "Run xUnit tests (net472, net8.0)", 3.2, StatusKind.Pass,
        "Passed!  - Failed: 0, Passed: 286, Skipped: 0 - Orion.Tests.dll (net472)",
        "Passed!  - Failed: 0, Passed: 286, Skipped: 0 - Orion.Tests.dll (net8.0)"),
    new("Test", "pester5", "Run Pester tests (Windows PowerShell 5.1)", 2.4, StatusKind.Pass,
        "Tests completed in 2.1s", "Tests Passed: 41, Failed: 0, Skipped: 0"),
    new("Test", "pester7", "Run Pester tests (PowerShell 7.5)", 2.1, StatusKind.Warn,
        "Tests completed in 1.8s", "Tests Passed: 40, Failed: 0, Skipped: 1 (requires conhost)"),
    new("Docs", "md", "Generate markdown help (38 commands)", 1.7, StatusKind.Pass,
        "Docs\\Readme.md updated",
        "Docs\\Show-ConsoleTable.md ... Docs\\Invoke-ConsoleDashboard.md"),
    new("Docs", "maml", "Generate en-US MAML help", 0.9, StatusKind.Pass,
        "en-US\\Orion.PowerShell.dll-Help.xml (412 KB)"),
    new("Sign", "sign", "Sign module files", 0.3, StatusKind.Skip,
        "SignModule is $false for this build; skipping Authenticode signing"),
    new("Package", "nupkg", "Pack Orion.2.0.0.nupkg", 1.2, StatusKind.Pass,
        "Successfully created package 'Artefacts\\ProjectBuild\\Orion.2.0.0.nupkg'."),
    new("Package", "zip", "Create module archive", 0.8, StatusKind.Pass,
        "Artefacts\\Packed\\Orion-v2.0.0.zip (1.1 MB)"),
    new("Publish", "publish", "Publish to PowerShell Gallery", 0.3, StatusKind.Skip,
        "RunMode is Build; publishing is disabled")
};
Phases phases = new Phases();
foreach (string phase in new[]
{
    "Prepare", "Restore", "Build", "Test", "Docs", "Sign", "Package", "Publish"
}

)
{
    phases.Set(phase);
}

StatusList steps = new StatusList("steps");
foreach (Step step in plan)
{
    steps.Set(step.Key, step.Label, StatusKind.Pending);
}

KeyValueList module = new KeyValueList("module")
    .Add("Module", "[bold]Orion[/]")
    .Add("Version", "0.0.4 [muted]→[/] [bold]2.0.0[/]")
    .Add("Frameworks", "netstandard2.0 · net472 · net8.0")
    .Add("PowerShell", "5.1 Desktop · 7.x Core")
    .Add("Run mode", "Build [muted](publish disabled)[/]")
    .Add("Elapsed", "-");
ProgressBar progress = new ProgressBar("Overall", "overall").Total(plan.Length).LabelWidth(8);
Dashboard dashboard = Ui.Dashboard().Title("[bold]Module build[/]")
    .Subtitle("Build-Module Orion")
    .Content(body => body
        .Add(new Padding(phases, 1, 0, 1, 1))
        .Columns(columns => columns.Content(c => c.Add(new Panel(steps, "Steps").Fill(1.5))
            .Add(new Panel(new Rows(module, new Rule(), progress), "Module").Fill(1))))
        .Add(new Panel(new LogRegion { PreferredHeight = 8 }, "Output").Fill()));
Table summary = new Table()
    .Border(TableBorder.Minimal)
    .Title("[bold]Build summary[/] [muted]Orion 2.0.0[/]")
    .Column("Phase")
    .Column("Step", c => c.Flexible())
    .Column("Result")
    .Column("Duration");

// Planned step durations drive the displayed clocks; session delays keep normal playback paced in real time.
SimulatedClock clock = new SimulatedClock();
using (LiveSession session = new LiveSession(
    dashboard,
    new LiveSessionOptions { Clock = clock.Read, Summary = new Padding(summary, 1, 1, 1, 1) }))
{
    session.Run(Build);
}

void Build(LiveSession session)
{
    PhasesHandle phasesHandle = phases.Handle(session);
    StatusListHandle stepsHandle = steps.Handle(session);
    KeyValueHandle moduleHandle = module.Handle(session);
    ProgressHandle progressHandle = progress.Handle(session);
    string? currentPhase = null;
    List<StatusKind> phaseResults = new List<StatusKind>();
    session.Post(new LiveEvent("dashboard", "status", default, "building", "running"));
    Console.WriteLine("Build engine 3.0.168 · release pipeline");
    int index = 0;
    foreach (Step step in plan)
    {
        if (session.Cancellation.IsCancellationRequested)
        {
            break;
        }

        if (step.Phase != currentPhase)
        {
            if (currentPhase != null)
            {
                phasesHandle.Complete(currentPhase, Worst(phaseResults));
            }

            currentPhase = step.Phase;
            phaseResults.Clear();
            phasesHandle.Start(currentPhase);
        }

        stepsHandle.Set(step.Key, StatusKind.Running);
        progressHandle.Label(step.Phase);
        TimeSpan stepStart = clock.Elapsed;
        TimeSpan stepDuration = TimeSpan.FromSeconds(step.Seconds);
        int slices = Math.Max(1, (int)(step.Seconds * 10));
        for (int i = 0; i < slices && !session.Cancellation.IsCancellationRequested; i++)
        {
            TimeSpan next = stepStart + TimeSpan.FromTicks(stepDuration.Ticks * (i + 1) / slices);
            TimeSpan slice = next - clock.Elapsed;
            session.Delay(slice);
            clock.Advance(slice);
            if (i < step.Output.Length)
            {
                Console.WriteLine(step.Output[i]);
            }

            if (i % 5 == 0)
            {
                moduleHandle.Set("Elapsed", NumberFormat.Duration(clock.Elapsed));
            }
        }

        for (int i = slices; i < step.Output.Length; i++)
        {
            Console.WriteLine(step.Output[i]);
        }

        if (step.Result == StatusKind.Warn)
        {
            Console.Error.WriteLine(
                "WARNING: 1 Pester test skipped on PowerShell 7 (requires conhost).");
        }

        string duration = NumberFormat.Duration(clock.Elapsed - stepStart);
        stepsHandle.Set(step.Key, step.Result);
        stepsHandle.Detail(step.Key, step.Result == StatusKind.Skip ? "skipped" : duration);
        phaseResults.Add(step.Result);
        summary.Row(step.Phase, Markup.Escape(step.Label), TableCell.ForStatus(step.Result),
            step.Result == StatusKind.Skip ? "-" : duration);
        index++;
        progressHandle.Set(index);
    }

    if (currentPhase != null)
    {
        phasesHandle.Complete(currentPhase, Worst(phaseResults));
    }

    moduleHandle.Set("Elapsed", NumberFormat.Duration(clock.Elapsed));
    progressHandle.Complete(StatusKind.Pass);
    Console.WriteLine("Build completed: 2 artefacts in Artefacts\\ (nupkg, zip)");
    session.Post(new LiveEvent("dashboard", "status", default, "build succeeded with 1 warning",
        "warn"));
    session.Delay(TimeSpan.FromMilliseconds(1500));
}

static StatusKind Worst(List<StatusKind> results) => results.Contains(StatusKind.Fail)
    ? StatusKind.Fail
    : results.Contains(StatusKind.Warn)
        ? StatusKind.Warn
        : results.TrueForAll(r => r == StatusKind.Skip) ? StatusKind.Skip : StatusKind.Pass;
record Step(string Phase, string Key, string Label, double Seconds, StatusKind Result,
    params string[] Output);

What stays in the scrollback

When the session ends the screen is restored and the summary is printed to the scrollback, so a live dashboard always leaves a record behind. This is the C# run's summary.

after the session ends 69×22

The same run in CI

With CONSOLEMONSTER_MODE=stream, with redirected output or when a CI system is detected, a live dashboard narrates append-only lines instead of redrawing. This is the replay program above, run with the variable set, at six times speed.

CONSOLEMONSTER_MODE=stream 100 columnsstream mode
PowerShell
$env:CONSOLEMONSTER_MODE = 'stream'
dotnet run -- assessment-run.jsonl 6
Remove-Item Env:CONSOLEMONSTER_MODE
bash
CONSOLEMONSTER_MODE=stream dotnet run -- assessment-run.jsonl 6

Printed once: query results

Not every tool needs a live view. This program prints a summary, the records, a delegation tree, mail-security checks and resolver latency once, at the width of the console.

dotnet run 100 columns24-bitFull
C#Program.cs
// DNS and mail-security query results, printed once: no live view. A summary, the records as a typed table, the
// delegation as a tree, the checks as a status list and the resolver latency as bars.
DnsRecord[] records =
{
    new("evotec.xyz", "A", "300", "104.21.48.12"),
    new("evotec.xyz", "A", "300", "172.67.161.94"),
    // … 12 more lines in the full program
};
KeyValueList summary = new KeyValueList()
    .Add("Domain", "[bold]evotec.xyz[/]")
    .Add("Resolver", "Cloudflare DNS over HTTPS [muted](1.1.1.1)[/]")
    .Add("Query time", "38 ms [muted]for 7 record types[/]")
    .Add("Records", "14")
    .Add("DNSSEC", "not signed", StatusKind.Warn);
Table table = Table.For(records)
    .Expand()
    .HeaderSeparator(false)
    .Column(r => r.Name, c => c.Wrap(false))
    .Column(r => r.Type, c => c.Wrap(false))
    .Column(r => r.Ttl, c => c.Header("TTL").Alignment(HorizontalAlignment.Right))
    .Column(r => r.Data, c => c.Flexible());
Tree delegation = new Tree("[bold].[/] [muted]root[/]");
TreeNode xyz = delegation.Add("[bold]xyz.[/]", default, "6 name servers");
xyz.Add("x.nic.xyz", default, "194.169.218.42");
xyz.Add("y.nic.xyz", default, "185.24.64.42");
TreeNode evotec = xyz.Add("[bold]evotec.xyz.[/]", default, "2 name servers");
evotec.Add("dana.ns.cloudflare.com", StatusKind.Pass, "108.162.192.103 · 12 ms");
evotec.Add("kirk.ns.cloudflare.com", StatusKind.Pass, "172.64.33.149 · 14 ms");
evotec.Add("mail", default, "MX target")
    .Add("evotec-xyz.mail.protection.outlook.com", StatusKind.Pass, "52.101.68.17");
StatusList checks = new StatusList()
    .Add("SPF record present and valid", StatusKind.Pass, "9 lookups")
    .Add("DMARC policy enforced", StatusKind.Pass, "p=reject")
    .Add("DKIM selector1 / selector2", StatusKind.Pass, "2048-bit")
    .Add("MTA-STS policy", StatusKind.Warn, "not published")
    .Add("TLS-RPT reporting", StatusKind.Warn, "not published")
    .Add("DNSSEC chain of trust", StatusKind.Fail, "zone not signed")
    .Add("BIMI record", StatusKind.Skip, "optional");
BarChart latency = new BarChart("latency")
    .Unit(" ms")
    .Add("Cloudflare", 12)
    .Add("Google", 18)
    .Add("Quad9", 24)
    .Add("OpenDNS", 31)
    .Add("System resolver", 47);
Terminal.Write(new Rows()
    .Gap(1)
    .Add(new Rule("[bold]DNS query results[/] [muted]· evotec.xyz[/]"))
    .Add(new Padding(summary, 1, 0, 1, 0))
    .Add(table)
    .Add(new Columns(
        new Panel(delegation, "Delegation"),
        new Panel(new Rows(checks, new Rule(), latency), "Mail security")
            .HeaderRight("evotec.xyz"))));

record DnsRecord(string Name, string Type, string Ttl, string Data);
Full program
using ConsoleMonster;
using ConsoleMonster.Layout;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;

// DNS and mail-security query results, printed once: no live view. A summary, the records as a typed table, the
// delegation as a tree, the checks as a status list and the resolver latency as bars.
DnsRecord[] records =
{
    new("evotec.xyz", "A", "300", "104.21.48.12"),
    new("evotec.xyz", "A", "300", "172.67.161.94"),
    new("evotec.xyz", "AAAA", "300", "2606:4700:3036::6815:300c"),
    new("evotec.xyz", "MX", "3600", "10 evotec-xyz.mail.protection.outlook.com"),
    new("evotec.xyz", "NS", "86400", "dana.ns.cloudflare.com"),
    new("evotec.xyz", "NS", "86400", "kirk.ns.cloudflare.com"),
    new("evotec.xyz", "TXT", "3600",
        ("v=spf1 include:spf.protection.outlook.com include:_spf.google.com "
            + "include:sendgrid.net ip4:51.38.120.9 -all")),
    new("_dmarc.evotec.xyz", "TXT", "3600",
        "v=DMARC1; p=reject; rua=mailto:[email protected]; ruf=mailto:[email protected]; fo=1"),
    new("evotec.xyz", "CAA", "3600", "0 issue \"letsencrypt.org\""),
    new("evotec.xyz", "SOA", "3600",
        "dana.ns.cloudflare.com. dns.cloudflare.com. 2351234567 10000 2400 604800 3600")
};
KeyValueList summary = new KeyValueList()
    .Add("Domain", "[bold]evotec.xyz[/]")
    .Add("Resolver", "Cloudflare DNS over HTTPS [muted](1.1.1.1)[/]")
    .Add("Query time", "38 ms [muted]for 7 record types[/]")
    .Add("Records", "14")
    .Add("DNSSEC", "not signed", StatusKind.Warn);
Table table = Table.For(records)
    .Expand()
    .HeaderSeparator(false)
    .Column(r => r.Name, c => c.Wrap(false))
    .Column(r => r.Type, c => c.Wrap(false))
    .Column(r => r.Ttl, c => c.Header("TTL").Alignment(HorizontalAlignment.Right))
    .Column(r => r.Data, c => c.Flexible());
Tree delegation = new Tree("[bold].[/] [muted]root[/]");
TreeNode xyz = delegation.Add("[bold]xyz.[/]", default, "6 name servers");
xyz.Add("x.nic.xyz", default, "194.169.218.42");
xyz.Add("y.nic.xyz", default, "185.24.64.42");
TreeNode evotec = xyz.Add("[bold]evotec.xyz.[/]", default, "2 name servers");
evotec.Add("dana.ns.cloudflare.com", StatusKind.Pass, "108.162.192.103 · 12 ms");
evotec.Add("kirk.ns.cloudflare.com", StatusKind.Pass, "172.64.33.149 · 14 ms");
evotec.Add("mail", default, "MX target")
    .Add("evotec-xyz.mail.protection.outlook.com", StatusKind.Pass, "52.101.68.17");
StatusList checks = new StatusList()
    .Add("SPF record present and valid", StatusKind.Pass, "9 lookups")
    .Add("DMARC policy enforced", StatusKind.Pass, "p=reject")
    .Add("DKIM selector1 / selector2", StatusKind.Pass, "2048-bit")
    .Add("MTA-STS policy", StatusKind.Warn, "not published")
    .Add("TLS-RPT reporting", StatusKind.Warn, "not published")
    .Add("DNSSEC chain of trust", StatusKind.Fail, "zone not signed")
    .Add("BIMI record", StatusKind.Skip, "optional");
BarChart latency = new BarChart("latency")
    .Unit(" ms")
    .Add("Cloudflare", 12)
    .Add("Google", 18)
    .Add("Quad9", 24)
    .Add("OpenDNS", 31)
    .Add("System resolver", 47);
Terminal.Write(new Rows()
    .Gap(1)
    .Add(new Rule("[bold]DNS query results[/] [muted]· evotec.xyz[/]"))
    .Add(new Padding(summary, 1, 0, 1, 0))
    .Add(table)
    .Add(new Columns(
        new Panel(delegation, "Delegation"),
        new Panel(new Rows(checks, new Rule(), latency), "Mail security")
            .HeaderRight("evotec.xyz"))));

record DnsRecord(string Name, string Type, string Ttl, string Data);

Run them yourself

Every dashboard on this page is a complete program; the recordings are what those programs drew in a terminal window of the size shown.

  1. dotnet new console -n Live, then cd Live and dotnet add package ConsoleMonster.
  2. Replace Program.cs with a program from this page (Copy on its panel).
  3. dotnet run. The stress test takes the seconds to run (dotnet run -- 12); the replay takes the recording and the speed (dotnet run -- assessment-run.jsonl 2), so download the recording into the project folder first.

The PowerShell build pipeline runs with Install-Module ConsoleMonster -Scope CurrentUser, then the script.

Without JavaScript, each player shows a frame from the middle of its run. With reduced motion, nothing plays until you press play.