Complete setup wizard
Walk through component choices, dependent server loading, review, installation progress and a result.
- Showcase
- Live
- 112×44
- 166 lines
Show-ConsoleDemo setupdotnet new consolemonster --demo setupEdit a folder and component choice, then step through an installation preview.
Demos Wizards
Use it when you need a small editable wizard before connecting installation actions.
Install Toolbox Agent · Toolbox Agent ╭─ › Install folder ───────────────────────────────────────────────────────────────────╮ │ ./toolbox-agent │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Component ──────────────────────────────────────────────────────────────────────────╮ │ › type to filter │ │ Core │ │ Core + reports │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Back ───────────────────────────────────────────────────────────────────────────────╮ │ Back │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Next / preview ─────────────────────────────────────────────────────────────────────╮ │ Next / preview │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─ 3 / 3 · Review ─────────────────────────────────────────────────────────────────────╮ │ Folder: ./toolbox-agent │ │ Component: Core │ │ Ready to install. Review the folder and components. │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ tab next shift+tab back esc quit
The whole program in one file, with its sample data at the top. It drew the recording above; both languages draw the same cells.
# Build a three-step installer preview with editable fields and buttons.
[CmdletBinding()]
param(
[switch] $StaticSnapshot,
[ValidateRange(0, 2)] [int] $Step = 0,
[hashtable] $AppOptions = @{}
)
Import-Module ConsoleMonster
# All data is synthetic and inline; no services are contacted or changed.
$AppOptions.StaticSnapshot = $StaticSnapshot -or ([Console]::IsInputRedirected -and -not $AppOptions.InputSource)
# Data: fictional inputs kept in memory.
$installFolder = './toolbox-agent'
$components = @('Core', 'Core + reports')
$wizard = [pscustomobject] @{ Page = $Step }
# Layout: construct the widgets shown on screen.
Show-ConsoleApp {
New-ConsoleRows -Gap 1 {
'[bold]Install Toolbox Agent[/] [muted]· Toolbox Agent[/]'
New-ConsoleTextInput -Name Folder -Label 'Install folder' -Value $installFolder
New-ConsoleSelect -Name Component -Label Component -Choices $components -Value Core
New-ConsoleButton -Name Back -Label Back -OnClick { $wizard.Page = [Math]::Max(0, $wizard.Page - 1) }
New-ConsoleButton -Name Next -Label 'Next / preview' -OnClick { $wizard.Page = [Math]::Min(2, $wizard.Page + 1) }
# Live updates: rebuild this section when an input or button changes state.
New-ConsoleBinding {
param($State)
New-ConsolePanel -Title (@('1 / 3 · Location', '2 / 3 · Components', '3 / 3 · Review')[$wizard.Page]) {
switch ($wizard.Page) {
0 { 'Choose a writable folder for the agent.' }
1 { 'Core runs local jobs. Reports adds an HTML summary.' }
2 {
# Plain text widgets escape user-entered values automatically.
New-ConsoleText "Folder: $($State.Folder)"
New-ConsoleText "Component: $($State.Component)"
'[pass]Ready to install. Review the folder and components.[/]'
}
}
}
}
}
} @AppOptions
// Build a three-step installer preview with editable fields and buttons.
// All data is synthetic and inline; no services are contacted or changed.
using ConsoleMonster.Interactive;
using ConsoleMonster.Layout;
using ConsoleMonster.Widgets;
// Data: fictional inputs kept in memory.
string installFolder = "./toolbox-agent";
string[] components = { "Core", "Core + reports" };
// Run options: redirected input selects a deterministic snapshot.
bool snapshot = args.Contains("--snapshot") || (!args.Contains("--interactive") && Console.IsInputRedirected);
int stepAt = Array.IndexOf(args, "--step");
int step = stepAt < 0 ? 0 : int.Parse(args[stepAt + 1], System.Globalization.CultureInfo.InvariantCulture);
if (step < 0 || step > 2) throw new ArgumentOutOfRangeException(nameof(step));
// Layout: construct the widgets shown on screen.
int page = step;
TextInput folder = new TextInput("Folder", installFolder) { Label = "Install folder" };
Select component = new Select("Component", components.Select(name => new Choice(name))) {
Label = "Component", Value = "Core"
};
Button back = new Button("Back", "Back");
Button next = new Button("Next", "Next / preview");
back.Clicked += (_, _) => page = Math.Max(0, page - 1);
next.Clicked += (_, _) => page = Math.Min(2, page + 1);
Rows layout = new Rows(new TextBlock("[bold]Install Toolbox Agent[/] [muted]· Toolbox Agent[/]"),
folder, component, back, next, new AppBinding(state => {
string title = new[] { "1 / 3 · Location", "2 / 3 · Components", "3 / 3 · Review" }[page];
IWidget content = page == 0 ? new TextBlock("Choose a writable folder for the agent.")
: page == 1 ? new TextBlock("Core runs local jobs. Reports adds an HTML summary.")
: new Rows(new TextBlock("Folder: " + ConsoleMonster.Text.Markup.Escape(state.Get<string>("Folder", ""))),
new TextBlock("Component: " + ConsoleMonster.Text.Markup.Escape(state.Get<string>("Component", ""))),
new TextBlock("[pass]Ready to install. Review the folder and components.[/]"));
return new Panel(content, title);
})) { Gap = 1 };
// Live updates: ConsoleApp handles input and reevaluates AppBinding as state changes.
// Escape exits; snapshot mode prints the selected state without reading keys.
ConsoleApp.Run(layout, options: new ConsoleAppOptions { StaticSnapshot = snapshot });
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 setup-basic.ps1.
From the folder you saved it in.
./setup-basic.ps1A plain console app; .NET 8 or later.
dotnet new console -n Setupbasic; cd SetupbasicThe 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 setup-basicGet-ConsoleDemo setup-basic -Path ./setup-basic.ps1dotnet new install ConsoleMonster.Templatesdotnet new consolemonster --demo setup-basic -n SetupbasicStart with these, then read the rest of the file.
Replace the relative install folder with your application default.
Define your component choices and review text.
Connect a separate explicit install action after validation.
Walk through component choices, dependent server loading, review, installation progress and a result.
Show-ConsoleDemo setupdotnet new consolemonster --demo setupFollow 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