The prompt is part of the ConsoleMonster module, so it uses the same themes, glyph tiers and colour handling as everything else it draws. Save it once from PowerShell with Set-ConsolePrompt -Save and cmon draws it in your other shells.
A two-line Powerline prompt in a small repository: the branch and its change count, a hint while dotnet is typed, a slow command's duration and a failed command's exit code. After Enter, each earlier prompt keeps only its status.
> git status --short M README.md > dotnet --version 10.0.404 > Start-Sleep -Seconds 3 > git switch release fatal: invalid reference: release ~\orion feature/prompt ~1 FAIL 128 >
# A two-line Powerline prompt: the folder and Git on the left, the last command's result and duration on the right.
# After Enter, the prompt left in scrollback keeps only its status. Typing a tool's name shows that tool's segment.
$prompt = @{
Preset = 'Powerline'
Left = 'path', 'git'
Right = 'status', 'duration'
Transient = 'status'
Hints = $true
Segments = @{
git = @{ BudgetMilliseconds = 1000 }
dotnet = @{ BudgetMilliseconds = 1000 }
}
}
Set-ConsolePrompt @prompt
Enable-ConsoleFormatting -Include PromptFull program
Import-Module ConsoleMonster
# A two-line Powerline prompt: the folder and Git on the left, the last command's result and duration on the right.
# After Enter, the prompt left in scrollback keeps only its status. Typing a tool's name shows that tool's segment.
$prompt = @{
Preset = 'Powerline'
Left = 'path', 'git'
Right = 'status', 'duration'
Transient = 'status'
Hints = $true
Segments = @{
git = @{ BudgetMilliseconds = 1000 }
dotnet = @{ BudgetMilliseconds = 1000 }
}
}
Set-ConsolePrompt @prompt
Enable-ConsoleFormatting -Include PromptUse it in every session
Install-Module ConsoleMonster -Scope CurrentUser
# Put the script's lines in your profile (notepad $PROFILE), then open a new windowSee also: Prompt, Set-ConsolePrompt
Start in PowerShell
Install the module once:
Install-Module ConsoleMonster -Scope CurrentUser.Add these lines to your profile (
notepad $PROFILE):Import-Module ConsoleMonster Set-ConsolePrompt -Preset Powerline -Transient time -Hints Enable-ConsoleFormatting -Include PromptOpen a new PowerShell window.
Disable-ConsoleFormatting -Feature Promptputs your previous prompt back.
Eight presets
Show-ConsolePrompt -Preset * draws every preset with sample values, so you can compare them before you choose. Plain, Powerline and Diamond are the three styles. Minimal, Focus, Timeline, Developer and Cloud arrange the segments for a purpose: Developer adds toolchain versions in project folders, and Cloud leads with the active Kubernetes and Azure contexts.
Plain admin ~/projects/consolemonster FAIL 7 > Powerline admin sam@devbox ~/projects/consolemonster 8de3f605 !1 rebase 2 jobs FAIL 7 3.2s > Diamond admin sam@devbox ~/projects/consolemonster 8de3f605 !1 rebase 2 jobs FAIL 7 > Minimal consolemonster 8de3f605 !1 rebase ❯ Focus admin sam@devbox ~/projects/consolemonster 8de3f605 !1 rebase 2 jobs FAIL 7 3.2s ❯ Timeline 2:25 PM consolemonster 8de3f605 !1 rebase FAIL 7 3.2s > Developer admin ~/projects/consolemonster 8de3f605 !1 rebase .NET 10.0.100 Node v22.16.0 > Cloud admin K8s staging/ops Azure Development ~/projects/consolemonster FAIL 7 >
# Every built-in preset, drawn with sample values.
Show-ConsolePrompt -Preset * -Width 100Full program
Import-Module ConsoleMonster
# Every built-in preset, drawn with sample values.
Show-ConsolePrompt -Preset * -Width 100Fonts without Powerline symbols get the same layout from the Basic and ASCII glyph tiers, so the prompt doesn't depend on a patched font.
Your colours
Presets take their colours from the active theme, so Set-ConsoleTheme recolours the prompt along with tables and errors. A segment can also have its own background and foreground.
Dark admin ~/projects/consolemonster 8de3f605 !1 rebase .NET 10.0.100 Node v22.16.0 > Catppuccin Mocha admin ~/projects/consolemonster 8de3f605 !1 rebase .NET 10.0.100 Node v22.16.0 > Dracula admin ~/projects/consolemonster 8de3f605 !1 rebase .NET 10.0.100 Node v22.16.0 > Gruvbox Dark admin ~/projects/consolemonster 8de3f605 !1 rebase .NET 10.0.100 Node v22.16.0 > Nord admin ~/projects/consolemonster 8de3f605 !1 rebase .NET 10.0.100 Node v22.16.0 > Tokyo Night Dark admin ~/projects/consolemonster 8de3f605 !1 rebase .NET 10.0.100 Node v22.16.0 >
# A preset takes its colours from the active theme, so one prompt follows every scheme.
$schemes = 'Dark', 'Catppuccin Mocha', 'Dracula', 'Gruvbox Dark', 'Nord', 'Tokyo Night Dark'
foreach ($scheme in $schemes) {
Set-ConsoleTheme -Theme $scheme
Write-Host $scheme
Show-ConsolePrompt -Preset Developer -Width 100
}Full program
Import-Module ConsoleMonster
# A preset takes its colours from the active theme, so one prompt follows every scheme.
$schemes = 'Dark', 'Catppuccin Mocha', 'Dracula', 'Gruvbox Dark', 'Nord', 'Tokyo Night Dark'
foreach ($scheme in $schemes) {
Set-ConsoleTheme -Theme $scheme
Write-Host $scheme
Show-ConsolePrompt -Preset Developer -Width 100
}What it shows
Path, Git, the last command's status and duration, the time, an elevated shell and SSH sessions are built in. Optional segments read .NET, Node, Python, Go and Rust versions from project files, the Kubernetes context, the Azure subscription, the AWS profile, the Google Cloud project and the battery.
~/projects/consolemonster 8de3f605 !1 rebase >
# A compact Powerline prompt with optional toolchain, Kubernetes and battery segments, for this session only.
$prompt = @{
Style = 'Powerline'
Layout = 'Compact'
Left = 'path', 'git', 'dotnet'
Right = 'status', 'kubectl', 'battery'
}
Set-ConsolePrompt @prompt
Show-ConsolePrompt -Width 100Full program
Import-Module ConsoleMonster
# A compact Powerline prompt with optional toolchain, Kubernetes and battery segments, for this session only.
$prompt = @{
Style = 'Powerline'
Layout = 'Compact'
Left = 'path', 'git', 'dotnet'
Right = 'status', 'kubectl', 'battery'
}
Set-ConsolePrompt @prompt
Show-ConsolePrompt -Width 100Slow segments don't hold up typing. Git and the toolchain checks run in the background with a time budget and a cache; the prompt shows the cached value straight away and repaints once if it changed. Get-ConsolePrompt -Segment lists each segment's last value, how long it took and how old its cache is.
Every shell
cmon draws the same prompt in bash, zsh, fish, nushell and cmd through Clink. It reads the prompt you saved with Set-ConsolePrompt -Save, or a prompt theme file given with --config. Command hints need PowerShell's editor, so other shells don't show them, and transient prompts work only in nushell and Clink.
| Shell | Add to | Line |
|---|---|---|
| bash | ~/.bashrc | eval "$(cmon init bash)" |
| zsh | ~/.zshrc | eval "$(cmon init zsh)" |
| fish | ~/.config/fish/config.fish | cmon init fish | source |
| nushell | run once | mkdir ($nu.data-dir | path join "vendor/autoload"); cmon init nu | save -f ($nu.data-dir | path join "vendor/autoload/cmon.nu") |
| cmd | run once | cmon init cmd > "%LOCALAPPDATA%\clink\cmon.lua" |
cmon is a Native AOT executable built from ConsoleMonster.Cmon in the repository; release downloads are not published yet. Other shells covers durations, right prompts and time budgets in each shell.
Share a prompt
A prompt theme file is a JSON document with a whole prompt in it, ready to keep with your dotfiles or hand to a team. Export-ConsolePrompt writes one, Show-ConsolePrompt -Path previews it and Set-ConsolePrompt -Path uses it.
Export-ConsolePrompt -Path ./team.prompt.json -Description 'Team prompt'
Set-ConsolePrompt -Path ./team.prompt.json -Save
Coming from oh-my-posh
Import-ConsolePrompt reads an oh-my-posh JSON theme and writes it as a prompt theme file. Segments with an equivalent keep their side, order, colours and options, and Notes lists everything left out or approximated.
$result = Import-ConsolePrompt -Path ./mytheme.omp.json
$result.Notes
Show-ConsolePrompt -Path $result.Path
Next
- Shell prompt reference: every setting, segment option and theme file key.
- Themes: the colours the prompt's segments take.
- Everyday formatting: the other features
Enable-ConsoleFormattinginstalls.