Everyday formatting
Turn the same task objects from plain text into a readable table with status colour and aligned numbers.
- Static
- 88×28
- 30 lines
Show-ConsoleDemo everyday-formattingdotnet new consolemonster --demo everyday-formattingReview local edits and branch divergence across several repositories in one compact workspace report.
Demos Everyday
Use it when several repositories need review before you change branches or start a release.
── Repository workspace · ./work ─────────────────────────────────────────────────────────────────── ╭─────────────┬───────────────────────────────────────────────┬──────────┬────────┬───────┬────────╮ │ Repository │ Branch │ Modified │ Staged │ Ahead │ Behind │ ├─────────────┼───────────────────────────────────────────────┼──────────┼────────┼───────┼────────┤ │ orbit-api │ feature/cache │ 3 │ 1 │ 2 │ 0 │ │ orbit-cli │ main │ 0 │ 0 │ 0 │ 4 │ │ orbit-docs │ docs/setup │ 2 │ 0 │ 0 │ 0 │ │ orbit-tests │ main │ 0 │ 0 │ 0 │ 0 │ ╰─────────────┴───────────────────────────────────────────────┴──────────┴────────┴───────┴────────╯ ╭─ Suggested next steps ───────────────────────────────────────────────────────────────────────────╮ │ ◆ orbit-api Review the staged diff before committing │ │ ▴ orbit-cli Working tree clean; inspect four incoming commi… │ │ ◆ orbit-docs Two local edits need review │ │ ✓ orbit-tests Clean and up to date │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
The whole program in one file, with its sample data at the top. It drew the recording above; both languages draw the same cells.
# Review several repositories without leaving the terminal.
param([switch] $StaticSnapshot, [ValidateRange(0, 0)][int] $Step = 0)
Import-Module ConsoleMonster
# Data: cached fictional git summaries; no git process or remote request runs here.
$repositories = @(
[pscustomobject] @{ Repository = 'orbit-api'; Branch = 'feature/cache'; Modified = 3; Staged = 1; Ahead = 2; Behind = 0 }
[pscustomobject] @{ Repository = 'orbit-cli'; Branch = 'main'; Modified = 0; Staged = 0; Ahead = 0; Behind = 4 }
[pscustomobject] @{ Repository = 'orbit-docs'; Branch = 'docs/setup'; Modified = 2; Staged = 0; Ahead = 0; Behind = 0 }
[pscustomobject] @{ Repository = 'orbit-tests'; Branch = 'main'; Modified = 0; Staged = 0; Ahead = 0; Behind = 0 }
)
# Layout: numeric columns keep local changes separate from branch divergence.
$report = New-ConsoleRows -Gap 1 {
New-ConsoleRule '[bold]Repository workspace[/] [muted]· ./work[/]'
New-ConsoleTable -InputObject $repositories -Property Repository, Branch, Modified, Staged, Ahead, Behind -Expand
New-ConsolePanel -Title 'Suggested next steps' {
New-ConsoleStatusList {
New-ConsoleStatusItem 'orbit-api' -Status Info -Detail 'Review the staged diff before committing'
New-ConsoleStatusItem 'orbit-cli' -Status Warn -Detail 'Working tree clean; inspect four incoming commits'
New-ConsoleStatusItem 'orbit-docs' -Status Info -Detail 'Two local edits need review'
New-ConsoleStatusItem 'orbit-tests' -Status Pass -Detail 'Clean and up to date'
}
}
}
# Behaviour: print once. Keep cached summaries fresh in a separate local collection step.
$report | Write-ConsoleWidget
// Review several repositories without leaving the terminal.
using ConsoleMonster;
using ConsoleMonster.Layout;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;
// Data: cached fictional git summaries; no git process or remote request runs here.
var repositories = new[] {
new { Repository = "orbit-api", Branch = "feature/cache", Modified = 3, Staged = 1, Ahead = 2, Behind = 0 },
new { Repository = "orbit-cli", Branch = "main", Modified = 0, Staged = 0, Ahead = 0, Behind = 4 },
new { Repository = "orbit-docs", Branch = "docs/setup", Modified = 2, Staged = 0, Ahead = 0, Behind = 0 },
new { Repository = "orbit-tests", Branch = "main", Modified = 0, Staged = 0, Ahead = 0, Behind = 0 }
};
// Layout: numeric columns keep local changes separate from branch divergence.
Table table = new Table { Expand = true };
foreach (string column in new[] { "Repository", "Branch", "Modified", "Staged", "Ahead", "Behind" }) table.AddColumn(column);
foreach (var repo in repositories) {
table.AddRow(repo.Repository, repo.Branch, TableCell.FromValue(repo.Modified), TableCell.FromValue(repo.Staged),
TableCell.FromValue(repo.Ahead), TableCell.FromValue(repo.Behind));
}
StatusList next = new StatusList()
.Add("orbit-api", StatusKind.Info, "Review the staged diff before committing")
.Add("orbit-cli", StatusKind.Warn, "Working tree clean; inspect four incoming commits")
.Add("orbit-docs", StatusKind.Info, "Two local edits need review")
.Add("orbit-tests", StatusKind.Pass, "Clean and up to date");
Rows report = new Rows(new Rule("[bold]Repository workspace[/] [muted]· ./work[/]"), table,
new Panel(next, "Suggested next steps")) { Gap = 1 };
// Behaviour: print once. Keep cached summaries fresh in a separate local collection step.
Terminal.Write(report);
Three steps in PowerShell, four in C#. Every command copies with one click.
Once. Windows PowerShell 5.1 or PowerShell 7 on Windows, macOS or Linux.
Install-Module ConsoleMonster -Scope CurrentUserDownload it, or copy it from above into repository-status.ps1.
From the folder you saved it in.
./repository-status.ps1A plain console app; .NET 8 or later.
dotnet new console -n Repositorystatus; cd RepositorystatusThe only package the program needs.
dotnet add package ConsoleMonsterDownload it, or copy the program from above.
dotnet runOr skip the copying. Every demo ships with the module and the project template.
Show-ConsoleDemo repository-statusGet-ConsoleDemo repository-status -Path ./repository-status.ps1dotnet new install ConsoleMonster.Templatesdotnet new consolemonster --demo repository-status -n RepositorystatusStart with these, then read the rest of the file.
Replace the cached summaries with local repository observations.
Add the branch and working-tree fields your team uses for review.
Keep suggested next steps separate from commands that modify a repository.
Turn the same task objects from plain text into a readable table with status colour and aligned numbers.
Show-ConsoleDemo everyday-formattingdotnet new consolemonster --demo everyday-formattingFollow 332 checks across twelve targets, six workers, throughput, duration buckets and actionable findings.
Show-ConsoleDemo assessmentdotnet new consolemonster --demo assessmentPlan a fleet check, review the command and follow every category through findings and results.
Show-ConsoleDemo fleetdotnet new consolemonster --demo fleet