Skip to content
ConsoleMonster

Prompts, menus and forms

Questions, menus, wizards and a grid for Windows PowerShell 5.1 and PowerShell 7, by keyboard or mouse. Every screen was drawn by scripted keys and clicks.

Server toolbox 120×3424-bitFull

Every story below is a complete program, PowerShell first and C# second, and the screens beside it are what that program drew for the input listed under it. Lists filter as you type, the footer lists the keys that work right now and ? shows them all, and answers come back as typed values or as the chosen objects themselves.

The mouse works wherever the keyboard does: click a row, a header, a tab or a hint in the footer, drag a scroll bar or a divider, double-click to open, and right-click in an app for the keys that work there. InteractiveOptions.Default.Mouse = false or CONSOLEMONSTER_NOMOUSE=1 turns it off. For whole apps built from panes, charts, folding sections and outlines, see the incident workbench, driven entirely by the mouse, and the chart and table, help sections and settings tabs demos. App parts, one by one shows each of those parts on its own, in PowerShell and C#.

To run one yourself:

  1. PowerShell 5.1 or 7: Install-Module ConsoleMonster -Scope CurrentUser, save the script and run it in a console window.
  2. .NET 8 or later: dotnet new console, then dotnet add package ConsoleMonster, replace Program.cs with the C# program and dotnet run.

When nobody can answer (CI, redirected input, pwsh -NonInteractive, CONSOLEMONSTER_NONINTERACTIVE=1), a prompt returns its default or fails with a message that names the parameter to pass. In remoting and the ISE, prompts ask through the host, and CONSOLEMONSTER_ACCESSIBLE=1 switches to plain numbered questions.

Selection

A list that filters as you type, with groups, badges, and choices that are unavailable with their reason. The answer comes back as the chosen object, not a string.

Selection 100×1624-bitFull

Input Down Down "we" Down Enter

PowerShellselect.ps1
$servers = @(
    [pscustomobject] @{ Name = 'FS01'; Site = 'Warsaw'; Role = 'File' }
    [pscustomobject] @{ Name = 'FS02'; Site = 'Warsaw'; Role = 'File' }
    # … 11 more lines in the full program
)

$selectParameters = @{
    Choices = $servers
    Display = 'Name'
    GroupBy = 'Site'
    Badge = 'Role'
    Description = 'Type to filter; offline servers show why they cannot be picked.'
}
$server = Read-ConsoleSelect 'Target server' @selectParameters -DisabledReason {
    $_.Offline
}
Write-ConsoleText -Markup "Connecting to [bold]$($server.Name)[/]"
Full program
Import-Module ConsoleMonster

$servers = @(
    [pscustomobject] @{ Name = 'FS01'; Site = 'Warsaw'; Role = 'File' }
    [pscustomobject] @{ Name = 'FS02'; Site = 'Warsaw'; Role = 'File' }
    [pscustomobject] @{ Name = 'WEB01'; Site = 'Warsaw'; Role = 'Web' }
    [pscustomobject] @{ Name = 'SQL01'; Site = 'Warsaw'; Role = 'Database' }
    [pscustomobject] @{ Name = 'FS11'; Site = 'Berlin'; Role = 'File' }
    [pscustomobject] @{ Name = 'WEB11'; Site = 'Berlin'; Role = 'Web' }
    [pscustomobject] @{ Name = 'PRN11'; Site = 'Berlin'; Role = 'Print'
        Offline = 'offline since 09:12' }
    [pscustomobject] @{ Name = 'BKP21'; Site = 'Dublin'; Role = 'Backup' }
    [pscustomobject] @{ Name = 'SQL21'; Site = 'Dublin'; Role = 'Database' }
    [pscustomobject] @{ Name = 'LAB01'; Site = 'Lab'; Role = 'Test' }
    [pscustomobject] @{ Name = 'LAB02'; Site = 'Lab'; Role = 'Test'
        Offline = 'in maintenance until Friday' }
)

$selectParameters = @{
    Choices = $servers
    Display = 'Name'
    GroupBy = 'Site'
    Badge = 'Role'
    Description = 'Type to filter; offline servers show why they cannot be picked.'
}
$server = Read-ConsoleSelect 'Target server' @selectParameters -DisabledReason {
    $_.Offline
}
Write-ConsoleText -Markup "Connecting to [bold]$($server.Name)[/]"
C#Program.cs
Server[] servers = {
    new("FS01", "Warsaw", "File"),
    new("FS02", "Warsaw", "File"),
    // … 8 more lines in the full program
    new("LAB02", "Lab", "Test", "in maintenance until Friday")
};

SelectPrompt<Server> prompt = new SelectPrompt<Server>(
    "Target server",
    servers,
    s => s.Name,
    s => s.Site) {
    Description = "Type to filter; offline servers show why they cannot be picked."
};
foreach (Choice choice in prompt.Choices) {
    Server server = (Server)choice.Value!;
    choice.Badge = RichText.Plain(server.Role, new RichStyle(ThemeToken.Muted));
    choice.DisabledReason = server.Offline;
}
Server target = prompt.Show();
Terminal.WriteMarkupLine("Connecting to [bold]" + target.Name + "[/]");

record Server(string Name, string Site, string Role, string? Offline = null);
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Styling;
using ConsoleMonster.Text;

Server[] servers = {
    new("FS01", "Warsaw", "File"),
    new("FS02", "Warsaw", "File"),
    new("WEB01", "Warsaw", "Web"),
    new("SQL01", "Warsaw", "Database"),
    new("FS11", "Berlin", "File"),
    new("WEB11", "Berlin", "Web"),
    new("PRN11", "Berlin", "Print", "offline since 09:12"),
    new("BKP21", "Dublin", "Backup"),
    new("SQL21", "Dublin", "Database"),
    new("LAB01", "Lab", "Test"),
    new("LAB02", "Lab", "Test", "in maintenance until Friday")
};

SelectPrompt<Server> prompt = new SelectPrompt<Server>(
    "Target server",
    servers,
    s => s.Name,
    s => s.Site) {
    Description = "Type to filter; offline servers show why they cannot be picked."
};
foreach (Choice choice in prompt.Choices) {
    Server server = (Server)choice.Value!;
    choice.Badge = RichText.Plain(server.Role, new RichStyle(ThemeToken.Muted));
    choice.DisabledReason = server.Offline;
}
Server target = prompt.Show();
Terminal.WriteMarkupLine("Connecting to [bold]" + target.Name + "[/]");

record Server(string Name, string Site, string Role, string? Offline = null);
C# fluentProgram.cs
Server[] servers =
{
    new("FS01", "Warsaw", "File"),
    new("FS02", "Warsaw", "File"),
    new("WEB01", "Warsaw", "Web"),
    new("SQL01", "Warsaw", "Database"),
    new("FS11", "Berlin", "File"),
    new("WEB11", "Berlin", "Web"),
    new("PRN11", "Berlin", "Print", "offline since 09:12"),
    new("BKP21", "Dublin", "Backup"),
    new("SQL21", "Dublin", "Database"),
    new("LAB01", "Lab", "Test"),
    new("LAB02", "Lab", "Test", "in maintenance until Friday")
};
SelectQuestionOptions prompt = Ui.SelectQuestion()
    .Title("Target server")
    .Choices(Choice.From(servers, s => s.Name, s => s.Site))
    .Description("Type to filter; offline servers show why they cannot be picked.");
foreach (Choice choice in prompt.Choices)
{
    Server server = (Server)choice.Value!;
    choice.Badge(RichText.Plain(server.Role, new RichStyle(ThemeToken.Muted)))
        .DisabledReason(server.Offline);
}

Server target = prompt.Show<Server>();
Terminal.WriteMarkupLine("Connecting to [bold]" + target.Name + "[/]");

record Server(string Name, string Site, string Role, string? Offline = null);
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Styling;
using ConsoleMonster.Text;

Server[] servers =
{
    new("FS01", "Warsaw", "File"),
    new("FS02", "Warsaw", "File"),
    new("WEB01", "Warsaw", "Web"),
    new("SQL01", "Warsaw", "Database"),
    new("FS11", "Berlin", "File"),
    new("WEB11", "Berlin", "Web"),
    new("PRN11", "Berlin", "Print", "offline since 09:12"),
    new("BKP21", "Dublin", "Backup"),
    new("SQL21", "Dublin", "Database"),
    new("LAB01", "Lab", "Test"),
    new("LAB02", "Lab", "Test", "in maintenance until Friday")
};
SelectQuestionOptions prompt = Ui.SelectQuestion()
    .Title("Target server")
    .Choices(Choice.From(servers, s => s.Name, s => s.Site))
    .Description("Type to filter; offline servers show why they cannot be picked.");
foreach (Choice choice in prompt.Choices)
{
    Server server = (Server)choice.Value!;
    choice.Badge(RichText.Plain(server.Role, new RichStyle(ThemeToken.Muted)))
        .DisabledReason(server.Offline);
}

Server target = prompt.Show<Server>();
Terminal.WriteMarkupLine("Connecting to [bold]" + target.Name + "[/]");

record Server(string Name, string Site, string Role, string? Offline = null);

PowerShell 7 draws the same screens for the same keys.

Multi-selection with a preview

Tri-state group checkboxes, a live count and a preview pane beside the list. Ctrl+A selects all, Ctrl+N none and Ctrl+T inverts.

Multi-selection with a preview 110×2024-bitFull

Input Down Space Down Down Space Down Down Down Space Enter

PowerShellmulti.ps1
$allTasks = @(
    [pscustomobject] @{ Id = 'DiskCleanup'; Name = 'Disk cleanup'; Category = 'Maintenance'
        Description = 'Removes temporary files, old update caches and crash dumps older than 30 days.'
        Minutes = 3; Changes = $true }
    [pscustomobject] @{ Id = 'LogRotation'; Name = 'Log rotation'; Category = 'Maintenance'
        Description = 'Compresses application logs older than 7 days and deletes archives older than 90 days.'
        Minutes = 2; Changes = $true }
    # … 29 more lines in the full program
)

$tasks = $allTasks |
    Read-ConsoleSelect -Title 'Tasks' -Display Name -GroupBy Category -Minimum 1 -Preview {
        New-ConsoleRows -Gap 1 -Content {
            New-ConsoleText $_.Description
            New-ConsoleKeyValue -Markup -InputObject ([ordered] @{
                Group     = $_.Category
                Duration  = "about $($_.Minutes) min per server"
                Changes   = if ($_.Changes) { '[warn]yes[/], makes changes' }
                else { '[pass]no[/], read only' }
                Parameter = "[accent]$($_.Id)[/]"
            })
        }
    } -Multiple
Write-ConsoleText -Markup "Running [bold]$($tasks.Count)[/] tasks"
Full program
Import-Module ConsoleMonster

$allTasks = @(
    [pscustomobject] @{ Id = 'DiskCleanup'; Name = 'Disk cleanup'; Category = 'Maintenance'
        Description = 'Removes temporary files, old update caches and crash dumps older than 30 days.'
        Minutes = 3; Changes = $true }
    [pscustomobject] @{ Id = 'LogRotation'; Name = 'Log rotation'; Category = 'Maintenance'
        Description = 'Compresses application logs older than 7 days and deletes archives older than 90 days.'
        Minutes = 2; Changes = $true }
    [pscustomobject] @{ Id = 'RestartPending'; Name = 'Pending restart check'
        Category = 'Maintenance'
        Description = 'Reports servers waiting for a restart after updates or role changes.'
        Minutes = 1; Changes = $false }
    [pscustomobject] @{ Id = 'PatchStatus'; Name = 'Patch status'; Category = 'Security'
        Description = 'Lists missing security updates and the date of the last successful install.'
        Minutes = 2; Changes = $false }
    [pscustomobject] @{ Id = 'Certificates'; Name = 'Certificate expiry'; Category = 'Security'
        Description = 'Finds machine certificates that expire within 30 days and the services that use them.'
        Minutes = 1; Changes = $false }
    [pscustomobject] @{ Id = 'LocalAdmins'; Name = 'Local administrators audit'
        Category = 'Security'
        Description = 'Compares local Administrators membership with the approved list.'
        Minutes = 1; Changes = $false }
    [pscustomobject] @{ Id = 'Firewall'; Name = 'Firewall rules review'; Category = 'Security'
        Description = 'Flags inbound allow rules open to any address.'; Minutes = 2
        Changes = $false }
    [pscustomobject] @{ Id = 'EventErrors'; Name = 'Event log errors'; Category = 'Health'
        Description = 'Summarizes System and Application errors from the last 24 hours.'
        Minutes = 1; Changes = $false }
    [pscustomobject] @{ Id = 'Services'; Name = 'Service health'; Category = 'Health'
        Description = 'Checks that automatic services are running and restarts the ones that stopped.'
        Minutes = 1; Changes = $true }
    [pscustomobject] @{ Id = 'DiskSpace'; Name = 'Disk space'; Category = 'Health'
        Description = 'Warns below 15% free and fails below 5% free on every fixed volume.'
        Minutes = 1; Changes = $false }
    [pscustomobject] @{ Id = 'Uptime'; Name = 'Uptime and reboots'; Category = 'Health'
        Description = 'Reports uptime and unexpected reboots in the last 30 days.'; Minutes = 1
        Changes = $false }
)

$tasks = $allTasks |
    Read-ConsoleSelect -Title 'Tasks' -Display Name -GroupBy Category -Minimum 1 -Preview {
        New-ConsoleRows -Gap 1 -Content {
            New-ConsoleText $_.Description
            New-ConsoleKeyValue -Markup -InputObject ([ordered] @{
                Group     = $_.Category
                Duration  = "about $($_.Minutes) min per server"
                Changes   = if ($_.Changes) { '[warn]yes[/], makes changes' }
                else { '[pass]no[/], read only' }
                Parameter = "[accent]$($_.Id)[/]"
            })
        }
    } -Multiple
Write-ConsoleText -Markup "Running [bold]$($tasks.Count)[/] tasks"
C#Program.cs
MaintenanceTask[] all =
{
    new("DiskCleanup", "Disk cleanup", "Maintenance",
        "Removes temporary files, old update caches and crash dumps older than 30 days.", 3, true),
    new("LogRotation", "Log rotation", "Maintenance",
        "Compresses application logs older than 7 days and deletes archives older than 90 days.", 2,
        true),
    // … 19 more lines in the full program
};
IReadOnlyList<MaintenanceTask> tasks = new MultiSelectPrompt<MaintenanceTask>(
    "Tasks",
    all,
    t => t.Name,
    t => t.Category)
{
    Minimum = 1,
    Preview = t => new Rows(
        TextBlock.FromMarkup(Markup.Escape(t.Description)),
        new KeyValueList()
            .Add("Group", Markup.Escape(t.Category))
            .Add("Duration", "about " + t.Minutes + " min per server")
            .Add("Changes", t.Changes ? "[warn]yes[/], makes changes" : "[pass]no[/], read only")
            .Add("Parameter", "[accent]" + Markup.Escape(t.Id) + "[/]"))
    {
        Gap = 1
    }
}.Show();
Terminal.WriteMarkupLine("Running [bold]" + tasks.Count + "[/] tasks");

record MaintenanceTask(string Id, string Name, string Category, string Description, int Minutes,
    bool Changes);
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Text;
using ConsoleMonster.Widgets;

MaintenanceTask[] all =
{
    new("DiskCleanup", "Disk cleanup", "Maintenance",
        "Removes temporary files, old update caches and crash dumps older than 30 days.", 3, true),
    new("LogRotation", "Log rotation", "Maintenance",
        "Compresses application logs older than 7 days and deletes archives older than 90 days.", 2,
        true),
    new("RestartPending", "Pending restart check", "Maintenance",
        "Reports servers waiting for a restart after updates or role changes.", 1, false),
    new("PatchStatus", "Patch status", "Security",
        "Lists missing security updates and the date of the last successful install.", 2, false),
    new("Certificates", "Certificate expiry", "Security",
        "Finds machine certificates that expire within 30 days and the services that use them.", 1,
        false),
    new("LocalAdmins", "Local administrators audit", "Security",
        "Compares local Administrators membership with the approved list.", 1, false),
    new("Firewall", "Firewall rules review", "Security",
        "Flags inbound allow rules open to any address.", 2, false),
    new("EventErrors", "Event log errors", "Health",
        "Summarizes System and Application errors from the last 24 hours.", 1, false),
    new("Services", "Service health", "Health",
        "Checks that automatic services are running and restarts the ones that stopped.", 1, true),
    new("DiskSpace", "Disk space", "Health",
        "Warns below 15% free and fails below 5% free on every fixed volume.", 1, false),
    new("Uptime", "Uptime and reboots", "Health",
        "Reports uptime and unexpected reboots in the last 30 days.", 1, false)
};
IReadOnlyList<MaintenanceTask> tasks = new MultiSelectPrompt<MaintenanceTask>(
    "Tasks",
    all,
    t => t.Name,
    t => t.Category)
{
    Minimum = 1,
    Preview = t => new Rows(
        TextBlock.FromMarkup(Markup.Escape(t.Description)),
        new KeyValueList()
            .Add("Group", Markup.Escape(t.Category))
            .Add("Duration", "about " + t.Minutes + " min per server")
            .Add("Changes", t.Changes ? "[warn]yes[/], makes changes" : "[pass]no[/], read only")
            .Add("Parameter", "[accent]" + Markup.Escape(t.Id) + "[/]"))
    {
        Gap = 1
    }
}.Show();
Terminal.WriteMarkupLine("Running [bold]" + tasks.Count + "[/] tasks");

record MaintenanceTask(string Id, string Name, string Category, string Description, int Minutes,
    bool Changes);
C# fluentProgram.cs
MaintenanceTask[] all =
{
    new("DiskCleanup", "Disk cleanup", "Maintenance",
        "Removes temporary files, old update caches and crash dumps older than 30 days.", 3, true),
    new("LogRotation", "Log rotation", "Maintenance",
        "Compresses application logs older than 7 days and deletes archives older than 90 days.", 2,
        true),
    new("RestartPending", "Pending restart check", "Maintenance",
        "Reports servers waiting for a restart after updates or role changes.", 1, false),
    new("PatchStatus", "Patch status", "Security",
        "Lists missing security updates and the date of the last successful install.", 2, false),
    new("Certificates", "Certificate expiry", "Security",
        "Finds machine certificates that expire within 30 days and the services that use them.", 1,
        false),
    new("LocalAdmins", "Local administrators audit", "Security",
        "Compares local Administrators membership with the approved list.", 1, false),
    new("Firewall", "Firewall rules review", "Security",
        "Flags inbound allow rules open to any address.", 2, false),
    new("EventErrors", "Event log errors", "Health",
        "Summarizes System and Application errors from the last 24 hours.", 1, false),
    new("Services", "Service health", "Health",
        "Checks that automatic services are running and restarts the ones that stopped.", 1, true),
    new("DiskSpace", "Disk space", "Health",
        "Warns below 15% free and fails below 5% free on every fixed volume.", 1, false),
    new("Uptime", "Uptime and reboots", "Health",
        "Reports uptime and unexpected reboots in the last 30 days.", 1, false)
};
IReadOnlyList<MaintenanceTask> tasks = Ui.SelectQuestion()
    .Multiple()
    .Title("Tasks")
    .Choices(Choice.From(all, t => t.Name, t => t.Category))
    .Minimum(1)
    .PreviewBy(value => value is MaintenanceTask t ? Ui.Rows().Gap(1).Content(rowsContent =>
    {
        rowsContent.Markup(Markup.Escape(t.Description));
        rowsContent.KeyValue(kv => kv.Add("Group", Markup.Escape(t.Category))
            .Add("Duration", "about " + t.Minutes + " min per server")
            .Add("Changes", t.Changes ? "[warn]yes[/], makes changes" : "[pass]no[/], read only")
            .Add("Parameter", "[accent]" + Markup.Escape(t.Id) + "[/]"));
    }) : null)
    .ShowMany<MaintenanceTask>();
Terminal.WriteMarkupLine("Running [bold]" + tasks.Count + "[/] tasks");

record MaintenanceTask(string Id, string Name, string Category, string Description, int Minutes,
    bool Changes);
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Text;
using ConsoleMonster.Widgets;

MaintenanceTask[] all =
{
    new("DiskCleanup", "Disk cleanup", "Maintenance",
        "Removes temporary files, old update caches and crash dumps older than 30 days.", 3, true),
    new("LogRotation", "Log rotation", "Maintenance",
        "Compresses application logs older than 7 days and deletes archives older than 90 days.", 2,
        true),
    new("RestartPending", "Pending restart check", "Maintenance",
        "Reports servers waiting for a restart after updates or role changes.", 1, false),
    new("PatchStatus", "Patch status", "Security",
        "Lists missing security updates and the date of the last successful install.", 2, false),
    new("Certificates", "Certificate expiry", "Security",
        "Finds machine certificates that expire within 30 days and the services that use them.", 1,
        false),
    new("LocalAdmins", "Local administrators audit", "Security",
        "Compares local Administrators membership with the approved list.", 1, false),
    new("Firewall", "Firewall rules review", "Security",
        "Flags inbound allow rules open to any address.", 2, false),
    new("EventErrors", "Event log errors", "Health",
        "Summarizes System and Application errors from the last 24 hours.", 1, false),
    new("Services", "Service health", "Health",
        "Checks that automatic services are running and restarts the ones that stopped.", 1, true),
    new("DiskSpace", "Disk space", "Health",
        "Warns below 15% free and fails below 5% free on every fixed volume.", 1, false),
    new("Uptime", "Uptime and reboots", "Health",
        "Reports uptime and unexpected reboots in the last 30 days.", 1, false)
};
IReadOnlyList<MaintenanceTask> tasks = Ui.SelectQuestion()
    .Multiple()
    .Title("Tasks")
    .Choices(Choice.From(all, t => t.Name, t => t.Category))
    .Minimum(1)
    .PreviewBy(value => value is MaintenanceTask t ? Ui.Rows().Gap(1).Content(rowsContent =>
    {
        rowsContent.Markup(Markup.Escape(t.Description));
        rowsContent.KeyValue(kv => kv.Add("Group", Markup.Escape(t.Category))
            .Add("Duration", "about " + t.Minutes + " min per server")
            .Add("Changes", t.Changes ? "[warn]yes[/], makes changes" : "[pass]no[/], read only")
            .Add("Parameter", "[accent]" + Markup.Escape(t.Id) + "[/]"));
    }) : null)
    .ShowMany<MaintenanceTask>();
Terminal.WriteMarkupLine("Running [bold]" + tasks.Count + "[/] tasks");

record MaintenanceTask(string Id, string Name, string Category, string Description, int Minutes,
    bool Changes);

PowerShell 7 draws the same screens for the same keys.

Text with validation

A pattern, a length or a scriptblock validates the answer, and the message stays inline until the input is valid.

Text with validation 90×1024-bitFull

Input "9reports" Enter Home Delete Enter

PowerShelltext.ps1
$textParameters = @{
    Default = 'Reports'
    Pattern = '[A-Za-z][A-Za-z0-9_-]{1,23}'
    PatternMessage = 'Start with a letter; letters, digits, - and _ only'
    Description = 'Shown to users when they browse the server.'
}
$name = Read-ConsoleText 'Share name' @textParameters
Write-ConsoleText -Markup "Creating share [bold]$name[/]"
Full program
Import-Module ConsoleMonster

$textParameters = @{
    Default = 'Reports'
    Pattern = '[A-Za-z][A-Za-z0-9_-]{1,23}'
    PatternMessage = 'Start with a letter; letters, digits, - and _ only'
    Description = 'Shown to users when they browse the server.'
}
$name = Read-ConsoleText 'Share name' @textParameters
Write-ConsoleText -Markup "Creating share [bold]$name[/]"
C#Program.cs
string name = new TextPrompt("Share name")
{
    Default = "Reports",
    Pattern = "[A-Za-z][A-Za-z0-9_-]{1,23}",
    PatternMessage = "Start with a letter; letters, digits, - and _ only",
    Description = "Shown to users when they browse the server."
}.Show();
Terminal.WriteMarkupLine("Creating share [bold]" + name + "[/]");
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;

string name = new TextPrompt("Share name")
{
    Default = "Reports",
    Pattern = "[A-Za-z][A-Za-z0-9_-]{1,23}",
    PatternMessage = "Start with a letter; letters, digits, - and _ only",
    Description = "Shown to users when they browse the server."
}.Show();
Terminal.WriteMarkupLine("Creating share [bold]" + name + "[/]");
C# fluentProgram.cs
string name = Ui.TextQuestion()
    .Title("Share name")
    .Default("Reports")
    .Pattern("[A-Za-z][A-Za-z0-9_-]{1,23}")
    .PatternMessage("Start with a letter; letters, digits, - and _ only")
    .Description("Shown to users when they browse the server.")
    .Show();
Terminal.WriteMarkupLine("Creating share [bold]" + name + "[/]");
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;

string name = Ui.TextQuestion()
    .Title("Share name")
    .Default("Reports")
    .Pattern("[A-Za-z][A-Za-z0-9_-]{1,23}")
    .PatternMessage("Start with a letter; letters, digits, - and _ only")
    .Description("Shown to users when they browse the server.")
    .Show();
Terminal.WriteMarkupLine("Creating share [bold]" + name + "[/]");

PowerShell 7 draws the same screens for the same keys.

Typed confirmation

For destructive actions the name has to be typed; anything else keeps the prompt open.

Typed confirmation 90×1024-bitFull

Input "FS0" Enter "1" Enter

PowerShelltyped.ps1
$confirmParameters = @{
    TypedConfirmation = 'FS01'
    Warning = 'Its history and reports are deleted too. This cannot be undone.'
}
if (Read-ConsoleConfirm 'Remove FS01 from the inventory?' @confirmParameters) {
    Write-ConsoleText -Markup '[warn]FS01 removed[/]'
}
Full program
Import-Module ConsoleMonster

$confirmParameters = @{
    TypedConfirmation = 'FS01'
    Warning = 'Its history and reports are deleted too. This cannot be undone.'
}
if (Read-ConsoleConfirm 'Remove FS01 from the inventory?' @confirmParameters) {
    Write-ConsoleText -Markup '[warn]FS01 removed[/]'
}
C#Program.cs
bool remove = new TypedConfirmPrompt("Remove FS01 from the inventory?", "FS01")
{
    Warning = "Its history and reports are deleted too. This cannot be undone."
}.Show();
if (remove)
{
    Terminal.WriteMarkupLine("[warn]FS01 removed[/]");
}
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;

bool remove = new TypedConfirmPrompt("Remove FS01 from the inventory?", "FS01")
{
    Warning = "Its history and reports are deleted too. This cannot be undone."
}.Show();
if (remove)
{
    Terminal.WriteMarkupLine("[warn]FS01 removed[/]");
}
C# fluentProgram.cs
bool remove = Ui.TypedConfirmPrompt()
    .Title("Remove FS01 from the inventory?")
    .Expected("FS01")
    .Warning("Its history and reports are deleted too. This cannot be undone.")
    .Show();
if (remove)
{
    Terminal.WriteMarkupLine("[warn]FS01 removed[/]");
}
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;

bool remove = Ui.TypedConfirmPrompt()
    .Title("Remove FS01 from the inventory?")
    .Expected("FS01")
    .Warning("Its history and reports are deleted too. This cannot be undone.")
    .Show();
if (remove)
{
    Terminal.WriteMarkupLine("[warn]FS01 removed[/]");
}

PowerShell 7 draws the same screens for the same keys.

A menu as an app

The Shell layout: a breadcrumb title bar, a sidebar, the content pane and a footer that lists the keys that work right now. Ctrl+K opens the command palette, and the review shows the equivalent command line.

A menu as an app 120×3424-bitFull

Input wait:1600 Enter Space Down Space Down Down Down Space Escape Down Enter Down Down Down Down wait:300 Escape Ctrl+K "cert" wait:300 Escape Escape r wait:300 Ctrl+Q

C#Program.cs
// A "Server toolbox" in the Shell layout: targets loaded from an inventory, grouped tasks with a preview, an options
// form, presets, a review with the equivalent command and a run into a live dashboard. All data is invented.
Server[] inventory =
{
    new("FS01", "Warsaw", "File", "Windows Server 2022"),
    new("FS02", "Warsaw", "File", "Windows Server 2022"),
    // … 8 more lines in the full program
    new("LAB02", "Lab", "Test", "Windows Server 2025", "in maintenance until Friday")
};
MaintenanceTask[] allTasks =
{
    new("DiskCleanup", "Disk cleanup", "Maintenance",
        "Removes temporary files, old update caches and crash dumps older than 30 days.", 3, true),
    new("LogRotation", "Log rotation", "Maintenance",
        "Compresses application logs older than 7 days and deletes archives older than 90 days.", 2,
        true),
    // … 19 more lines in the full program
};
List<PastRun> history = new()
{
    new(new DateTime(2026, 10, 15, 21, 4, 0), 8, 5, 37, 2, 1, TimeSpan.FromMinutes(6.2)),
    new(new DateTime(2026, 10, 16, 7, 30, 0), 3, 2, 6, 0, 0, TimeSpan.FromMinutes(1.1)),
    new(new DateTime(2026, 10, 16, 18, 45, 0), 9, 11, 91, 6, 2, TimeSpan.FromMinutes(14.8))
};
Menu menu = new Menu("Server toolbox")
{
    Subtitle = "lab · 11 servers",
    Layout = MenuLayout.Shell
};
MenuItem targets = new MenuItem("Targets")
{
    Hotkey = 't',
    Icon = Icons.Targets,
    Description = ("Servers the tasks run on. The list is loaded from the inventory; offline servers "
        + "cannot be picked."),
    LoadChoices = (context, token) => LoadServersAsync(token)
};
targets.Minimum = 1;
MenuItem tasks = new MenuItem("Tasks")
{
    Hotkey = 'k',
    Icon = Icons.Tasks,
    Description = ("What to run on every target. Tasks marked 'changes' modify the servers; the rest "
        + "only read.")
}.MultiSelect(allTasks, t => t.Name, t => t.Category, TaskPreview);
foreach (Choice c in tasks.Choices)
{
    MaintenanceTask task = (MaintenanceTask)c.Value!;
    RichTextBuilder badge = new RichTextBuilder();
    if (task.Changes)
    {
        badge.Append("changes ", ThemeToken.Warn);
    }

    c.Badge = badge.Append("~" + task.Minutes + " min", ThemeToken.Muted).Build();
    c.Description = task.Description;
}

tasks.SetSelection(new object? [] { allTasks[0], allTasks[3], allTasks[4] });
Form options = OptionsForm();
MenuItem optionsItem = new MenuItem("Options")
{
    Hotkey = 'o',
    Icon = Icons.Settings,
    Description = "How the run behaves: parallelism, the report and notifications."
}.Form(options, (context, result) => context.Toast("Options saved"));
menu.Add(targets);
menu.Add(tasks);
menu.Add(optionsItem);
menu.Item("Presets", i =>
{
    i.Hotkey = 'p';
    i.Icon = Icons.Favorite;
    i.Description = "Saved combinations of targets, tasks and options. Save one from Review & run.";
    i.Presets();
});
menu.Separator();
menu.Item("Review & run", i =>
{
    i.Hotkey = 'r';
    i.Icon = Icons.Run;
    i.Review = Review;
});
menu.Item("History", i =>
{
    i.Hotkey = 'h';
    i.Page = context => HistoryPage();
    i.Detail = () => history.Count + " runs";
});
menu.Separator();
menu.Exit("Quit");
menu.CommandProviders.Add(new CommandProvider(
    "Task",
    () => allTasks.Select(task => new PaletteCommand("Toggle " + task.Name, context =>
    {
        List<object?> selection = tasks.Selection.ToList();
        bool on = selection.Remove(task);
        if (!on)
        {
            selection.Add(task);
        }

        tasks.SetSelection(allTasks.Where(t => selection.Contains(t)).Cast<object?>());
        context.Toast((on ? "Removed " : "Added ") + task.Name,
            on ? StatusKind.Info : StatusKind.Pass);
    }) { Description = task.Description })));
menu.Run(new MenuOptions { StorageRoot = Path.Combine(Path.GetTempPath(), "server-toolbox") });
async Task<IEnumerable<Choice>> LoadServersAsync(CancellationToken token)
// … 295 more lines in the full program

record Server(string Name, string Site, string Role, string OperatingSystem,
    string? Offline = null);

record MaintenanceTask(string Id, string Name, string Category, string Description, int Minutes,
    bool Changes);

record PastRun(DateTime When, int Servers, int Tasks, int Passed, int Warnings, int Failed,
    TimeSpan Elapsed);
Full program
using ConsoleMonster;
using System.Diagnostics;
using System.Globalization;
using ConsoleMonster.Glyphs;
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Styling;
using ConsoleMonster.Text;
using ConsoleMonster.Widgets;

// A "Server toolbox" in the Shell layout: targets loaded from an inventory, grouped tasks with a preview, an options
// form, presets, a review with the equivalent command and a run into a live dashboard. All data is invented.
Server[] inventory =
{
    new("FS01", "Warsaw", "File", "Windows Server 2022"),
    new("FS02", "Warsaw", "File", "Windows Server 2022"),
    new("WEB01", "Warsaw", "Web", "Windows Server 2025"),
    new("SQL01", "Warsaw", "Database", "Windows Server 2019"),
    new("FS11", "Berlin", "File", "Windows Server 2022"),
    new("WEB11", "Berlin", "Web", "Windows Server 2025"),
    new("PRN11", "Berlin", "Print", "Windows Server 2016", "offline since 09:12"),
    new("BKP21", "Dublin", "Backup", "Windows Server 2022"),
    new("SQL21", "Dublin", "Database", "Windows Server 2022"),
    new("LAB01", "Lab", "Test", "Windows Server 2025"),
    new("LAB02", "Lab", "Test", "Windows Server 2025", "in maintenance until Friday")
};
MaintenanceTask[] allTasks =
{
    new("DiskCleanup", "Disk cleanup", "Maintenance",
        "Removes temporary files, old update caches and crash dumps older than 30 days.", 3, true),
    new("LogRotation", "Log rotation", "Maintenance",
        "Compresses application logs older than 7 days and deletes archives older than 90 days.", 2,
        true),
    new("RestartPending", "Pending restart check", "Maintenance",
        "Reports servers waiting for a restart after updates or role changes.", 1, false),
    new("PatchStatus", "Patch status", "Security",
        "Lists missing security updates and the date of the last successful install.", 2, false),
    new("Certificates", "Certificate expiry", "Security",
        "Finds machine certificates that expire within 30 days and the services that use them.", 1,
        false),
    new("LocalAdmins", "Local administrators audit", "Security",
        "Compares local Administrators membership with the approved list.", 1, false),
    new("Firewall", "Firewall rules review", "Security",
        "Flags inbound allow rules open to any address.", 2, false),
    new("EventErrors", "Event log errors", "Health",
        "Summarizes System and Application errors from the last 24 hours.", 1, false),
    new("Services", "Service health", "Health",
        "Checks that automatic services are running and restarts the ones that stopped.", 1, true),
    new("DiskSpace", "Disk space", "Health",
        "Warns below 15% free and fails below 5% free on every fixed volume.", 1, false),
    new("Uptime", "Uptime and reboots", "Health",
        "Reports uptime and unexpected reboots in the last 30 days.", 1, false)
};
List<PastRun> history = new()
{
    new(new DateTime(2026, 10, 15, 21, 4, 0), 8, 5, 37, 2, 1, TimeSpan.FromMinutes(6.2)),
    new(new DateTime(2026, 10, 16, 7, 30, 0), 3, 2, 6, 0, 0, TimeSpan.FromMinutes(1.1)),
    new(new DateTime(2026, 10, 16, 18, 45, 0), 9, 11, 91, 6, 2, TimeSpan.FromMinutes(14.8))
};
Menu menu = new Menu("Server toolbox")
{
    Subtitle = "lab · 11 servers",
    Layout = MenuLayout.Shell
};
MenuItem targets = new MenuItem("Targets")
{
    Hotkey = 't',
    Icon = Icons.Targets,
    Description = ("Servers the tasks run on. The list is loaded from the inventory; offline servers "
        + "cannot be picked."),
    LoadChoices = (context, token) => LoadServersAsync(token)
};
targets.Minimum = 1;
MenuItem tasks = new MenuItem("Tasks")
{
    Hotkey = 'k',
    Icon = Icons.Tasks,
    Description = ("What to run on every target. Tasks marked 'changes' modify the servers; the rest "
        + "only read.")
}.MultiSelect(allTasks, t => t.Name, t => t.Category, TaskPreview);
foreach (Choice c in tasks.Choices)
{
    MaintenanceTask task = (MaintenanceTask)c.Value!;
    RichTextBuilder badge = new RichTextBuilder();
    if (task.Changes)
    {
        badge.Append("changes ", ThemeToken.Warn);
    }

    c.Badge = badge.Append("~" + task.Minutes + " min", ThemeToken.Muted).Build();
    c.Description = task.Description;
}

tasks.SetSelection(new object? [] { allTasks[0], allTasks[3], allTasks[4] });
Form options = OptionsForm();
MenuItem optionsItem = new MenuItem("Options")
{
    Hotkey = 'o',
    Icon = Icons.Settings,
    Description = "How the run behaves: parallelism, the report and notifications."
}.Form(options, (context, result) => context.Toast("Options saved"));
menu.Add(targets);
menu.Add(tasks);
menu.Add(optionsItem);
menu.Item("Presets", i =>
{
    i.Hotkey = 'p';
    i.Icon = Icons.Favorite;
    i.Description = "Saved combinations of targets, tasks and options. Save one from Review & run.";
    i.Presets();
});
menu.Separator();
menu.Item("Review & run", i =>
{
    i.Hotkey = 'r';
    i.Icon = Icons.Run;
    i.Review = Review;
});
menu.Item("History", i =>
{
    i.Hotkey = 'h';
    i.Page = context => HistoryPage();
    i.Detail = () => history.Count + " runs";
});
menu.Separator();
menu.Exit("Quit");
menu.CommandProviders.Add(new CommandProvider(
    "Task",
    () => allTasks.Select(task => new PaletteCommand("Toggle " + task.Name, context =>
    {
        List<object?> selection = tasks.Selection.ToList();
        bool on = selection.Remove(task);
        if (!on)
        {
            selection.Add(task);
        }

        tasks.SetSelection(allTasks.Where(t => selection.Contains(t)).Cast<object?>());
        context.Toast((on ? "Removed " : "Added ") + task.Name,
            on ? StatusKind.Info : StatusKind.Pass);
    }) { Description = task.Description })));
menu.Run(new MenuOptions { StorageRoot = Path.Combine(Path.GetTempPath(), "server-toolbox") });
async Task<IEnumerable<Choice>> LoadServersAsync(CancellationToken token)
{
    await Task.Delay(1100, token);
    return inventory.Select(server => new Choice(server,
        server.Name)
        {
            Group = server.Site,
            Badge = RichText.Plain(server.Role, new RichStyle(ThemeToken.Muted)),
            Description = server.Role + " server · " + server.OperatingSystem,
            DisabledReason = server.Offline
        })
        .ToList();
}

IWidget TaskPreview(MaintenanceTask task) => new Rows(
    TextBlock.FromMarkup(Markup.Escape(task.Description)),
    new KeyValueList()
        .Add("Group", Markup.Escape(task.Category))
        .Add("Duration", "about " + task.Minutes + " min per server")
        .Add("Changes", task.Changes ? "[warn]yes[/], makes changes" : "[pass]no[/], read only")
        .Add("Parameter", "[accent]" + Markup.Escape(task.Id) + "[/]"))
{
    Gap = 1
};
Form OptionsForm()
{
    Form form = new Form("Options")
    {
        Review = false,
        SubmitText = "Save",
        Command = string.Empty
    };
    FormPage page = form.Page("Options", "Saved with presets; used by Review & run.");
    NumberField parallel = page.Number("Parallel", "Servers at a time");
    parallel.Integer = true;
    parallel.Minimum = 1;
    parallel.Maximum = 16;
    parallel.Default = 4m;
    parallel.ParameterName = "ThrottleLimit";
    parallel.Help = "How many servers run their tasks at the same time.";
    PathField report = page.Path("Report", "Report folder");
    report.PathKind = PathKind.Folder;
    report.Default = "reports/toolbox";
    report.ParameterName = "ReportPath";
    report.Help = "Created when it does not exist. Tab completes folder names.";
    ChoiceField format = page.Select(
        "Format",
        "Report format",
        new[] { new Choice("Html", "HTML"), new Choice("Csv", "CSV"), new Choice("Json", "JSON") });
    format.Default = "Html";
    format.ParameterName = "Format";
    ToggleField notify = page.Toggle("Notify", "Email the report");
    notify.ParameterName = "Notify";
    TextField email = page.Text("Email", "Recipient");
    email.VisibleWhen = v => v.Get<bool>("Notify");
    email.Required = true;
    email.Placeholder = "[email protected]";
    email.ParameterName = "To";
    email.Validator = (value,
        values) => value is string s && s.Contains('@') ? null : "Enter an email address";
    ToggleField dryRun = page.Toggle("DryRun", "Dry run");
    dryRun.ParameterName = "WhatIf";
    dryRun.Help = "Reports what would change without changing anything.";
    return form;
}

ReviewModel Review(MenuContext context)
{
    ReviewModel review = new ReviewModel("Review & run")
    {
        Description = "Everything the run will use. The command does the same without the menu."
    };
    List<Server> servers = targets.GetSelection<Server>().ToList();
    List<MaintenanceTask> selected = tasks.GetSelection<MaintenanceTask>().ToList();
    FormValues values = options.GetValues();
    review.Row(
        "Targets",
        servers.Count == 0
            ? string.Empty
            : servers.Count + " · " + string.Join(", ", servers.Select(s => s.Name)));
    review.Row(
        "Tasks",
        selected.Count == 0
            ? string.Empty
            : selected.Count + " · " + string.Join(", ", selected.Select(t => t.Name)));
    review.Row("Servers at a time",
        options.Find("Parallel")!.Display(values["Parallel"], PromptLabels.Default));
    review.Row("Report",
        values.Get<string>("Report") + " (" + options.Find("Format")!
            .Display(values["Format"], PromptLabels.Default) + ")");
    review.Row("Email", values.Get<bool>("Notify") ? values.Get<string>("Email") : "off");
    review.Row("Dry run", values.Get<bool>("DryRun") ? "yes" : "no");
    if (servers.Count == 0)
    {
        review.Problem("Pick at least one target", targets);
    }

    if (selected.Count == 0)
    {
        review.Problem("Pick at least one task", tasks);
    }

    if (values.Get<bool>("Notify") && string.IsNullOrWhiteSpace(values.Get<string>("Email")))
    {
        review.Problem("Enter the email recipient in Options, or turn off Email the report",
            optionsItem);
    }

    List<string> arguments = new List<string>
    {
        CommandLine.Argument(
            "ComputerName",
            servers.Select(s => s.Name).ToList(),
            CommandStyle.PowerShell),
        CommandLine.Argument("Task", selected.Select(t => t.Id).ToList(), CommandStyle.PowerShell)
    };
    string optionArguments = options.BuildCommand();
    review.Command = CommandLine.Join("Invoke-ServerToolbox",
        arguments) + (optionArguments.Length > 0 ? " " + optionArguments : string.Empty);
    review.Action = ctx => Execute(ctx, servers, selected, values);
    return review;
}

void Execute(MenuContext context, List<Server> servers, List<MaintenanceTask> selected,
    FormValues values)
{
    Lanes lanes = new Lanes("lanes");
    foreach (Server server in servers)
    {
        lanes.Add(
            server.Name,
            new RichTextBuilder()
                .Append(server.Name, ThemeToken.Accent)
                .Append("  " + server.Site, ThemeToken.Muted)
                .Build(),
            selected.Count);
    }

    ProgressBar overall = new ProgressBar("Overall", "overall")
    {
        Total = servers.Count * selected.Count,
        LabelWidth = 8
    };
    LogRegion log = new LogRegion
    {
        PreferredHeight = 6
    };
    Dashboard dashboard = Ui.Dashboard().Title("[bold]Server toolbox[/]")
        .Subtitle(servers.Count + " servers · " + selected.Count + " tasks"
            + (values.Get<bool>("DryRun") ? " · dry run" : string.Empty))
                .Content(body => body
                    .Panel(new Panel(lanes, "Servers"))
            .Add(new Padding(overall, 1, 0, 1, 0))
            .Add(new Panel(log, "Log").Fill()));
    int throttle = (int)values.Get<decimal>("Parallel", 4m);
    context.Run(dashboard, run => Work(run, lanes, overall, log, servers, selected, throttle));
}

MenuRunResult Work(RunContext run, Lanes lanesWidget, ProgressBar overallWidget,
    LogRegion logWidget, List<Server> servers, List<MaintenanceTask> selected, int throttle)
{
    LanesHandle lanes = lanesWidget.Handle(run.Session);
    ProgressHandle overall = overallWidget.Handle(run.Session);
    LogHandle log = logWidget.Handle(run.Session);
    Random random = new Random(42);
    int passed = 0, warnings = 0, failed = 0;
    Table failures = new Table
    {
        Border = TableBorder.Minimal
    };
    failures.Column("Server");
    failures.Column("Task");
    failures.Column(new TableColumn("Finding") { Flexible = true });
    Stopwatch watch = Stopwatch.StartNew();
    log.Write("Started " + selected.Count + " tasks on " + servers.Count + " servers, " + throttle
        + " at a time");
    foreach (MaintenanceTask task in selected)
    {
        foreach (Server server in servers)
        {
            run.CancellationToken.ThrowIfCancellationRequested();
            lanes.Start(server.Name, task.Name);
        }

        Thread.Sleep(450);
        foreach (Server server in servers)
        {
            double roll = random.NextDouble();
            StatusKind outcome = roll < 0.08
                ? StatusKind.Fail
                : roll < 0.2 ? StatusKind.Warn : StatusKind.Pass;
            lanes.Advance(server.Name, outcome, task.Name);
            overall.Advance();
            if (outcome == StatusKind.Fail)
            {
                failed++;
                string finding = task.Category == "Security"
                    ? "3 updates missing for 41 days"
                    : "volume D: below 5% free";
                failures.Row(server.Name, task.Name, finding);
                log.Error(server.Name + " · " + task.Name + ": " + finding);
            }
            else if (outcome == StatusKind.Warn)
            {
                warnings++;
                log.Warn(server.Name + " · " + task.Name + ": needs attention");
            }
            else
            {
                passed++;
            }
        }

        Thread.Sleep(250);
    }

    foreach (Server server in servers)
    {
        lanes.Complete(server.Name);
    }

    overall.Complete(failed > 0
        ? StatusKind.Fail
        : warnings > 0 ? StatusKind.Warn : StatusKind.Pass);
    Thread.Sleep(600);
    history.Add(new PastRun(DateTime.Now, servers.Count, selected.Count, passed, warnings, failed,
        watch.Elapsed));
    MenuRunResult result = new MenuRunResult("Run finished",
        failed > 0 ? StatusKind.Fail : warnings > 0 ? StatusKind.Warn : StatusKind.Pass)
    {
        Summary = servers.Count + " servers checked. "
            + (failed > 0 ? failed + " findings need action." : warnings > 0
                ? warnings + " warnings to review; nothing failed."
                : "Nothing needs action."),
        Details = failed > 0 ? failures : null,
        Elapsed = watch.Elapsed
    };
    result.Figure("passed", passed.ToString(CultureInfo.CurrentCulture));
    if (warnings > 0)
    {
        result.Figure("warnings", warnings.ToString(CultureInfo.CurrentCulture), StatusKind.Warn);
    }
    else
    {
        result.Figure("warnings", "0");
    }

    if (failed > 0)
    {
        result.Figure("failed", failed.ToString(CultureInfo.CurrentCulture), StatusKind.Fail);
    }
    else
    {
        result.Figure("failed", "0");
    }

    result.Next(
        "Open the report",
        ctx => ctx.Toast("Report opened in the browser", StatusKind.Info));
    if (failed > 0)
    {
        result.Next(
            "Run the failed tasks again",
            ctx => ctx.Toast("Queued " + failed + " tasks", StatusKind.Info));
    }

    result.Next("Export findings to CSV", ctx => ctx.Toast("Saved findings.csv"));
    return result;
}

IWidget HistoryPage()
{
    Table table = new Table
    {
        Border = TableBorder.Minimal
    };
    table.Column("When");
    table.Column(new TableColumn("Servers") { Alignment = HorizontalAlignment.Right });
    table.Column(new TableColumn("Tasks") { Alignment = HorizontalAlignment.Right });
    table.Column("Result");
    table.Column(new TableColumn("Duration") { Alignment = HorizontalAlignment.Right });
    foreach (PastRun past in Enumerable.Reverse(history))
    {
        StatusKind status = past.Failed > 0
            ? StatusKind.Fail
            : past.Warnings > 0 ? StatusKind.Warn : StatusKind.Pass;
        table.Row(past.When.ToString("ddd HH:mm", CultureInfo.CurrentCulture),
            past.Servers.ToString(CultureInfo.CurrentCulture),
            past.Tasks.ToString(CultureInfo.CurrentCulture),
            TableCell.ForStatus(status,
                past.Passed + " passed · " + past.Warnings + " warn · " + past.Failed + " failed"),
            NumberFormat.Duration(past.Elapsed));
    }

    return table;
}

record Server(string Name, string Site, string Role, string OperatingSystem,
    string? Offline = null);

record MaintenanceTask(string Id, string Name, string Category, string Description, int Minutes,
    bool Changes);

record PastRun(DateTime When, int Servers, int Tasks, int Passed, int Warnings, int Failed,
    TimeSpan Elapsed);
C# fluentProgram.cs
// A "Server toolbox" in the Shell layout: targets loaded from an inventory, grouped tasks with a preview, an options
// form, presets, a review with the equivalent command and a run into a live dashboard. All data is invented.
Server[] inventory =
{
    new("FS01", "Warsaw", "File", "Windows Server 2022"),
    new("FS02", "Warsaw", "File", "Windows Server 2022"),
    new("WEB01", "Warsaw", "Web", "Windows Server 2025"),
    new("SQL01", "Warsaw", "Database", "Windows Server 2019"),
    new("FS11", "Berlin", "File", "Windows Server 2022"),
    new("WEB11", "Berlin", "Web", "Windows Server 2025"),
    new("PRN11", "Berlin", "Print", "Windows Server 2016", "offline since 09:12"),
    new("BKP21", "Dublin", "Backup", "Windows Server 2022"),
    new("SQL21", "Dublin", "Database", "Windows Server 2022"),
    new("LAB01", "Lab", "Test", "Windows Server 2025"),
    new("LAB02", "Lab", "Test", "Windows Server 2025", "in maintenance until Friday")
};
MaintenanceTask[] allTasks =
{
    new("DiskCleanup", "Disk cleanup", "Maintenance",
        "Removes temporary files, old update caches and crash dumps older than 30 days.", 3, true),
    new("LogRotation", "Log rotation", "Maintenance",
        "Compresses application logs older than 7 days and deletes archives older than 90 days.", 2,
        true),
    new("RestartPending", "Pending restart check", "Maintenance",
        "Reports servers waiting for a restart after updates or role changes.", 1, false),
    new("PatchStatus", "Patch status", "Security",
        "Lists missing security updates and the date of the last successful install.", 2, false),
    new("Certificates", "Certificate expiry", "Security",
        "Finds machine certificates that expire within 30 days and the services that use them.", 1,
        false),
    new("LocalAdmins", "Local administrators audit", "Security",
        "Compares local Administrators membership with the approved list.", 1, false),
    new("Firewall", "Firewall rules review", "Security",
        "Flags inbound allow rules open to any address.", 2, false),
    new("EventErrors", "Event log errors", "Health",
        "Summarizes System and Application errors from the last 24 hours.", 1, false),
    new("Services", "Service health", "Health",
        "Checks that automatic services are running and restarts the ones that stopped.", 1, true),
    new("DiskSpace", "Disk space", "Health",
        "Warns below 15% free and fails below 5% free on every fixed volume.", 1, false),
    new("Uptime", "Uptime and reboots", "Health",
        "Reports uptime and unexpected reboots in the last 30 days.", 1, false)
};
List<PastRun> history = new()
{
    new(new DateTime(2026, 10, 15, 21, 4, 0), 8, 5, 37, 2, 1, TimeSpan.FromMinutes(6.2)),
    new(new DateTime(2026, 10, 16, 7, 30, 0), 3, 2, 6, 0, 0, TimeSpan.FromMinutes(1.1)),
    new(new DateTime(2026, 10, 16, 18, 45, 0), 9, 11, 91, 6, 2, TimeSpan.FromMinutes(14.8))
};
Menu menu = Ui.Menu().Title("Server toolbox").Subtitle("lab · 11 servers").Layout(MenuLayout.Shell);
MenuItem targets = Ui.MenuItem()
    .Label("Targets")
    .Hotkey('t')
    .Icon(Icons.Targets)
    .Description(
        ("Servers the tasks run on. The list is loaded from the inventory; offline servers "
            + "cannot be picked."))
    .ChoicesBy((context, token) => LoadServersAsync(token))
    .Minimum(1);
MenuItem tasks = Ui.MenuItem()
    .Label("Tasks")
    .Hotkey('k')
    .Icon(Icons.Tasks)
    .Description(
        ("What to run on every target. Tasks marked 'changes' modify the servers; the rest "
            + "only read."))
    .MultiSelect(allTasks, t => t.Name, t => t.Category, TaskPreview);
foreach (Choice c in tasks.Choices)
{
    MaintenanceTask task = (MaintenanceTask)c.Value!;
    RichTextBuilder badge = Ui.RichText();
    if (task.Changes)
    {
        badge.Append("changes ", ThemeToken.Warn);
    }

    c.Badge(badge.Append("~" + task.Minutes + " min", ThemeToken.Muted).Build())
        .Description(task.Description);
}

tasks.SetSelection(new object? [] { allTasks[0], allTasks[3], allTasks[4] });
Form options = OptionsForm();
MenuItem optionsItem = Ui.MenuItem()
    .Label("Options")
    .Hotkey('o')
    .Icon(Icons.Settings)
    .Description("How the run behaves: parallelism, the report and notifications.")
    .Form(options, (context, result) => context.Toast("Options saved"));
menu.Add(targets).Add(tasks).Add(optionsItem).Item("Presets", i =>
{
    i.Hotkey('p')
        .Icon(Icons.Favorite)
        .Description(
            "Saved combinations of targets, tasks and options. Save one from Review & run.");
    i.Presets();
}).Separator().Item("Review & run", i =>
{
    i.Hotkey('r').Icon(Icons.Run).ReviewBy(Review);
}).Item("History", i =>
{
    i.Hotkey('h').PageBy(context => HistoryPage()).DetailBy(() => history.Count + " runs");
}).Separator().Exit("Quit");
menu.CommandProviders.Add(new CommandProvider(
    "Task",
    () => allTasks.Select(task => new PaletteCommand("Toggle " + task.Name, context =>
    {
        List<object?> selection = tasks.Selection.ToList();
        bool on = selection.Remove(task);
        if (!on)
        {
            selection.Add(task);
        }

        tasks.SetSelection(allTasks.Where(t => selection.Contains(t)).Cast<object?>());
        context.Toast((on ? "Removed " : "Added ") + task.Name,
            on ? StatusKind.Info : StatusKind.Pass);
    }) { Description = task.Description })));
menu.Run(options2 =>
{
    options2.StorageRoot(Path.Combine(Path.GetTempPath(), "server-toolbox"));
});
async Task<IEnumerable<Choice>> LoadServersAsync(CancellationToken token)
{
    await Task.Delay(1100, token);
    return inventory.Select(server => new Choice(server, server.Name)
        .Group(server.Site)
        .Badge(RichText.Plain(server.Role, new RichStyle(ThemeToken.Muted)))
        .Description(server.Role + " server · " + server.OperatingSystem)
        .DisabledReason(server.Offline))
        .ToList();
}

IWidget TaskPreview(MaintenanceTask task) => Ui.Rows().Gap(1).Content(rowsContent =>
{
    rowsContent.Markup(Markup.Escape(task.Description));
    rowsContent.KeyValue(kv => kv.Add("Group", Markup.Escape(task.Category))
        .Add("Duration", "about " + task.Minutes + " min per server")
        .Add("Changes", task.Changes ? "[warn]yes[/], makes changes" : "[pass]no[/], read only")
        .Add("Parameter", "[accent]" + Markup.Escape(task.Id) + "[/]"));
});
Form OptionsForm()
{
    Form form = Ui.Form().Title("Options").Review(false).SubmitText("Save").Command(string.Empty);
    FormPage page = form.Page("Options", "Saved with presets; used by Review & run.");
    NumberField parallel = page.Number("Parallel", "Servers at a time")
        .Integer()
        .Minimum(1)
        .Maximum(16)
        .Default(4m)
        .ParameterName("ThrottleLimit")
        .Help("How many servers run their tasks at the same time.");
    PathField report = page.Path("Report", "Report folder")
        .PathKind(PathKind.Folder)
        .Default("reports/toolbox")
        .ParameterName("ReportPath")
        .Help("Created when it does not exist. Tab completes folder names.");
    ChoiceField format = page.Select(
        "Format",
        "Report format",
        new[] { new Choice("Html", "HTML"), new Choice("Csv", "CSV"), new Choice("Json", "JSON") })
        .Default("Html")
        .ParameterName("Format");
    ToggleField notify = page.Toggle("Notify", "Email the report").ParameterName("Notify");
    TextField email = page.Text("Email", "Recipient")
        .ShowWhen(v => v.Get<bool>("Notify"))
        .Required()
        .Placeholder("[email protected]")
        .ParameterName("To")
        .Validate((value,
            values) => value is string s && s.Contains('@') ? null : "Enter an email address");
    ToggleField dryRun = page.Toggle("DryRun", "Dry run")
        .ParameterName("WhatIf")
        .Help("Reports what would change without changing anything.");
    return form;
}

ReviewModel Review(MenuContext context)
{
    ReviewModel review = Ui.Review()
        .Title("Review & run")
        .Description("Everything the run will use. The command does the same without the menu.");
    List<Server> servers = targets.GetSelection<Server>().ToList();
    List<MaintenanceTask> selected = tasks.GetSelection<MaintenanceTask>().ToList();
    FormValues values = options.GetValues();
    review.Row(
        "Targets",
        servers.Count == 0
            ? string.Empty
            : servers.Count + " · " + string.Join(", ", servers.Select(s => s.Name)))
        .Row(
            "Tasks",
            selected.Count == 0
                ? string.Empty
                : selected.Count + " · " + string.Join(", ", selected.Select(t => t.Name)))
        .Row("Servers at a time",
            options.Find("Parallel")!.Display(values["Parallel"], PromptLabels.Default))
        .Row("Report",
            values.Get<string>("Report") + " (" + options.Find("Format")!
                .Display(values["Format"], PromptLabels.Default) + ")")
        .Row("Email", values.Get<bool>("Notify") ? values.Get<string>("Email") : "off")
        .Row("Dry run", values.Get<bool>("DryRun") ? "yes" : "no");
    if (servers.Count == 0)
    {
        review.Problem("Pick at least one target", targets);
    }

    if (selected.Count == 0)
    {
        review.Problem("Pick at least one task", tasks);
    }

    if (values.Get<bool>("Notify") && string.IsNullOrWhiteSpace(values.Get<string>("Email")))
    {
        review.Problem("Enter the email recipient in Options, or turn off Email the report",
            optionsItem);
    }

    List<string> arguments = new List<string>
    {
        CommandLine.Argument(
            "ComputerName",
            servers.Select(s => s.Name).ToList(),
            CommandStyle.PowerShell),
        CommandLine.Argument("Task", selected.Select(t => t.Id).ToList(), CommandStyle.PowerShell)
    };
    string optionArguments = options.BuildCommand();
    review.Command(CommandLine.Join("Invoke-ServerToolbox",
        arguments) + (optionArguments.Length > 0 ? " " + optionArguments : string.Empty))
        .Run(ctx => Execute(ctx, servers, selected, values));
    return review;
}

void Execute(MenuContext context, List<Server> servers, List<MaintenanceTask> selected,
    FormValues values)
{
    Lanes lanes = Ui.Lanes("lanes");
    foreach (Server server in servers)
    {
        lanes.Add(server.Name,
            Ui.RichText()
                .Append(server.Name, ThemeToken.Accent)
                .Append("  " + server.Site, ThemeToken.Muted)
                .Build(),
            selected.Count);
    }

    ProgressBar overall = Ui.ProgressBar("overall")
        .Label("Overall")
        .Total(servers.Count * selected.Count)
        .LabelWidth(8);
    LogRegion log = Ui.LogRegion().PreferredHeight(6);
    Dashboard dashboard = Ui.Dashboard()
        .Title("[bold]Server toolbox[/]")
        .Subtitle(servers.Count + " servers · " + selected.Count + " tasks"
            + (values.Get<bool>("DryRun") ? " · dry run" : string.Empty))
        .Content(body => body.Panel(Ui.Panel().Title("Servers").Content(panelContent =>
        {
            panelContent.Add(lanes);
        })).Padding(padding => padding.Left(1).Top(0).Right(1).Bottom(0).Content(paddingContent =>
        {
            paddingContent.Add(overall);
        })).Add(Ui.Panel().Title("Log").Content(panelContent =>
        {
            panelContent.Add(log);
        }).Fill()));
    int throttle = (int)values.Get<decimal>("Parallel", 4m);
    context.Run(dashboard, run => Work(run, lanes, overall, log, servers, selected, throttle));
}

MenuRunResult Work(RunContext run, Lanes lanesWidget, ProgressBar overallWidget,
    LogRegion logWidget, List<Server> servers, List<MaintenanceTask> selected, int throttle)
{
    LanesHandle lanes = lanesWidget.Handle(run.Session);
    ProgressHandle overall = overallWidget.Handle(run.Session);
    LogHandle log = logWidget.Handle(run.Session);
    Random random = new Random(42);
    int passed = 0, warnings = 0, failed = 0;
    Table failures = Ui.Table()
        .Border(TableBorder.Minimal)
        .Column("Server")
        .Column("Task")
        .Column(new TableColumn("Finding").Flexible());
    Stopwatch watch = Stopwatch.StartNew();
    log.Write("Started " + selected.Count + " tasks on " + servers.Count + " servers, " + throttle
        + " at a time");
    foreach (MaintenanceTask task in selected)
    {
        foreach (Server server in servers)
        {
            run.CancellationToken.ThrowIfCancellationRequested();
            lanes.Start(server.Name, task.Name);
        }

        Thread.Sleep(450);
        foreach (Server server in servers)
        {
            double roll = random.NextDouble();
            StatusKind outcome = roll < 0.08
                ? StatusKind.Fail
                : roll < 0.2 ? StatusKind.Warn : StatusKind.Pass;
            lanes.Advance(server.Name, outcome, task.Name);
            overall.Advance();
            if (outcome == StatusKind.Fail)
            {
                failed++;
                string finding = task.Category == "Security"
                    ? "3 updates missing for 41 days"
                    : "volume D: below 5% free";
                failures.Row(server.Name, task.Name, finding);
                log.Error(server.Name + " · " + task.Name + ": " + finding);
            }
            else if (outcome == StatusKind.Warn)
            {
                warnings++;
                log.Warn(server.Name + " · " + task.Name + ": needs attention");
            }
            else
            {
                passed++;
            }
        }

        Thread.Sleep(250);
    }

    foreach (Server server in servers)
    {
        lanes.Complete(server.Name);
    }

    overall.Complete(failed > 0
        ? StatusKind.Fail
        : warnings > 0 ? StatusKind.Warn : StatusKind.Pass);
    Thread.Sleep(600);
    history.Add(new PastRun(DateTime.Now, servers.Count, selected.Count, passed, warnings, failed,
        watch.Elapsed));
    MenuRunResult result = Ui.MenuRunResult()
        .Title("Run finished")
        .Status(failed > 0 ? StatusKind.Fail : warnings > 0 ? StatusKind.Warn : StatusKind.Pass)
        .Summary(servers.Count + " servers checked. "
            + (failed > 0 ? failed + " findings need action." : warnings > 0
                ? warnings + " warnings to review; nothing failed."
                : "Nothing needs action."))
        .Details(failed > 0 ? failures : null)
        .Elapsed(watch.Elapsed);
    result.Figure("passed", passed.ToString(CultureInfo.CurrentCulture));
    if (warnings > 0)
    {
        result.Figure("warnings", warnings.ToString(CultureInfo.CurrentCulture), StatusKind.Warn);
    }
    else
    {
        result.Figure("warnings", "0");
    }

    if (failed > 0)
    {
        result.Figure("failed", failed.ToString(CultureInfo.CurrentCulture), StatusKind.Fail);
    }
    else
    {
        result.Figure("failed", "0");
    }

    result.Next(
        "Open the report",
        ctx => ctx.Toast("Report opened in the browser", StatusKind.Info));
    if (failed > 0)
    {
        result.Next(
            "Run the failed tasks again",
            ctx => ctx.Toast("Queued " + failed + " tasks", StatusKind.Info));
    }

    result.Next("Export findings to CSV", ctx => ctx.Toast("Saved findings.csv"));
    return result;
}

IWidget HistoryPage()
{
    Table table = Ui.Table()
        .Border(TableBorder.Minimal)
        .Column("When")
        .Column(new TableColumn("Servers").Alignment(HorizontalAlignment.Right))
        .Column(new TableColumn("Tasks").Alignment(HorizontalAlignment.Right))
        .Column("Result")
        .Column(new TableColumn("Duration").Alignment(HorizontalAlignment.Right));
    foreach (PastRun past in Enumerable.Reverse(history))
    {
        StatusKind status = past.Failed > 0
            ? StatusKind.Fail
            : past.Warnings > 0 ? StatusKind.Warn : StatusKind.Pass;
        table.Row(past.When.ToString("ddd HH:mm", CultureInfo.CurrentCulture),
            past.Servers.ToString(CultureInfo.CurrentCulture),
            past.Tasks.ToString(CultureInfo.CurrentCulture),
            TableCell.ForStatus(status,
                past.Passed + " passed · " + past.Warnings + " warn · " + past.Failed + " failed"),
            NumberFormat.Duration(past.Elapsed));
    }

    return table;
}

record Server(string Name, string Site, string Role, string OperatingSystem,
    string? Offline = null);

record MaintenanceTask(string Id, string Name, string Category, string Description, int Minutes,
    bool Changes);

record PastRun(DateTime When, int Servers, int Tasks, int Passed, int Warnings, int Failed,
    TimeSpan Elapsed);
Full program
using ConsoleMonster;
using System.Diagnostics;
using System.Globalization;
using ConsoleMonster.Glyphs;
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Styling;
using ConsoleMonster.Text;
using ConsoleMonster.Widgets;

// A "Server toolbox" in the Shell layout: targets loaded from an inventory, grouped tasks with a preview, an options
// form, presets, a review with the equivalent command and a run into a live dashboard. All data is invented.
Server[] inventory =
{
    new("FS01", "Warsaw", "File", "Windows Server 2022"),
    new("FS02", "Warsaw", "File", "Windows Server 2022"),
    new("WEB01", "Warsaw", "Web", "Windows Server 2025"),
    new("SQL01", "Warsaw", "Database", "Windows Server 2019"),
    new("FS11", "Berlin", "File", "Windows Server 2022"),
    new("WEB11", "Berlin", "Web", "Windows Server 2025"),
    new("PRN11", "Berlin", "Print", "Windows Server 2016", "offline since 09:12"),
    new("BKP21", "Dublin", "Backup", "Windows Server 2022"),
    new("SQL21", "Dublin", "Database", "Windows Server 2022"),
    new("LAB01", "Lab", "Test", "Windows Server 2025"),
    new("LAB02", "Lab", "Test", "Windows Server 2025", "in maintenance until Friday")
};
MaintenanceTask[] allTasks =
{
    new("DiskCleanup", "Disk cleanup", "Maintenance",
        "Removes temporary files, old update caches and crash dumps older than 30 days.", 3, true),
    new("LogRotation", "Log rotation", "Maintenance",
        "Compresses application logs older than 7 days and deletes archives older than 90 days.", 2,
        true),
    new("RestartPending", "Pending restart check", "Maintenance",
        "Reports servers waiting for a restart after updates or role changes.", 1, false),
    new("PatchStatus", "Patch status", "Security",
        "Lists missing security updates and the date of the last successful install.", 2, false),
    new("Certificates", "Certificate expiry", "Security",
        "Finds machine certificates that expire within 30 days and the services that use them.", 1,
        false),
    new("LocalAdmins", "Local administrators audit", "Security",
        "Compares local Administrators membership with the approved list.", 1, false),
    new("Firewall", "Firewall rules review", "Security",
        "Flags inbound allow rules open to any address.", 2, false),
    new("EventErrors", "Event log errors", "Health",
        "Summarizes System and Application errors from the last 24 hours.", 1, false),
    new("Services", "Service health", "Health",
        "Checks that automatic services are running and restarts the ones that stopped.", 1, true),
    new("DiskSpace", "Disk space", "Health",
        "Warns below 15% free and fails below 5% free on every fixed volume.", 1, false),
    new("Uptime", "Uptime and reboots", "Health",
        "Reports uptime and unexpected reboots in the last 30 days.", 1, false)
};
List<PastRun> history = new()
{
    new(new DateTime(2026, 10, 15, 21, 4, 0), 8, 5, 37, 2, 1, TimeSpan.FromMinutes(6.2)),
    new(new DateTime(2026, 10, 16, 7, 30, 0), 3, 2, 6, 0, 0, TimeSpan.FromMinutes(1.1)),
    new(new DateTime(2026, 10, 16, 18, 45, 0), 9, 11, 91, 6, 2, TimeSpan.FromMinutes(14.8))
};
Menu menu = Ui.Menu().Title("Server toolbox").Subtitle("lab · 11 servers").Layout(MenuLayout.Shell);
MenuItem targets = Ui.MenuItem()
    .Label("Targets")
    .Hotkey('t')
    .Icon(Icons.Targets)
    .Description(
        ("Servers the tasks run on. The list is loaded from the inventory; offline servers "
            + "cannot be picked."))
    .ChoicesBy((context, token) => LoadServersAsync(token))
    .Minimum(1);
MenuItem tasks = Ui.MenuItem()
    .Label("Tasks")
    .Hotkey('k')
    .Icon(Icons.Tasks)
    .Description(
        ("What to run on every target. Tasks marked 'changes' modify the servers; the rest "
            + "only read."))
    .MultiSelect(allTasks, t => t.Name, t => t.Category, TaskPreview);
foreach (Choice c in tasks.Choices)
{
    MaintenanceTask task = (MaintenanceTask)c.Value!;
    RichTextBuilder badge = Ui.RichText();
    if (task.Changes)
    {
        badge.Append("changes ", ThemeToken.Warn);
    }

    c.Badge(badge.Append("~" + task.Minutes + " min", ThemeToken.Muted).Build())
        .Description(task.Description);
}

tasks.SetSelection(new object? [] { allTasks[0], allTasks[3], allTasks[4] });
Form options = OptionsForm();
MenuItem optionsItem = Ui.MenuItem()
    .Label("Options")
    .Hotkey('o')
    .Icon(Icons.Settings)
    .Description("How the run behaves: parallelism, the report and notifications.")
    .Form(options, (context, result) => context.Toast("Options saved"));
menu.Add(targets).Add(tasks).Add(optionsItem).Item("Presets", i =>
{
    i.Hotkey('p')
        .Icon(Icons.Favorite)
        .Description(
            "Saved combinations of targets, tasks and options. Save one from Review & run.");
    i.Presets();
}).Separator().Item("Review & run", i =>
{
    i.Hotkey('r').Icon(Icons.Run).ReviewBy(Review);
}).Item("History", i =>
{
    i.Hotkey('h').PageBy(context => HistoryPage()).DetailBy(() => history.Count + " runs");
}).Separator().Exit("Quit");
menu.CommandProviders.Add(new CommandProvider(
    "Task",
    () => allTasks.Select(task => new PaletteCommand("Toggle " + task.Name, context =>
    {
        List<object?> selection = tasks.Selection.ToList();
        bool on = selection.Remove(task);
        if (!on)
        {
            selection.Add(task);
        }

        tasks.SetSelection(allTasks.Where(t => selection.Contains(t)).Cast<object?>());
        context.Toast((on ? "Removed " : "Added ") + task.Name,
            on ? StatusKind.Info : StatusKind.Pass);
    }) { Description = task.Description })));
menu.Run(options2 =>
{
    options2.StorageRoot(Path.Combine(Path.GetTempPath(), "server-toolbox"));
});
async Task<IEnumerable<Choice>> LoadServersAsync(CancellationToken token)
{
    await Task.Delay(1100, token);
    return inventory.Select(server => new Choice(server, server.Name)
        .Group(server.Site)
        .Badge(RichText.Plain(server.Role, new RichStyle(ThemeToken.Muted)))
        .Description(server.Role + " server · " + server.OperatingSystem)
        .DisabledReason(server.Offline))
        .ToList();
}

IWidget TaskPreview(MaintenanceTask task) => Ui.Rows().Gap(1).Content(rowsContent =>
{
    rowsContent.Markup(Markup.Escape(task.Description));
    rowsContent.KeyValue(kv => kv.Add("Group", Markup.Escape(task.Category))
        .Add("Duration", "about " + task.Minutes + " min per server")
        .Add("Changes", task.Changes ? "[warn]yes[/], makes changes" : "[pass]no[/], read only")
        .Add("Parameter", "[accent]" + Markup.Escape(task.Id) + "[/]"));
});
Form OptionsForm()
{
    Form form = Ui.Form().Title("Options").Review(false).SubmitText("Save").Command(string.Empty);
    FormPage page = form.Page("Options", "Saved with presets; used by Review & run.");
    NumberField parallel = page.Number("Parallel", "Servers at a time")
        .Integer()
        .Minimum(1)
        .Maximum(16)
        .Default(4m)
        .ParameterName("ThrottleLimit")
        .Help("How many servers run their tasks at the same time.");
    PathField report = page.Path("Report", "Report folder")
        .PathKind(PathKind.Folder)
        .Default("reports/toolbox")
        .ParameterName("ReportPath")
        .Help("Created when it does not exist. Tab completes folder names.");
    ChoiceField format = page.Select(
        "Format",
        "Report format",
        new[] { new Choice("Html", "HTML"), new Choice("Csv", "CSV"), new Choice("Json", "JSON") })
        .Default("Html")
        .ParameterName("Format");
    ToggleField notify = page.Toggle("Notify", "Email the report").ParameterName("Notify");
    TextField email = page.Text("Email", "Recipient")
        .ShowWhen(v => v.Get<bool>("Notify"))
        .Required()
        .Placeholder("[email protected]")
        .ParameterName("To")
        .Validate((value,
            values) => value is string s && s.Contains('@') ? null : "Enter an email address");
    ToggleField dryRun = page.Toggle("DryRun", "Dry run")
        .ParameterName("WhatIf")
        .Help("Reports what would change without changing anything.");
    return form;
}

ReviewModel Review(MenuContext context)
{
    ReviewModel review = Ui.Review()
        .Title("Review & run")
        .Description("Everything the run will use. The command does the same without the menu.");
    List<Server> servers = targets.GetSelection<Server>().ToList();
    List<MaintenanceTask> selected = tasks.GetSelection<MaintenanceTask>().ToList();
    FormValues values = options.GetValues();
    review.Row(
        "Targets",
        servers.Count == 0
            ? string.Empty
            : servers.Count + " · " + string.Join(", ", servers.Select(s => s.Name)))
        .Row(
            "Tasks",
            selected.Count == 0
                ? string.Empty
                : selected.Count + " · " + string.Join(", ", selected.Select(t => t.Name)))
        .Row("Servers at a time",
            options.Find("Parallel")!.Display(values["Parallel"], PromptLabels.Default))
        .Row("Report",
            values.Get<string>("Report") + " (" + options.Find("Format")!
                .Display(values["Format"], PromptLabels.Default) + ")")
        .Row("Email", values.Get<bool>("Notify") ? values.Get<string>("Email") : "off")
        .Row("Dry run", values.Get<bool>("DryRun") ? "yes" : "no");
    if (servers.Count == 0)
    {
        review.Problem("Pick at least one target", targets);
    }

    if (selected.Count == 0)
    {
        review.Problem("Pick at least one task", tasks);
    }

    if (values.Get<bool>("Notify") && string.IsNullOrWhiteSpace(values.Get<string>("Email")))
    {
        review.Problem("Enter the email recipient in Options, or turn off Email the report",
            optionsItem);
    }

    List<string> arguments = new List<string>
    {
        CommandLine.Argument(
            "ComputerName",
            servers.Select(s => s.Name).ToList(),
            CommandStyle.PowerShell),
        CommandLine.Argument("Task", selected.Select(t => t.Id).ToList(), CommandStyle.PowerShell)
    };
    string optionArguments = options.BuildCommand();
    review.Command(CommandLine.Join("Invoke-ServerToolbox",
        arguments) + (optionArguments.Length > 0 ? " " + optionArguments : string.Empty))
        .Run(ctx => Execute(ctx, servers, selected, values));
    return review;
}

void Execute(MenuContext context, List<Server> servers, List<MaintenanceTask> selected,
    FormValues values)
{
    Lanes lanes = Ui.Lanes("lanes");
    foreach (Server server in servers)
    {
        lanes.Add(server.Name,
            Ui.RichText()
                .Append(server.Name, ThemeToken.Accent)
                .Append("  " + server.Site, ThemeToken.Muted)
                .Build(),
            selected.Count);
    }

    ProgressBar overall = Ui.ProgressBar("overall")
        .Label("Overall")
        .Total(servers.Count * selected.Count)
        .LabelWidth(8);
    LogRegion log = Ui.LogRegion().PreferredHeight(6);
    Dashboard dashboard = Ui.Dashboard()
        .Title("[bold]Server toolbox[/]")
        .Subtitle(servers.Count + " servers · " + selected.Count + " tasks"
            + (values.Get<bool>("DryRun") ? " · dry run" : string.Empty))
        .Content(body => body.Panel(Ui.Panel().Title("Servers").Content(panelContent =>
        {
            panelContent.Add(lanes);
        })).Padding(padding => padding.Left(1).Top(0).Right(1).Bottom(0).Content(paddingContent =>
        {
            paddingContent.Add(overall);
        })).Add(Ui.Panel().Title("Log").Content(panelContent =>
        {
            panelContent.Add(log);
        }).Fill()));
    int throttle = (int)values.Get<decimal>("Parallel", 4m);
    context.Run(dashboard, run => Work(run, lanes, overall, log, servers, selected, throttle));
}

MenuRunResult Work(RunContext run, Lanes lanesWidget, ProgressBar overallWidget,
    LogRegion logWidget, List<Server> servers, List<MaintenanceTask> selected, int throttle)
{
    LanesHandle lanes = lanesWidget.Handle(run.Session);
    ProgressHandle overall = overallWidget.Handle(run.Session);
    LogHandle log = logWidget.Handle(run.Session);
    Random random = new Random(42);
    int passed = 0, warnings = 0, failed = 0;
    Table failures = Ui.Table()
        .Border(TableBorder.Minimal)
        .Column("Server")
        .Column("Task")
        .Column(new TableColumn("Finding").Flexible());
    Stopwatch watch = Stopwatch.StartNew();
    log.Write("Started " + selected.Count + " tasks on " + servers.Count + " servers, " + throttle
        + " at a time");
    foreach (MaintenanceTask task in selected)
    {
        foreach (Server server in servers)
        {
            run.CancellationToken.ThrowIfCancellationRequested();
            lanes.Start(server.Name, task.Name);
        }

        Thread.Sleep(450);
        foreach (Server server in servers)
        {
            double roll = random.NextDouble();
            StatusKind outcome = roll < 0.08
                ? StatusKind.Fail
                : roll < 0.2 ? StatusKind.Warn : StatusKind.Pass;
            lanes.Advance(server.Name, outcome, task.Name);
            overall.Advance();
            if (outcome == StatusKind.Fail)
            {
                failed++;
                string finding = task.Category == "Security"
                    ? "3 updates missing for 41 days"
                    : "volume D: below 5% free";
                failures.Row(server.Name, task.Name, finding);
                log.Error(server.Name + " · " + task.Name + ": " + finding);
            }
            else if (outcome == StatusKind.Warn)
            {
                warnings++;
                log.Warn(server.Name + " · " + task.Name + ": needs attention");
            }
            else
            {
                passed++;
            }
        }

        Thread.Sleep(250);
    }

    foreach (Server server in servers)
    {
        lanes.Complete(server.Name);
    }

    overall.Complete(failed > 0
        ? StatusKind.Fail
        : warnings > 0 ? StatusKind.Warn : StatusKind.Pass);
    Thread.Sleep(600);
    history.Add(new PastRun(DateTime.Now, servers.Count, selected.Count, passed, warnings, failed,
        watch.Elapsed));
    MenuRunResult result = Ui.MenuRunResult()
        .Title("Run finished")
        .Status(failed > 0 ? StatusKind.Fail : warnings > 0 ? StatusKind.Warn : StatusKind.Pass)
        .Summary(servers.Count + " servers checked. "
            + (failed > 0 ? failed + " findings need action." : warnings > 0
                ? warnings + " warnings to review; nothing failed."
                : "Nothing needs action."))
        .Details(failed > 0 ? failures : null)
        .Elapsed(watch.Elapsed);
    result.Figure("passed", passed.ToString(CultureInfo.CurrentCulture));
    if (warnings > 0)
    {
        result.Figure("warnings", warnings.ToString(CultureInfo.CurrentCulture), StatusKind.Warn);
    }
    else
    {
        result.Figure("warnings", "0");
    }

    if (failed > 0)
    {
        result.Figure("failed", failed.ToString(CultureInfo.CurrentCulture), StatusKind.Fail);
    }
    else
    {
        result.Figure("failed", "0");
    }

    result.Next(
        "Open the report",
        ctx => ctx.Toast("Report opened in the browser", StatusKind.Info));
    if (failed > 0)
    {
        result.Next(
            "Run the failed tasks again",
            ctx => ctx.Toast("Queued " + failed + " tasks", StatusKind.Info));
    }

    result.Next("Export findings to CSV", ctx => ctx.Toast("Saved findings.csv"));
    return result;
}

IWidget HistoryPage()
{
    Table table = Ui.Table()
        .Border(TableBorder.Minimal)
        .Column("When")
        .Column(new TableColumn("Servers").Alignment(HorizontalAlignment.Right))
        .Column(new TableColumn("Tasks").Alignment(HorizontalAlignment.Right))
        .Column("Result")
        .Column(new TableColumn("Duration").Alignment(HorizontalAlignment.Right));
    foreach (PastRun past in Enumerable.Reverse(history))
    {
        StatusKind status = past.Failed > 0
            ? StatusKind.Fail
            : past.Warnings > 0 ? StatusKind.Warn : StatusKind.Pass;
        table.Row(past.When.ToString("ddd HH:mm", CultureInfo.CurrentCulture),
            past.Servers.ToString(CultureInfo.CurrentCulture),
            past.Tasks.ToString(CultureInfo.CurrentCulture),
            TableCell.ForStatus(status,
                past.Passed + " passed · " + past.Warnings + " warn · " + past.Failed + " failed"),
            NumberFormat.Duration(past.Elapsed));
    }

    return table;
}

record Server(string Name, string Site, string Role, string OperatingSystem,
    string? Offline = null);

record MaintenanceTask(string Id, string Name, string Category, string Description, int Minutes,
    bool Changes);

record PastRun(DateTime When, int Servers, int Tasks, int Passed, int Warnings, int Failed,
    TimeSpan Elapsed);

A form as a wizard

Fields with pages become a wizard with a progress strip. Dependent fields reload their choices with a spinner, and the review page shows every answer and the equivalent command.

A form as a wizard 110×3024-bitFull

Input PageDown Enter Escape PageDown Right Down "svc-toolbox" Down "Example-Pass1" PageDown Right wait:400 Down wait:1800 Enter Enter PageDown wait:300 Escape Escape Escape Escape Escape y

C#Program.cs
// A setup wizard: a page per step, grouped components, fields that appear for a custom account, a server list that
// loads for the chosen region, the review with the equivalent command, then the install run. Nothing is installed.
// Relative sample folders work on every platform and keep the recording independent of the machine running it.
Form form = new Form("Install Toolbox Agent") {
    Command = "Install-ToolboxAgent",
    Description = "Sets up the agent that runs toolbox tasks on this machine.",
    SubmitText = "Install"
};

FormPage location = form.Page("Location", "Where the agent and its data go.");
PathField path = location.Path("Path", "Install folder");
path.PathKind = PathKind.Folder;
path.Default = "toolbox-agent";
path.Required = true;
path.ParameterName = "Path";
path.Help = "Created when it does not exist. Tab completes folder names.";
PathField data = location.Path("Data", "Data folder");
// … 6 more lines in the full program
shortcuts.ParameterName = "Shortcuts";

FormPage components = form.Page("Components", "Pick what to install. You can add more later.");
ChoiceField parts = components.MultiSelect("Components", "Components", new[] {
    new Choice("Agent", "Agent service")
    {
        Group = "Core",
        Selected = true,
        Description = "Runs tasks and reports results. Required.",
        Badge = RichText.Plain("18 MB")
    },
    new Choice("Cli", "Command-line tools")
    // … 37 more lines in the full program
});
parts.Minimum = 1;
parts.ParameterName = "Component";
parts.Help = "Space toggles, Ctrl+A selects all, Enter closes the list.";

FormPage service = form.Page("Service", "How the agent runs.");
ChoiceField account = service.Select("Account", "Service account", new[] {
    new Choice("Dedicated", "Dedicated service user")
    {
        Description = "A restricted toolbox user for this service."
    },
    new Choice("Custom", "A specific user") { Description = "An existing local user you name." }
});
account.Default = "Dedicated";
account.ParameterName = "Account";
TextField user = service.Text("UserName", "User name");
user.VisibleWhen = v => Equals(v["Account"], "Custom");
user.Required = true;
user.Placeholder = "toolbox";
user.ParameterName = "UserName";
SecretField password = service.Secret("Password", "Password");
password.VisibleWhen = v => Equals(v["Account"], "Custom");
password.ParameterName = "Password";
password.CommandPlaceholder = "(Read-Host -AsSecureString)";
ToggleField automatic = service.Toggle("AutoStart", "Start automatically");
automatic.Default = true;
automatic.ParameterName = "AutoStart";

FormPage connection = form.Page("Connection", "Where the agent reports to.");
ChoiceField region = connection.Select("Region", "Region", new[] {
    new Choice("eu", "Europe"),
    new Choice("us", "Americas"),
    new Choice("ap", "Asia Pacific")
});
region.Required = true;
region.ParameterName = "Region";
region.Help = "Choosing a region loads its servers.";
ChoiceField server = connection.Select("Server", "Server");
server.DependsOn.Add("Region");
server.Required = true;
server.ParameterName = "Server";
server.LoadChoices = (values, token) => LoadServersAsync(values.Get<string>("Region"), token);
server.Help = "Loaded for the chosen region; Esc cancels loading.";
NumberField port = connection.Number("Port", "Port");
// … 11 more lines in the full program
proxyAddress.ParameterName = "Proxy";

FormResult result = form.Show(new FormOptions { AfterSubmit = Install });
if (!result.Submitted) {
    Terminal.WriteMarkupLine("[muted]Setup was cancelled; nothing was changed.[/]");
}

async Task<IEnumerable<Choice>> LoadServersAsync(string? chosen, CancellationToken token) {
    // … 30 more lines in the full program
}
// … 42 more lines in the full program
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Styling;
using ConsoleMonster.Text;
using ConsoleMonster.Widgets;

// A setup wizard: a page per step, grouped components, fields that appear for a custom account, a server list that
// loads for the chosen region, the review with the equivalent command, then the install run. Nothing is installed.
// Relative sample folders work on every platform and keep the recording independent of the machine running it.
Form form = new Form("Install Toolbox Agent") {
    Command = "Install-ToolboxAgent",
    Description = "Sets up the agent that runs toolbox tasks on this machine.",
    SubmitText = "Install"
};

FormPage location = form.Page("Location", "Where the agent and its data go.");
PathField path = location.Path("Path", "Install folder");
path.PathKind = PathKind.Folder;
path.Default = "toolbox-agent";
path.Required = true;
path.ParameterName = "Path";
path.Help = "Created when it does not exist. Tab completes folder names.";
PathField data = location.Path("Data", "Data folder");
data.PathKind = PathKind.Folder;
data.Default = "toolbox-data";
data.ParameterName = "DataPath";
data.Help = "Logs, reports and the local queue. Needs a few hundred MB.";
ToggleField shortcuts = location.Toggle("Shortcuts", "Command-line shortcuts");
shortcuts.Default = true;
shortcuts.ParameterName = "Shortcuts";

FormPage components = form.Page("Components", "Pick what to install. You can add more later.");
ChoiceField parts = components.MultiSelect("Components", "Components", new[] {
    new Choice("Agent", "Agent service")
    {
        Group = "Core",
        Selected = true,
        Description = "Runs tasks and reports results. Required.",
        Badge = RichText.Plain("18 MB")
    },
    new Choice("Cli", "Command-line tools")
    {
        Group = "Core",
        Selected = true,
        Description = "toolbox and the PowerShell module.",
        Badge = RichText.Plain("6 MB")
    },
    new Choice("Html", "HTML reports")
    {
        Group = "Reporting",
        Selected = true,
        Description = "Interactive reports with tables and charts.",
        Badge = RichText.Plain("4 MB")
    },
    new Choice("Pdf", "PDF export")
    {
        Group = "Reporting",
        Description = "Prints reports to PDF.",
        Badge = RichText.Plain("31 MB")
    },
    new Choice("Teams", "Teams notifications")
    {
        Group = "Integrations",
        Description = "Posts run summaries to a Teams channel.",
        Badge = RichText.Plain("1 MB")
    },
    new Choice("Mail", "Email notifications")
    {
        Group = "Integrations",
        Description = "Sends reports by email.",
        Badge = RichText.Plain("1 MB")
    },
    new Choice("Syslog", "Syslog forwarder")
    {
        Group = "Integrations",
        Description = "Forwards findings to a syslog collector.",
        DisabledReason = "needs the Enterprise licence"
    }
});
parts.Minimum = 1;
parts.ParameterName = "Component";
parts.Help = "Space toggles, Ctrl+A selects all, Enter closes the list.";

FormPage service = form.Page("Service", "How the agent runs.");
ChoiceField account = service.Select("Account", "Service account", new[] {
    new Choice("Dedicated", "Dedicated service user")
    {
        Description = "A restricted toolbox user for this service."
    },
    new Choice("Custom", "A specific user") { Description = "An existing local user you name." }
});
account.Default = "Dedicated";
account.ParameterName = "Account";
TextField user = service.Text("UserName", "User name");
user.VisibleWhen = v => Equals(v["Account"], "Custom");
user.Required = true;
user.Placeholder = "toolbox";
user.ParameterName = "UserName";
SecretField password = service.Secret("Password", "Password");
password.VisibleWhen = v => Equals(v["Account"], "Custom");
password.ParameterName = "Password";
password.CommandPlaceholder = "(Read-Host -AsSecureString)";
ToggleField automatic = service.Toggle("AutoStart", "Start automatically");
automatic.Default = true;
automatic.ParameterName = "AutoStart";

FormPage connection = form.Page("Connection", "Where the agent reports to.");
ChoiceField region = connection.Select("Region", "Region", new[] {
    new Choice("eu", "Europe"),
    new Choice("us", "Americas"),
    new Choice("ap", "Asia Pacific")
});
region.Required = true;
region.ParameterName = "Region";
region.Help = "Choosing a region loads its servers.";
ChoiceField server = connection.Select("Server", "Server");
server.DependsOn.Add("Region");
server.Required = true;
server.ParameterName = "Server";
server.LoadChoices = (values, token) => LoadServersAsync(values.Get<string>("Region"), token);
server.Help = "Loaded for the chosen region; Esc cancels loading.";
NumberField port = connection.Number("Port", "Port");
port.Integer = true;
port.Minimum = 1;
port.Maximum = 65535;
port.Default = 443m;
port.ParameterName = "Port";
ToggleField proxy = connection.Toggle("UseProxy", "Use a proxy");
proxy.ParameterName = "UseProxy";
TextField proxyAddress = connection.Text("Proxy", "Proxy address");
proxyAddress.VisibleWhen = v => v.Get<bool>("UseProxy");
proxyAddress.Required = true;
proxyAddress.Placeholder = "http://proxy.example.org:8080";
proxyAddress.ParameterName = "Proxy";

FormResult result = form.Show(new FormOptions { AfterSubmit = Install });
if (!result.Submitted) {
    Terminal.WriteMarkupLine("[muted]Setup was cancelled; nothing was changed.[/]");
}

async Task<IEnumerable<Choice>> LoadServersAsync(string? chosen, CancellationToken token) {
    await Task.Delay(1400, token);
    return chosen switch {
        "us" => new[]
        {
            new Choice("us-east-1", "us-east-1") { Badge = RichText.Plain("18 ms") },
            new Choice("us-west-2", "us-west-2") { Badge = RichText.Plain("74 ms") }
        },
        "ap" => new[]
        {
            new Choice("ap-south-1", "ap-south-1") { Badge = RichText.Plain("121 ms") },
            new Choice("ap-east-1", "ap-east-1") { DisabledReason = "maintenance until 18:00" }
        },
        _ => new[] {
            new Choice("eu-west-1", "eu-west-1")
            {
                Badge = RichText.Plain("12 ms"),
                Description = "Dublin"
            },
            new Choice("eu-central-1", "eu-central-1")
            {
                Badge = RichText.Plain("9 ms"),
                Description = "Frankfurt"
            },
            new Choice("eu-north-1", "eu-north-1")
            {
                Badge = RichText.Plain("31 ms"),
                Description = "Stockholm"
            }
        }
    };
}

void Install(MenuContext context) {
    FormValues values = context.Values!;
    string[] steps = { "Copy files", "Register service", "Configure connection", "Start service" };
    StatusList list = new StatusList("steps");
    foreach (string step in steps) {
        list.Set(step, step, StatusKind.Pending);
    }
    ProgressBar progress = new ProgressBar("Install", "progress")
    {
        Total = steps.Length * 10,
        LabelWidth = 22
    };
    Dashboard dashboard = Ui.Dashboard().Title("Installing")
        .Subtitle(Markup.Escape(values.Get<string>("Path")))
        .Content(body => body
            .Panel(new Panel(list, "Steps"))
            .Add(new Padding(progress, 1, 0, 1, 0)));
    context.Run(dashboard, run => {
        StatusListHandle handle = list.Handle(run.Session);
        ProgressHandle bar = progress.Handle(run.Session);
        foreach (string step in steps) {
            handle.Set(step, StatusKind.Running);
            bar.Label(step);
            for (int i = 0; i < 10 && !run.CancellationToken.IsCancellationRequested; i++) {
                Thread.Sleep(90);
                bar.Advance();
            }
            handle.Set(step, StatusKind.Pass);
        }
        bar.Complete();
        Thread.Sleep(300);
        MenuRunResult done = new MenuRunResult("Toolbox Agent installed") {
            Summary = Markup.Escape(values.Get<string>("Path")) + " · "
                + string.Join(", ",
                    values.GetList<object>("Components")) + " · "
                + Markup.Escape(values.Get<string>("Server"))
        };
        done.Figure("steps done", steps.Length.ToString(), StatusKind.Pass);
        return done;
    });
}
C# fluentProgram.cs
// A setup wizard: a page per step, grouped components, fields that appear for a custom account, a server list that
// loads for the chosen region, the review with the equivalent command, then the install run. Nothing is installed.
// Relative sample folders work on every platform and keep the recording independent of the machine running it.
Form form = Ui.Form()
    .Title("Install Toolbox Agent")
    .Command("Install-ToolboxAgent")
    .Description("Sets up the agent that runs toolbox tasks on this machine.")
    .SubmitText("Install");
FormPage location = form.Page("Location", "Where the agent and its data go.");
PathField path = location.Path("Path", "Install folder")
    .PathKind(PathKind.Folder)
    .Default("toolbox-agent")
    .Required()
    .ParameterName("Path")
    .Help("Created when it does not exist. Tab completes folder names.");
PathField data = location.Path("Data", "Data folder")
    .PathKind(PathKind.Folder)
    .Default("toolbox-data")
    .ParameterName("DataPath")
    .Help("Logs, reports and the local queue. Needs a few hundred MB.");
ToggleField shortcuts = location.Toggle("Shortcuts", "Command-line shortcuts")
    .Default(true)
    .ParameterName("Shortcuts");
FormPage components = form.Page("Components", "Pick what to install. You can add more later.");
ChoiceField parts = components.MultiSelect(
    "Components",
    "Components",
    new[]
    {
        new Choice("Agent", "Agent service")
            .Group("Core")
            .Selected()
            .Description("Runs tasks and reports results. Required.")
            .Badge(RichText.Plain("18 MB")),
        new Choice("Cli", "Command-line tools")
            .Group("Core")
            .Selected()
            .Description("toolbox and the PowerShell module.")
            .Badge(RichText.Plain("6 MB")),
        new Choice("Html", "HTML reports")
            .Group("Reporting")
            .Selected()
            .Description("Interactive reports with tables and charts.")
            .Badge(RichText.Plain("4 MB")),
        new Choice("Pdf", "PDF export")
            .Group("Reporting")
            .Description("Prints reports to PDF.")
            .Badge(RichText.Plain("31 MB")),
        new Choice("Teams", "Teams notifications")
            .Group("Integrations")
            .Description("Posts run summaries to a Teams channel.")
            .Badge(RichText.Plain("1 MB")),
        new Choice("Mail", "Email notifications")
            .Group("Integrations")
            .Description("Sends reports by email.")
            .Badge(RichText.Plain("1 MB")),
        new Choice("Syslog", "Syslog forwarder")
            .Group("Integrations")
            .Description("Forwards findings to a syslog collector.")
            .DisabledReason("needs the Enterprise licence")
    })
    .Minimum(1)
    .ParameterName("Component")
    .Help("Space toggles, Ctrl+A selects all, Enter closes the list.");
FormPage service = form.Page("Service", "How the agent runs.");
ChoiceField account = service.Select(
    "Account",
    "Service account",
    new[]
    {
        new Choice("Dedicated", "Dedicated service user")
            .Description("A restricted toolbox user for this service."),
        new Choice("Custom", "A specific user").Description("An existing local user you name.")
    })
    .Default("Dedicated")
    .ParameterName("Account");
TextField user = service.Text("UserName", "User name")
    .ShowWhen(v => Equals(v["Account"], "Custom"))
    .Required()
    .Placeholder("toolbox")
    .ParameterName("UserName");
SecretField password = service.Secret("Password", "Password")
    .ShowWhen(v => Equals(v["Account"], "Custom"))
    .ParameterName("Password")
    .CommandPlaceholder("(Read-Host -AsSecureString)");
ToggleField automatic = service.Toggle("AutoStart", "Start automatically")
    .Default(true)
    .ParameterName("AutoStart");
FormPage connection = form.Page("Connection", "Where the agent reports to.");
ChoiceField region = connection.Select(
    "Region",
    "Region",
    new[]
    {
        new Choice("eu", "Europe"),
        new Choice("us", "Americas"),
        new Choice("ap", "Asia Pacific")
    })
    .Required()
    .ParameterName("Region")
    .Help("Choosing a region loads its servers.");
ChoiceField server = connection.Select("Server", "Server");
server.DependsOn.Add("Region");
server.Required()
    .ParameterName("Server")
    .ChoicesBy((values, token) => LoadServersAsync(values.Get<string>("Region"), token))
    .Help("Loaded for the chosen region; Esc cancels loading.");
NumberField port = connection.Number("Port", "Port")
    .Integer()
    .Minimum(1)
    .Maximum(65535)
    .Default(443m)
    .ParameterName("Port");
ToggleField proxy = connection.Toggle("UseProxy", "Use a proxy").ParameterName("UseProxy");
TextField proxyAddress = connection.Text("Proxy", "Proxy address")
    .ShowWhen(v => v.Get<bool>("UseProxy"))
    .Required()
    .Placeholder("http://proxy.example.org:8080")
    .ParameterName("Proxy");
FormResult result = form.Show(options =>
{
    options.WhenSubmitted(Install);
});
if (!result.Submitted)
{
    Terminal.WriteMarkupLine("[muted]Setup was cancelled; nothing was changed.[/]");
}

async Task<IEnumerable<Choice>> LoadServersAsync(string? chosen, CancellationToken token)
{
    await Task.Delay(1400, token);
    return chosen switch
    {
        "us" => new[]
        {
            new Choice("us-east-1", "us-east-1").Badge(RichText.Plain("18 ms")),
            new Choice("us-west-2", "us-west-2").Badge(RichText.Plain("74 ms"))
        },
        "ap" => new[]
        {
            new Choice("ap-south-1", "ap-south-1").Badge(RichText.Plain("121 ms")),
            new Choice("ap-east-1", "ap-east-1").DisabledReason("maintenance until 18:00")
        },
        _ => new[]
        {
            new Choice("eu-west-1", "eu-west-1")
                .Badge(RichText.Plain("12 ms"))
                .Description("Dublin"),
            new Choice("eu-central-1", "eu-central-1")
                .Badge(RichText.Plain("9 ms"))
                .Description("Frankfurt"),
            new Choice("eu-north-1", "eu-north-1")
                .Badge(RichText.Plain("31 ms"))
                .Description("Stockholm")
        }
    };
}

void Install(MenuContext context)
{
    FormValues values = context.Values!;
    string[] steps = { "Copy files", "Register service", "Configure connection", "Start service" };
    StatusList list = Ui.StatusList("steps");
    foreach (string step in steps)
    {
        list.Set(step, step, StatusKind.Pending);
    }

    ProgressBar progress = Ui.ProgressBar("progress")
        .Label("Install")
        .Total(steps.Length * 10)
        .LabelWidth(22);
    Dashboard dashboard = Ui.Dashboard()
        .Title("Installing")
        .Subtitle(Markup.Escape(values.Get<string>("Path")))
        .Content(body => body.Panel(Ui.Panel().Title("Steps").Content(panelContent =>
        {
            panelContent.Add(list);
        })).Padding(padding => padding.Left(1).Top(0).Right(1).Bottom(0).Content(paddingContent =>
        {
            paddingContent.Add(progress);
        })));
    context.Run(dashboard, run =>
    {
        StatusListHandle handle = list.Handle(run.Session);
        ProgressHandle bar = progress.Handle(run.Session);
        foreach (string step in steps)
        {
            handle.Set(step, StatusKind.Running);
            bar.Label(step);
            for (int i = 0; i < 10 && !run.CancellationToken.IsCancellationRequested; i++)
            {
                Thread.Sleep(90);
                bar.Advance();
            }

            handle.Set(step, StatusKind.Pass);
        }

        bar.Complete();
        Thread.Sleep(300);
        MenuRunResult done = Ui.MenuRunResult()
            .Title("Toolbox Agent installed")
            .Summary(Markup.Escape(values.Get<string>("Path")) + " · "
                + string.Join(", ",
                    values.GetList<object>("Components")) + " · "
                + Markup.Escape(values.Get<string>("Server")));
        done.Figure("steps done", steps.Length.ToString(), StatusKind.Pass);
        return done;
    });
}
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Styling;
using ConsoleMonster.Text;
using ConsoleMonster.Widgets;

// A setup wizard: a page per step, grouped components, fields that appear for a custom account, a server list that
// loads for the chosen region, the review with the equivalent command, then the install run. Nothing is installed.
// Relative sample folders work on every platform and keep the recording independent of the machine running it.
Form form = Ui.Form()
    .Title("Install Toolbox Agent")
    .Command("Install-ToolboxAgent")
    .Description("Sets up the agent that runs toolbox tasks on this machine.")
    .SubmitText("Install");
FormPage location = form.Page("Location", "Where the agent and its data go.");
PathField path = location.Path("Path", "Install folder")
    .PathKind(PathKind.Folder)
    .Default("toolbox-agent")
    .Required()
    .ParameterName("Path")
    .Help("Created when it does not exist. Tab completes folder names.");
PathField data = location.Path("Data", "Data folder")
    .PathKind(PathKind.Folder)
    .Default("toolbox-data")
    .ParameterName("DataPath")
    .Help("Logs, reports and the local queue. Needs a few hundred MB.");
ToggleField shortcuts = location.Toggle("Shortcuts", "Command-line shortcuts")
    .Default(true)
    .ParameterName("Shortcuts");
FormPage components = form.Page("Components", "Pick what to install. You can add more later.");
ChoiceField parts = components.MultiSelect(
    "Components",
    "Components",
    new[]
    {
        new Choice("Agent", "Agent service")
            .Group("Core")
            .Selected()
            .Description("Runs tasks and reports results. Required.")
            .Badge(RichText.Plain("18 MB")),
        new Choice("Cli", "Command-line tools")
            .Group("Core")
            .Selected()
            .Description("toolbox and the PowerShell module.")
            .Badge(RichText.Plain("6 MB")),
        new Choice("Html", "HTML reports")
            .Group("Reporting")
            .Selected()
            .Description("Interactive reports with tables and charts.")
            .Badge(RichText.Plain("4 MB")),
        new Choice("Pdf", "PDF export")
            .Group("Reporting")
            .Description("Prints reports to PDF.")
            .Badge(RichText.Plain("31 MB")),
        new Choice("Teams", "Teams notifications")
            .Group("Integrations")
            .Description("Posts run summaries to a Teams channel.")
            .Badge(RichText.Plain("1 MB")),
        new Choice("Mail", "Email notifications")
            .Group("Integrations")
            .Description("Sends reports by email.")
            .Badge(RichText.Plain("1 MB")),
        new Choice("Syslog", "Syslog forwarder")
            .Group("Integrations")
            .Description("Forwards findings to a syslog collector.")
            .DisabledReason("needs the Enterprise licence")
    })
    .Minimum(1)
    .ParameterName("Component")
    .Help("Space toggles, Ctrl+A selects all, Enter closes the list.");
FormPage service = form.Page("Service", "How the agent runs.");
ChoiceField account = service.Select(
    "Account",
    "Service account",
    new[]
    {
        new Choice("Dedicated", "Dedicated service user")
            .Description("A restricted toolbox user for this service."),
        new Choice("Custom", "A specific user").Description("An existing local user you name.")
    })
    .Default("Dedicated")
    .ParameterName("Account");
TextField user = service.Text("UserName", "User name")
    .ShowWhen(v => Equals(v["Account"], "Custom"))
    .Required()
    .Placeholder("toolbox")
    .ParameterName("UserName");
SecretField password = service.Secret("Password", "Password")
    .ShowWhen(v => Equals(v["Account"], "Custom"))
    .ParameterName("Password")
    .CommandPlaceholder("(Read-Host -AsSecureString)");
ToggleField automatic = service.Toggle("AutoStart", "Start automatically")
    .Default(true)
    .ParameterName("AutoStart");
FormPage connection = form.Page("Connection", "Where the agent reports to.");
ChoiceField region = connection.Select(
    "Region",
    "Region",
    new[]
    {
        new Choice("eu", "Europe"),
        new Choice("us", "Americas"),
        new Choice("ap", "Asia Pacific")
    })
    .Required()
    .ParameterName("Region")
    .Help("Choosing a region loads its servers.");
ChoiceField server = connection.Select("Server", "Server");
server.DependsOn.Add("Region");
server.Required()
    .ParameterName("Server")
    .ChoicesBy((values, token) => LoadServersAsync(values.Get<string>("Region"), token))
    .Help("Loaded for the chosen region; Esc cancels loading.");
NumberField port = connection.Number("Port", "Port")
    .Integer()
    .Minimum(1)
    .Maximum(65535)
    .Default(443m)
    .ParameterName("Port");
ToggleField proxy = connection.Toggle("UseProxy", "Use a proxy").ParameterName("UseProxy");
TextField proxyAddress = connection.Text("Proxy", "Proxy address")
    .ShowWhen(v => v.Get<bool>("UseProxy"))
    .Required()
    .Placeholder("http://proxy.example.org:8080")
    .ParameterName("Proxy");
FormResult result = form.Show(options =>
{
    options.WhenSubmitted(Install);
});
if (!result.Submitted)
{
    Terminal.WriteMarkupLine("[muted]Setup was cancelled; nothing was changed.[/]");
}

async Task<IEnumerable<Choice>> LoadServersAsync(string? chosen, CancellationToken token)
{
    await Task.Delay(1400, token);
    return chosen switch
    {
        "us" => new[]
        {
            new Choice("us-east-1", "us-east-1").Badge(RichText.Plain("18 ms")),
            new Choice("us-west-2", "us-west-2").Badge(RichText.Plain("74 ms"))
        },
        "ap" => new[]
        {
            new Choice("ap-south-1", "ap-south-1").Badge(RichText.Plain("121 ms")),
            new Choice("ap-east-1", "ap-east-1").DisabledReason("maintenance until 18:00")
        },
        _ => new[]
        {
            new Choice("eu-west-1", "eu-west-1")
                .Badge(RichText.Plain("12 ms"))
                .Description("Dublin"),
            new Choice("eu-central-1", "eu-central-1")
                .Badge(RichText.Plain("9 ms"))
                .Description("Frankfurt"),
            new Choice("eu-north-1", "eu-north-1")
                .Badge(RichText.Plain("31 ms"))
                .Description("Stockholm")
        }
    };
}

void Install(MenuContext context)
{
    FormValues values = context.Values!;
    string[] steps = { "Copy files", "Register service", "Configure connection", "Start service" };
    StatusList list = Ui.StatusList("steps");
    foreach (string step in steps)
    {
        list.Set(step, step, StatusKind.Pending);
    }

    ProgressBar progress = Ui.ProgressBar("progress")
        .Label("Install")
        .Total(steps.Length * 10)
        .LabelWidth(22);
    Dashboard dashboard = Ui.Dashboard()
        .Title("Installing")
        .Subtitle(Markup.Escape(values.Get<string>("Path")))
        .Content(body => body.Panel(Ui.Panel().Title("Steps").Content(panelContent =>
        {
            panelContent.Add(list);
        })).Padding(padding => padding.Left(1).Top(0).Right(1).Bottom(0).Content(paddingContent =>
        {
            paddingContent.Add(progress);
        })));
    context.Run(dashboard, run =>
    {
        StatusListHandle handle = list.Handle(run.Session);
        ProgressHandle bar = progress.Handle(run.Session);
        foreach (string step in steps)
        {
            handle.Set(step, StatusKind.Running);
            bar.Label(step);
            for (int i = 0; i < 10 && !run.CancellationToken.IsCancellationRequested; i++)
            {
                Thread.Sleep(90);
                bar.Advance();
            }

            handle.Set(step, StatusKind.Pass);
        }

        bar.Complete();
        Thread.Sleep(300);
        MenuRunResult done = Ui.MenuRunResult()
            .Title("Toolbox Agent installed")
            .Summary(Markup.Escape(values.Get<string>("Path")) + " · "
                + string.Join(", ",
                    values.GetList<object>("Components")) + " · "
                + Markup.Escape(values.Get<string>("Server")));
        done.Figure("steps done", steps.Length.ToString(), StatusKind.Pass);
        return done;
    });
}

Screens and keys

Two screens declared once. Type a number to open a server and Escape goes back. The footer lists the keys that work on each screen, and the header shows where you are.

Screens and keys 90×1624-bitFull

Input wait:900 '2' wait:1200 Escape wait:900 '3' wait:1200 Escape wait:700 Escape

PowerShellscreens.ps1
$servers = @(
    [pscustomobject] @{ Name = 'WEB01'; Role = 'Web'; Site = 'Warsaw' }
    [pscustomobject] @{ Name = 'SQL01'; Role = 'Database'; Site = 'Warsaw' }
    [pscustomobject] @{ Name = 'FS11'; Role = 'File'; Site = 'Berlin' }
)

Show-ConsoleApp -Title Inventory -Content {
    New-ConsoleScreen -Key list -Title Servers -KeyBinding ([ordered]@{
        '1-3' = 'open', {
            param($Number, $State)
            $State.Server = $Number
            $State.Screen = 'server'
        }
    }) -Content {
        '[muted]Type a number to open a server.[/]'
        for ($i = 0; $i -lt $servers.Count; $i++) {
            $server = $servers[$i]
            "[bold]$($i + 1)[/]  $($server.Name)  [muted]$($server.Role), $($server.Site)[/]"
        }
    }
    New-ConsoleScreen -Key server -Title { $servers[$State.Server - 1].Name } -Content {
        New-ConsoleBinding -Content {
            param($State)
            $server = $servers[$State.Server - 1]
            "[bold]$($server.Name)[/] is the $($server.Role) server in $($server.Site)."
        }
    }
}
Full program
Import-Module ConsoleMonster

$servers = @(
    [pscustomobject] @{ Name = 'WEB01'; Role = 'Web'; Site = 'Warsaw' }
    [pscustomobject] @{ Name = 'SQL01'; Role = 'Database'; Site = 'Warsaw' }
    [pscustomobject] @{ Name = 'FS11'; Role = 'File'; Site = 'Berlin' }
)

Show-ConsoleApp -Title Inventory -Content {
    New-ConsoleScreen -Key list -Title Servers -KeyBinding ([ordered]@{
        '1-3' = 'open', {
            param($Number, $State)
            $State.Server = $Number
            $State.Screen = 'server'
        }
    }) -Content {
        '[muted]Type a number to open a server.[/]'
        for ($i = 0; $i -lt $servers.Count; $i++) {
            $server = $servers[$i]
            "[bold]$($i + 1)[/]  $($server.Name)  [muted]$($server.Role), $($server.Site)[/]"
        }
    }
    New-ConsoleScreen -Key server -Title { $servers[$State.Server - 1].Name } -Content {
        New-ConsoleBinding -Content {
            param($State)
            $server = $servers[$State.Server - 1]
            "[bold]$($server.Name)[/] is the $($server.Role) server in $($server.Site)."
        }
    }
}
C#Program.cs
Server[] servers = {
    new("WEB01", "Web", "Warsaw"),
    new("SQL01", "Database", "Warsaw"),
    new("FS11", "File", "Berlin")
};

AppState state = new AppState();
Rows list = new Rows(TextBlock.FromMarkup("[muted]Type a number to open a server.[/]"));
for (int i = 0; i < servers.Length; i++) {
    Server row = servers[i];
    list.Add(
        TextBlock.FromMarkup($"[bold]{i + 1}[/]  {row.Name}  [muted]{row.Role}, {row.Site}[/]"));
}
AppScreens screens = new AppScreens();
screens.Add(new AppScreen("list", "Servers", list) {
    Bindings = {
        KeyBinding.Numbered("open", () => servers.Length, number => {
            state["Server"] = number;
            state["Screen"] = "server";
        })
    }
});
AppBinding detail = new AppBinding(s => {
    Server server = servers[s.Get("Server", 1) - 1];
    return new Rows(TextBlock.FromMarkup(
        $"[bold]{server.Name}[/] is the {server.Role} server in {server.Site}."));
});
screens.Add(new AppScreen("server", "server", new Rows(detail)) {
    TitleSource = s => servers[s.Get("Server", 1) - 1].Name
});

ConsoleApp.Run(new Rows(new HeaderBar("Inventory"), new Rows(screens).Fill()), state);

record Server(string Name, string Role, string Site);
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Widgets;

Server[] servers = {
    new("WEB01", "Web", "Warsaw"),
    new("SQL01", "Database", "Warsaw"),
    new("FS11", "File", "Berlin")
};

AppState state = new AppState();
Rows list = new Rows(TextBlock.FromMarkup("[muted]Type a number to open a server.[/]"));
for (int i = 0; i < servers.Length; i++) {
    Server row = servers[i];
    list.Add(
        TextBlock.FromMarkup($"[bold]{i + 1}[/]  {row.Name}  [muted]{row.Role}, {row.Site}[/]"));
}
AppScreens screens = new AppScreens();
screens.Add(new AppScreen("list", "Servers", list) {
    Bindings = {
        KeyBinding.Numbered("open", () => servers.Length, number => {
            state["Server"] = number;
            state["Screen"] = "server";
        })
    }
});
AppBinding detail = new AppBinding(s => {
    Server server = servers[s.Get("Server", 1) - 1];
    return new Rows(TextBlock.FromMarkup(
        $"[bold]{server.Name}[/] is the {server.Role} server in {server.Site}."));
});
screens.Add(new AppScreen("server", "server", new Rows(detail)) {
    TitleSource = s => servers[s.Get("Server", 1) - 1].Name
});

ConsoleApp.Run(new Rows(new HeaderBar("Inventory"), new Rows(screens).Fill()), state);

record Server(string Name, string Role, string Site);
C# fluentProgram.cs
Server[] servers = {
    new("WEB01", "Web", "Warsaw"),
    new("SQL01", "Database", "Warsaw"),
    new("FS11", "File", "Berlin")
};

AppState state = new AppState();
Rows list = Ui.Rows().Content(rowsContent =>
{
    rowsContent.Markup("[muted]Type a number to open a server.[/]");
});
for (int i = 0; i < servers.Length; i++)
{
    Server row = servers[i];
    list.Add(Ui.Markup($"[bold]{i + 1}[/]  {row.Name}  [muted]{row.Role}, {row.Site}[/]"));
}
AppScreens screens = new AppScreens();
screens.Add(new AppScreen("list", "Servers", list) {
    Bindings = {
        KeyBinding.Numbered("open", () => servers.Length, number => {
            state["Server"] = number;
            state["Screen"] = "server";
        })
    }
});
screens.Add(new AppScreen("server", "server", Ui.Rows().Content(rowsContent =>
{
    rowsContent.Binding(binding => binding.ContentBy(s =>
    {
        Server server = servers[s.Get("Server", 1) - 1];
        return Ui.Rows().Content(rowsContent =>
        {
            rowsContent.Markup(
                $"[bold]{server.Name}[/] is the {server.Role} server in {server.Site}.");
        });
    }));
})).TitleBy(s => servers[s.Get("Server", 1) - 1].Name));
ConsoleApp.Run(Ui.Rows().Content(rowsContent2 =>
{
    rowsContent2.HeaderBar(headerBar => headerBar.Title("Inventory"));
    rowsContent2.Add(Ui.Rows().Content(rowsContent =>
    {
        rowsContent.Add(screens);
    }).Fill());
}), state);

record Server(string Name, string Role, string Site);
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Widgets;

Server[] servers = {
    new("WEB01", "Web", "Warsaw"),
    new("SQL01", "Database", "Warsaw"),
    new("FS11", "File", "Berlin")
};

AppState state = new AppState();
Rows list = Ui.Rows().Content(rowsContent =>
{
    rowsContent.Markup("[muted]Type a number to open a server.[/]");
});
for (int i = 0; i < servers.Length; i++)
{
    Server row = servers[i];
    list.Add(Ui.Markup($"[bold]{i + 1}[/]  {row.Name}  [muted]{row.Role}, {row.Site}[/]"));
}
AppScreens screens = new AppScreens();
screens.Add(new AppScreen("list", "Servers", list) {
    Bindings = {
        KeyBinding.Numbered("open", () => servers.Length, number => {
            state["Server"] = number;
            state["Screen"] = "server";
        })
    }
});
screens.Add(new AppScreen("server", "server", Ui.Rows().Content(rowsContent =>
{
    rowsContent.Binding(binding => binding.ContentBy(s =>
    {
        Server server = servers[s.Get("Server", 1) - 1];
        return Ui.Rows().Content(rowsContent =>
        {
            rowsContent.Markup(
                $"[bold]{server.Name}[/] is the {server.Role} server in {server.Site}.");
        });
    }));
})).TitleBy(s => servers[s.Get("Server", 1) - 1].Name));
ConsoleApp.Run(Ui.Rows().Content(rowsContent2 =>
{
    rowsContent2.HeaderBar(headerBar => headerBar.Title("Inventory"));
    rowsContent2.Add(Ui.Rows().Content(rowsContent =>
    {
        rowsContent.Add(screens);
    }).Fill());
}), state);

record Server(string Name, string Role, string Site);

PowerShell 7 draws the same screens for the same keys.

Tabs, toggles and dates

Retained tabs with Ctrl+PageDown, toggles that Space flips, and a date picker where Space marks the start and end of a range. The line underneath follows every change.

Tabs, toggles and dates 90×2224-bitFull

Input wait:600 Space wait:600 Tab wait:500 Right wait:500 Right wait:500 Space wait:500 Right wait:500 Right wait:500 Space wait:900 Ctrl+PageDown wait:700 Space wait:1200 Escape

PowerShellcontrols.ps1
# A fixed "today", so the calendar opens on the same month every time.
$dates = @{
    Today = [datetime] '2026-11-18'; FirstDayOfWeek = 'Monday'
}

Show-ConsoleApp -Title Maintenance -Content {
    New-ConsoleTabs -Content ([ordered] @{
        Schedule = {
            New-ConsoleToggle -Key Enabled -Label 'Run nightly checks' -Value $true
            New-ConsoleDatePicker -Key Window -Range -Selection $dates
        }
        Notify = {
            New-ConsoleToggle -Key Email -Label 'Email the report'
            New-ConsoleToggle -Key Teams -Label 'Post to Teams'
        }
    })
    # One line under the tabs follows every change.
    New-ConsoleBinding -Content {
        param($State)
        $checks = if ($State.Enabled) { 'on' } else { 'off' }
        $window = if ($State.Window) { $State.Window } else { 'none' }
        $email = if ($State.Email) { 'yes' } else { 'no' }
        "[muted]Checks[/] $checks  [muted]Window[/] $window  [muted]Email[/] $email"
    }
}
Full program
Import-Module ConsoleMonster

# A fixed "today", so the calendar opens on the same month every time.
$dates = @{
    Today = [datetime] '2026-11-18'; FirstDayOfWeek = 'Monday'
}

Show-ConsoleApp -Title Maintenance -Content {
    New-ConsoleTabs -Content ([ordered] @{
        Schedule = {
            New-ConsoleToggle -Key Enabled -Label 'Run nightly checks' -Value $true
            New-ConsoleDatePicker -Key Window -Range -Selection $dates
        }
        Notify = {
            New-ConsoleToggle -Key Email -Label 'Email the report'
            New-ConsoleToggle -Key Teams -Label 'Post to Teams'
        }
    })
    # One line under the tabs follows every change.
    New-ConsoleBinding -Content {
        param($State)
        $checks = if ($State.Enabled) { 'on' } else { 'off' }
        $window = if ($State.Window) { $State.Window } else { 'none' }
        $email = if ($State.Email) { 'yes' } else { 'no' }
        "[muted]Checks[/] $checks  [muted]Window[/] $window  [muted]Email[/] $email"
    }
}
C#Program.cs
// A fixed "today", so the calendar opens on the same month every time.
var dates = new DateSelectionOptions {
    Today = new DateTime(2026, 11, 18),
    FirstDayOfWeek = DayOfWeek.Monday
};
var schedule = new Rows(
    new Toggle("Enabled", true) { Label = "Run nightly checks" },
    dates.CreatePicker("Window", true));
var notify = new Rows(
    new Toggle("Email") { Label = "Email the report" },
    new Toggle("Teams") { Label = "Post to Teams" });
var tabs = new Tabs().Add("Schedule", schedule).Add("Notify", notify);

// One line under the tabs follows every change.
var summary = new AppBinding(state => TextBlock.FromMarkup(
    $"[muted]Checks[/] {(state.Get("Enabled", false) ? "on" : "off")}" +
    $"  [muted]Window[/] {state["Window"] ?? "none"}" +
    $"  [muted]Email[/] {(state.Get("Email", false) ? "yes" : "no")}"));

ConsoleApp.Run(new Rows(new HeaderBar("Maintenance"), tabs, summary), new AppState());
Full program
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Widgets;

// A fixed "today", so the calendar opens on the same month every time.
var dates = new DateSelectionOptions {
    Today = new DateTime(2026, 11, 18),
    FirstDayOfWeek = DayOfWeek.Monday
};
var schedule = new Rows(
    new Toggle("Enabled", true) { Label = "Run nightly checks" },
    dates.CreatePicker("Window", true));
var notify = new Rows(
    new Toggle("Email") { Label = "Email the report" },
    new Toggle("Teams") { Label = "Post to Teams" });
var tabs = new Tabs().Add("Schedule", schedule).Add("Notify", notify);

// One line under the tabs follows every change.
var summary = new AppBinding(state => TextBlock.FromMarkup(
    $"[muted]Checks[/] {(state.Get("Enabled", false) ? "on" : "off")}" +
    $"  [muted]Window[/] {state["Window"] ?? "none"}" +
    $"  [muted]Email[/] {(state.Get("Email", false) ? "yes" : "no")}"));

ConsoleApp.Run(new Rows(new HeaderBar("Maintenance"), tabs, summary), new AppState());
C# fluentProgram.cs
// A fixed "today", so the calendar opens on the same month every time.
var dates = new DateSelectionOptions()
    .Today(new DateTime(2026, 11, 18))
    .FirstDayOfWeek(DayOfWeek.Monday);
var schedule = Ui.Rows().Content(rowsContent =>
{
    rowsContent.Toggle(toggle => toggle.Key("Enabled").Value(true).Label("Run nightly checks"));
    rowsContent.Add(dates.CreatePicker("Window", true));
});
var notify = Ui.Rows().Content(rowsContent =>
{
    rowsContent.Toggle(toggle => toggle.Key("Email").Label("Email the report"));
    rowsContent.Toggle(toggle => toggle.Key("Teams").Label("Post to Teams"));
});
var tabs = Ui.Tabs().Add("Schedule", schedule).Add("Notify", notify);

// One line under the tabs follows every change.
ConsoleApp.Run(Ui.Rows().Content(rowsContent =>
{
    rowsContent.HeaderBar(headerBar => headerBar.Title("Maintenance"));
    rowsContent.Add(tabs);
    rowsContent.Binding(
        binding => binding.ContentBy(
            state => Ui.Markup($"[muted]Checks[/] {(state.Get("Enabled", false) ? "on" : "off")}"
                + $"  [muted]Window[/] {state["Window"] ?? "none"}"
                + $"  [muted]Email[/] {(state.Get("Email", false) ? "yes" : "no")}")));
}), new AppState());
Full program
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Widgets;
using ConsoleMonster;

// A fixed "today", so the calendar opens on the same month every time.
var dates = new DateSelectionOptions()
    .Today(new DateTime(2026, 11, 18))
    .FirstDayOfWeek(DayOfWeek.Monday);
var schedule = Ui.Rows().Content(rowsContent =>
{
    rowsContent.Toggle(toggle => toggle.Key("Enabled").Value(true).Label("Run nightly checks"));
    rowsContent.Add(dates.CreatePicker("Window", true));
});
var notify = Ui.Rows().Content(rowsContent =>
{
    rowsContent.Toggle(toggle => toggle.Key("Email").Label("Email the report"));
    rowsContent.Toggle(toggle => toggle.Key("Teams").Label("Post to Teams"));
});
var tabs = Ui.Tabs().Add("Schedule", schedule).Add("Notify", notify);

// One line under the tabs follows every change.
ConsoleApp.Run(Ui.Rows().Content(rowsContent =>
{
    rowsContent.HeaderBar(headerBar => headerBar.Title("Maintenance"));
    rowsContent.Add(tabs);
    rowsContent.Binding(
        binding => binding.ContentBy(
            state => Ui.Markup($"[muted]Checks[/] {(state.Get("Enabled", false) ? "on" : "off")}"
                + $"  [muted]Window[/] {state["Window"] ?? "none"}"
                + $"  [muted]Email[/] {(state.Get("Email", false) ? "yes" : "no")}")));
}), new AppState());

PowerShell 7 draws the same screens for the same keys.

The grid

An Out-GridView for the console on 5.1 and 7: typing filters, F3 sorts by column, Space marks rows, Enter shows every column of a row and Ctrl+Enter returns the original objects.

The grid 110×2224-bitFull

Input "sql" wait:200 Backspace Backspace Backspace F3 Down Space Down Space Enter wait:200 Escape Ctrl+Enter

PowerShellgrid.ps1
$services = @(
    [pscustomobject] @{ Name = 'Spooler'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 14221312 }
    [pscustomobject] @{ Name = 'MSSQLSERVER'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 812466176 }
    # … 8 more lines in the full program
)

$picked = $services | Show-ConsoleGrid -Title 'Services on FS01' -Property @(
    @{ Name = 'Name'; Key = $true }
    @{ Name = 'Status'; Presenter = 'Status' }
    @{ Name = 'StartType'; Header = 'Start type' }
    @{ Name = 'Memory'; Presenter = 'Bytes' }
)
Write-ConsoleText -Markup "Picked [bold]$(@($picked).Count)[/] services"
Full program
Import-Module ConsoleMonster

$services = @(
    [pscustomobject] @{ Name = 'Spooler'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 14221312 }
    [pscustomobject] @{ Name = 'MSSQLSERVER'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 812466176 }
    [pscustomobject] @{ Name = 'SQLSERVERAGENT'; Status = 'Warn'; StartType = 'Manual'
        Memory = 42004480 }
    [pscustomobject] @{ Name = 'W32Time'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 3276800 }
    [pscustomobject] @{ Name = 'WinRM'; Status = 'Pass'; StartType = 'Automatic'; Memory = 9830400 }
    [pscustomobject] @{ Name = 'DFSR'; Status = 'Fail'; StartType = 'Automatic'; Memory = 0 }
    [pscustomobject] @{ Name = 'LanmanServer'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 6553600 }
)

$picked = $services | Show-ConsoleGrid -Title 'Services on FS01' -Property @(
    @{ Name = 'Name'; Key = $true }
    @{ Name = 'Status'; Presenter = 'Status' }
    @{ Name = 'StartType'; Header = 'Start type' }
    @{ Name = 'Memory'; Presenter = 'Bytes' }
)
Write-ConsoleText -Markup "Picked [bold]$(@($picked).Count)[/] services"
C#Program.cs
Grid grid = new Grid("Services on FS01")
    .Column(new TableColumn("Name") { IsKey = true })
    .Column(new TableColumn("Status") { Presenter = CellPresenters.Status })
    .Column("Start type")
    .Column(new TableColumn("Memory") { Presenter = CellPresenters.Bytes })
    .Row("Spooler", "Spooler", StatusKind.Pass, "Automatic", 14_221_312L)
    .Row("MSSQLSERVER", "MSSQLSERVER", StatusKind.Pass, "Automatic", 812_466_176L)
    // … 4 more lines in the full program
    .Row("LanmanServer", "LanmanServer", StatusKind.Pass, "Automatic", 6_553_600L);
GridResult picked = grid.Show();
Terminal.WriteMarkupLine("Picked [bold]" + picked.Items.Count + "[/] services");
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Presenters;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;

Grid grid = new Grid("Services on FS01")
    .Column(new TableColumn("Name") { IsKey = true })
    .Column(new TableColumn("Status") { Presenter = CellPresenters.Status })
    .Column("Start type")
    .Column(new TableColumn("Memory") { Presenter = CellPresenters.Bytes })
    .Row("Spooler", "Spooler", StatusKind.Pass, "Automatic", 14_221_312L)
    .Row("MSSQLSERVER", "MSSQLSERVER", StatusKind.Pass, "Automatic", 812_466_176L)
    .Row("SQLSERVERAGENT", "SQLSERVERAGENT", StatusKind.Warn, "Manual", 42_004_480L)
    .Row("W32Time", "W32Time", StatusKind.Pass, "Automatic", 3_276_800L)
    .Row("WinRM", "WinRM", StatusKind.Pass, "Automatic", 9_830_400L)
    .Row("DFSR", "DFSR", StatusKind.Fail, "Automatic", 0L)
    .Row("LanmanServer", "LanmanServer", StatusKind.Pass, "Automatic", 6_553_600L);
GridResult picked = grid.Show();
Terminal.WriteMarkupLine("Picked [bold]" + picked.Items.Count + "[/] services");
C# fluentProgram.cs
Grid grid = Ui.Grid()
    .Title("Services on FS01")
    .Column(new TableColumn("Name").Key())
    .Column(new TableColumn("Status").Presenter(CellPresenters.Status))
    .Column("Start type")
    .Column(new TableColumn("Memory").Presenter(CellPresenters.Bytes))
    .Row("Spooler", "Spooler", StatusKind.Pass, "Automatic", 14_221_312L)
    .Row("MSSQLSERVER", "MSSQLSERVER", StatusKind.Pass, "Automatic", 812_466_176L)
    .Row("SQLSERVERAGENT", "SQLSERVERAGENT", StatusKind.Warn, "Manual", 42_004_480L)
    .Row("W32Time", "W32Time", StatusKind.Pass, "Automatic", 3_276_800L)
    .Row("WinRM", "WinRM", StatusKind.Pass, "Automatic", 9_830_400L)
    .Row("DFSR", "DFSR", StatusKind.Fail, "Automatic", 0L)
    .Row("LanmanServer", "LanmanServer", StatusKind.Pass, "Automatic", 6_553_600L);
GridResult picked = grid.Show();
Terminal.WriteMarkupLine("Picked [bold]" + picked.Items.Count + "[/] services");
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Presenters;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;

Grid grid = Ui.Grid()
    .Title("Services on FS01")
    .Column(new TableColumn("Name").Key())
    .Column(new TableColumn("Status").Presenter(CellPresenters.Status))
    .Column("Start type")
    .Column(new TableColumn("Memory").Presenter(CellPresenters.Bytes))
    .Row("Spooler", "Spooler", StatusKind.Pass, "Automatic", 14_221_312L)
    .Row("MSSQLSERVER", "MSSQLSERVER", StatusKind.Pass, "Automatic", 812_466_176L)
    .Row("SQLSERVERAGENT", "SQLSERVERAGENT", StatusKind.Warn, "Manual", 42_004_480L)
    .Row("W32Time", "W32Time", StatusKind.Pass, "Automatic", 3_276_800L)
    .Row("WinRM", "WinRM", StatusKind.Pass, "Automatic", 9_830_400L)
    .Row("DFSR", "DFSR", StatusKind.Fail, "Automatic", 0L)
    .Row("LanmanServer", "LanmanServer", StatusKind.Pass, "Automatic", 6_553_600L);
GridResult picked = grid.Show();
Terminal.WriteMarkupLine("Picked [bold]" + picked.Items.Count + "[/] services");

PowerShell 7 draws the same screens for the same keys.

The grid with the mouse

The same program, with the mouse. Clicking a header sorts by it, clicking a row moves to it, double-clicking shows every column (Escape closes it), a right click lists the keys that work there, and clicking a hint in the footer presses its key: here Space to select and Ctrl+Enter to finish.

The grid with the mouse 110×2224-bitFull

Input click:46,4 click:12,6 click:14,21 click:12,11 click:14,21 dclick:12,11 Escape rclick:40,11 Escape click:30,21

PowerShellgrid.ps1
$services = @(
    [pscustomobject] @{ Name = 'Spooler'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 14221312 }
    [pscustomobject] @{ Name = 'MSSQLSERVER'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 812466176 }
    # … 8 more lines in the full program
)

$picked = $services | Show-ConsoleGrid -Title 'Services on FS01' -Property @(
    @{ Name = 'Name'; Key = $true }
    @{ Name = 'Status'; Presenter = 'Status' }
    @{ Name = 'StartType'; Header = 'Start type' }
    @{ Name = 'Memory'; Presenter = 'Bytes' }
)
Write-ConsoleText -Markup "Picked [bold]$(@($picked).Count)[/] services"
Full program
Import-Module ConsoleMonster

$services = @(
    [pscustomobject] @{ Name = 'Spooler'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 14221312 }
    [pscustomobject] @{ Name = 'MSSQLSERVER'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 812466176 }
    [pscustomobject] @{ Name = 'SQLSERVERAGENT'; Status = 'Warn'; StartType = 'Manual'
        Memory = 42004480 }
    [pscustomobject] @{ Name = 'W32Time'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 3276800 }
    [pscustomobject] @{ Name = 'WinRM'; Status = 'Pass'; StartType = 'Automatic'; Memory = 9830400 }
    [pscustomobject] @{ Name = 'DFSR'; Status = 'Fail'; StartType = 'Automatic'; Memory = 0 }
    [pscustomobject] @{ Name = 'LanmanServer'; Status = 'Pass'; StartType = 'Automatic'
        Memory = 6553600 }
)

$picked = $services | Show-ConsoleGrid -Title 'Services on FS01' -Property @(
    @{ Name = 'Name'; Key = $true }
    @{ Name = 'Status'; Presenter = 'Status' }
    @{ Name = 'StartType'; Header = 'Start type' }
    @{ Name = 'Memory'; Presenter = 'Bytes' }
)
Write-ConsoleText -Markup "Picked [bold]$(@($picked).Count)[/] services"
C#Program.cs
Grid grid = new Grid("Services on FS01")
    .Column(new TableColumn("Name") { IsKey = true })
    .Column(new TableColumn("Status") { Presenter = CellPresenters.Status })
    .Column("Start type")
    .Column(new TableColumn("Memory") { Presenter = CellPresenters.Bytes })
    .Row("Spooler", "Spooler", StatusKind.Pass, "Automatic", 14_221_312L)
    .Row("MSSQLSERVER", "MSSQLSERVER", StatusKind.Pass, "Automatic", 812_466_176L)
    // … 4 more lines in the full program
    .Row("LanmanServer", "LanmanServer", StatusKind.Pass, "Automatic", 6_553_600L);
GridResult picked = grid.Show();
Terminal.WriteMarkupLine("Picked [bold]" + picked.Items.Count + "[/] services");
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Presenters;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;

Grid grid = new Grid("Services on FS01")
    .Column(new TableColumn("Name") { IsKey = true })
    .Column(new TableColumn("Status") { Presenter = CellPresenters.Status })
    .Column("Start type")
    .Column(new TableColumn("Memory") { Presenter = CellPresenters.Bytes })
    .Row("Spooler", "Spooler", StatusKind.Pass, "Automatic", 14_221_312L)
    .Row("MSSQLSERVER", "MSSQLSERVER", StatusKind.Pass, "Automatic", 812_466_176L)
    .Row("SQLSERVERAGENT", "SQLSERVERAGENT", StatusKind.Warn, "Manual", 42_004_480L)
    .Row("W32Time", "W32Time", StatusKind.Pass, "Automatic", 3_276_800L)
    .Row("WinRM", "WinRM", StatusKind.Pass, "Automatic", 9_830_400L)
    .Row("DFSR", "DFSR", StatusKind.Fail, "Automatic", 0L)
    .Row("LanmanServer", "LanmanServer", StatusKind.Pass, "Automatic", 6_553_600L);
GridResult picked = grid.Show();
Terminal.WriteMarkupLine("Picked [bold]" + picked.Items.Count + "[/] services");
C# fluentProgram.cs
Grid grid = Ui.Grid()
    .Title("Services on FS01")
    .Column(new TableColumn("Name").Key())
    .Column(new TableColumn("Status").Presenter(CellPresenters.Status))
    .Column("Start type")
    .Column(new TableColumn("Memory").Presenter(CellPresenters.Bytes))
    .Row("Spooler", "Spooler", StatusKind.Pass, "Automatic", 14_221_312L)
    .Row("MSSQLSERVER", "MSSQLSERVER", StatusKind.Pass, "Automatic", 812_466_176L)
    .Row("SQLSERVERAGENT", "SQLSERVERAGENT", StatusKind.Warn, "Manual", 42_004_480L)
    .Row("W32Time", "W32Time", StatusKind.Pass, "Automatic", 3_276_800L)
    .Row("WinRM", "WinRM", StatusKind.Pass, "Automatic", 9_830_400L)
    .Row("DFSR", "DFSR", StatusKind.Fail, "Automatic", 0L)
    .Row("LanmanServer", "LanmanServer", StatusKind.Pass, "Automatic", 6_553_600L);
GridResult picked = grid.Show();
Terminal.WriteMarkupLine("Picked [bold]" + picked.Items.Count + "[/] services");
Full program
using ConsoleMonster;
using ConsoleMonster.Interactive;
using ConsoleMonster.Presenters;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;

Grid grid = Ui.Grid()
    .Title("Services on FS01")
    .Column(new TableColumn("Name").Key())
    .Column(new TableColumn("Status").Presenter(CellPresenters.Status))
    .Column("Start type")
    .Column(new TableColumn("Memory").Presenter(CellPresenters.Bytes))
    .Row("Spooler", "Spooler", StatusKind.Pass, "Automatic", 14_221_312L)
    .Row("MSSQLSERVER", "MSSQLSERVER", StatusKind.Pass, "Automatic", 812_466_176L)
    .Row("SQLSERVERAGENT", "SQLSERVERAGENT", StatusKind.Warn, "Manual", 42_004_480L)
    .Row("W32Time", "W32Time", StatusKind.Pass, "Automatic", 3_276_800L)
    .Row("WinRM", "WinRM", StatusKind.Pass, "Automatic", 9_830_400L)
    .Row("DFSR", "DFSR", StatusKind.Fail, "Automatic", 0L)
    .Row("LanmanServer", "LanmanServer", StatusKind.Pass, "Automatic", 6_553_600L);
GridResult picked = grid.Show();
Terminal.WriteMarkupLine("Picked [bold]" + picked.Items.Count + "[/] services");

PowerShell 7 draws the same screens for the same keys.

A tree you can filter

An object tree inside an app. Right expands a branch, typing filters what is open, and a double-click (or Enter) opens a row as its own tree. The line underneath shows the path of the selected node, which is the value in app state.

A tree you can filter 90×1624-bitFull

Input Right Down*4 Right "sql" dclick:8,3 Down Down Escape

PowerShelltree.ps1
$estate = [pscustomobject] @{
    Warsaw = @(
        [pscustomobject] @{ Name = 'WEB01'; Role = 'Web'; Patched = '2026-10-28' }
        [pscustomobject] @{ Name = 'SQL01'; Role = 'Database'; Patched = '2026-10-12' }
        [pscustomobject] @{ Name = 'FS01'; Role = 'File'; Patched = '2026-09-30' }
    )
    Berlin = @(
        [pscustomobject] @{ Name = 'WEB11'; Role = 'Web'; Patched = '2026-10-28' }
        [pscustomobject] @{ Name = 'SQL11'; Role = 'Database'; Patched = '2026-08-19' }
    )
}

Show-ConsoleApp -Title Inventory -Content {
    $treeSelectParameters = @{
        Key = 'Tree'
        Label = 'Servers'
        InputObject = $estate
        RootPath = '$estate'
        Height = 10
    }
    New-ConsoleTreeSelect @treeSelectParameters
    New-ConsoleBinding -Content {
        param($State)
        $path = if ($State.Tree) { $State.Tree.Path } else { 'nothing' }
        New-ConsoleText -Text "Selected: $path"
    }
}
Full program
Import-Module ConsoleMonster

$estate = [pscustomobject] @{
    Warsaw = @(
        [pscustomobject] @{ Name = 'WEB01'; Role = 'Web'; Patched = '2026-10-28' }
        [pscustomobject] @{ Name = 'SQL01'; Role = 'Database'; Patched = '2026-10-12' }
        [pscustomobject] @{ Name = 'FS01'; Role = 'File'; Patched = '2026-09-30' }
    )
    Berlin = @(
        [pscustomobject] @{ Name = 'WEB11'; Role = 'Web'; Patched = '2026-10-28' }
        [pscustomobject] @{ Name = 'SQL11'; Role = 'Database'; Patched = '2026-08-19' }
    )
}

Show-ConsoleApp -Title Inventory -Content {
    $treeSelectParameters = @{
        Key = 'Tree'
        Label = 'Servers'
        InputObject = $estate
        RootPath = '$estate'
        Height = 10
    }
    New-ConsoleTreeSelect @treeSelectParameters
    New-ConsoleBinding -Content {
        param($State)
        $path = if ($State.Tree) { $State.Tree.Path } else { 'nothing' }
        New-ConsoleText -Text "Selected: $path"
    }
}
C#Program.cs
var estate = new
{
    Warsaw = new[]
    {
        new Server("WEB01", "Web", "2026-10-28"),
        new Server("SQL01", "Database", "2026-10-12"),
        new Server("FS01", "File", "2026-09-30")
    },
    Berlin = new[]
    {
        new Server("WEB11", "Web", "2026-10-28"),
        new Server("SQL11", "Database", "2026-08-19")
    }
};

TreeSelect tree = new TreeSelect("Tree", new ObjectExplorer(estate, default, "$estate")) {
    Label = "Servers",
    Height = 10
};
AppBinding picked = new AppBinding(state =>
    TextBlock.Plain("Selected: " + (state["Tree"] is ExplorerNode node ? node.Path : "nothing")));
ConsoleApp.Run(new Rows(new HeaderBar("Inventory"), tree, picked));

record Server(string Name, string Role, string Patched);
Full program
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Widgets;

var estate = new
{
    Warsaw = new[]
    {
        new Server("WEB01", "Web", "2026-10-28"),
        new Server("SQL01", "Database", "2026-10-12"),
        new Server("FS01", "File", "2026-09-30")
    },
    Berlin = new[]
    {
        new Server("WEB11", "Web", "2026-10-28"),
        new Server("SQL11", "Database", "2026-08-19")
    }
};

TreeSelect tree = new TreeSelect("Tree", new ObjectExplorer(estate, default, "$estate")) {
    Label = "Servers",
    Height = 10
};
AppBinding picked = new AppBinding(state =>
    TextBlock.Plain("Selected: " + (state["Tree"] is ExplorerNode node ? node.Path : "nothing")));
ConsoleApp.Run(new Rows(new HeaderBar("Inventory"), tree, picked));

record Server(string Name, string Role, string Patched);
C# fluentProgram.cs
var estate = new
{
    Warsaw = new[]
    {
        new Server("WEB01", "Web", "2026-10-28"),
        new Server("SQL01", "Database", "2026-10-12"),
        new Server("FS01", "File", "2026-09-30")
    },
    Berlin = new[]
    {
        new Server("WEB11", "Web", "2026-10-28"),
        new Server("SQL11", "Database", "2026-08-19")
    }
};
TreeSelect tree = ((TreeSelect)Ui.TreeSelect()
    .Key("Tree")
    .Explorer(new ObjectExplorer(estate, default, "$estate"))
    .Label("Servers")
    .Height(10)
    .Build());
ConsoleApp.Run(Ui.Rows().Content(rowsContent =>
{
    rowsContent.HeaderBar(headerBar => headerBar.Title("Inventory"));
    rowsContent.Add(tree);
    rowsContent.Binding(binding => binding.ContentBy(state => Ui.Text("Selected: "
        + (state["Tree"] is ExplorerNode node ? node.Path : "nothing"))));
}));

record Server(string Name, string Role, string Patched);
Full program
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Widgets;
using ConsoleMonster;

var estate = new
{
    Warsaw = new[]
    {
        new Server("WEB01", "Web", "2026-10-28"),
        new Server("SQL01", "Database", "2026-10-12"),
        new Server("FS01", "File", "2026-09-30")
    },
    Berlin = new[]
    {
        new Server("WEB11", "Web", "2026-10-28"),
        new Server("SQL11", "Database", "2026-08-19")
    }
};
TreeSelect tree = ((TreeSelect)Ui.TreeSelect()
    .Key("Tree")
    .Explorer(new ObjectExplorer(estate, default, "$estate"))
    .Label("Servers")
    .Height(10)
    .Build());
ConsoleApp.Run(Ui.Rows().Content(rowsContent =>
{
    rowsContent.HeaderBar(headerBar => headerBar.Title("Inventory"));
    rowsContent.Add(tree);
    rowsContent.Binding(binding => binding.ContentBy(state => Ui.Text("Selected: "
        + (state["Tree"] is ExplorerNode node ? node.Path : "nothing"))));
}));

record Server(string Name, string Role, string Patched);

PowerShell 7 draws the same screens for the same keys.