Skip to content
ConsoleMonster

Everyday formatting

Turn the same task objects from plain text into a readable table with status colour and aligned numbers.

Demos Everyday

Use it when raw object output needs readable columns and meaningful status colours.

  • Static
  • 88×28
  • PowerShell 7.4+
  • .NET 8.0+
Everyday formatting 88×2824-bitFull

How it's built

The whole program in one file, with its sample data at the top. It drew the recording above; both languages draw the same cells.

PowerShelleveryday-formatting.ps1View on GitHub
# Show the same task data as plain text and a formatted table.
param(
    [switch]$StaticSnapshot,
    [ValidateRange(0, 0)][int]$Step = 0
)

Import-Module ConsoleMonster
# All data is synthetic and inline; no services are contacted or changed.

# Data: fictional inputs kept in memory.
# The same synthetic objects feed the plain baseline and the formatted table.
$tasks = @(
    [pscustomobject]@{ Task = 'Draft release notes'; State = 'Ready'; Minutes = 12 }
    [pscustomobject]@{ Task = 'Review examples'; State = 'In progress'; Minutes = 25 }
    [pscustomobject]@{ Task = 'Archive old drafts'; State = 'Waiting'; Minutes = 8 }
)
$baseline = ($tasks | ForEach-Object { "$($_.Task) | $($_.State) | $($_.Minutes) min" }) -join "`n"

# Layout: compose the screen from the data above.
$screen = New-ConsoleRows -Gap 1 {
    New-ConsoleRule '[bold]Everyday formatting[/] [muted]| same objects, clearer output[/]'
    New-ConsoleText -Markup '[bold]Before[/] [muted]| plain text[/]'
    New-ConsoleText $baseline
    New-ConsoleText -Markup '[bold]After[/] [muted]| ConsoleMonster table[/]'
    $tasks | New-ConsoleTable -Property Task, State, Minutes -Expand
    New-ConsoleText -Markup '[muted]Three tasks. Aligned columns and right-aligned numbers.[/]'
}

# Live updates: this static screen prints once and returns immediately.
$screen | Write-ConsoleWidget
C#Program.csView on GitHub
// Show the same task data as plain text and a formatted table.
// All data is synthetic and inline; no services are contacted or changed.
using ConsoleMonster;
using ConsoleMonster.Layout;
using ConsoleMonster.Presenters;
using ConsoleMonster.Widgets;

// Data: fictional inputs kept in memory.
// The same synthetic objects feed both views. Static arguments can be ignored.
var tasks = new[] {
    new { Task = "Draft release notes", State = "Ready", Minutes = 12 },
    new { Task = "Review examples", State = "In progress", Minutes = 25 },
    new { Task = "Archive old drafts", State = "Waiting", Minutes = 8 }
};
// Layout: compose the screen from the data above.
string baseline = "";
Table table = new Table { Expand = true };
table.AddColumn("Task");
table.AddColumn("State", column => column.Presenter = CellPresenters.StatusWord);
table.AddColumn("Minutes");
foreach (var task in tasks) {
    if (baseline.Length > 0) {
        baseline += "\n";
    }
    baseline += $"{task.Task} | {task.State} | {task.Minutes} min";
    table.AddRow(task.Task, TableCell.FromValue(task.State), TableCell.FromValue(task.Minutes));
}

Rows layout = new Rows(
    new Rule("[bold]Everyday formatting[/] [muted]| same objects, clearer output[/]"),
    new TextBlock("[bold]Before[/] [muted]| plain text[/]"),
    new TextBlock(baseline),
    new TextBlock("[bold]After[/] [muted]| ConsoleMonster table[/]"),
    table,
    new TextBlock("[muted]Three tasks. Aligned columns and right-aligned numbers.[/]")) { Gap = 1 };

// Live updates: this static screen prints once and returns immediately.
Terminal.Write(layout);

Run it yourself

Three steps in PowerShell, four in C#. Every command copies with one click.

  1. Install the module

    Once. Windows PowerShell 5.1 or PowerShell 7 on Windows, macOS or Linux.

    Install-Module ConsoleMonster -Scope CurrentUser
  2. Save the program

    Download it, or copy it from above into everyday-formatting.ps1.

  3. Run it

    From the folder you saved it in.

    ./everyday-formatting.ps1
  1. Create a project

    A plain console app; .NET 8 or later.

    dotnet new console -n Everydayformatting; cd Everydayformatting
  2. Add ConsoleMonster

    The only package the program needs.

    dotnet add package ConsoleMonster
  3. Replace Program.cs

    Download it, or copy the program from above.

  4. Run it

    dotnet run

Or skip the copying. Every demo ships with the module and the project template.

Show-ConsoleDemo everyday-formatting
Get-ConsoleDemo everyday-formatting -Path ./everyday-formatting.ps1
dotnet new install ConsoleMonster.Templates
dotnet new consolemonster --demo everyday-formatting -n Everydayformatting

Make it yours

Start with these, then read the rest of the file.

  1. Replace the synthetic task objects with your own local task list and keep both views on that same collection.

  2. Add a priority or project field to the objects, then add its column and cell to the table.

  3. Change the state-to-colour mapping and numeric column to match your everyday report.

More everyday

All demos