Skip to content

The stand in your prompt

Which stand is this terminal’s app talking to? Is the gateway up? Is the dev server still running? turnout status --short answers all three in one line, made for a prompt:

prod · gw ok · 2 dev

In an app’s directory the stand is that app’s; elsewhere it is every stand an app is bound to. When the gateway has noticed something, the stand says it: prod 502, prod down, prod login. The rest of the format is on the status page.

The command reads local files only - never the network, never an update check - and prints nothing at all when there is nothing to say, so the segment simply disappears.

In ~/.config/starship.toml:

[custom.turnout]
command = "turnout status --short"
when = true
format = "([$output]($style) )"
style = "bold purple"

The parentheses make the group conditional: with nothing printed, not even the space after it is left. On Windows add shell = ["cmd", "/C"], so starship does not start a PowerShell for every prompt just to run one command.

In ~/.tmux.conf:

Terminal window
set -g status-right '#(turnout status --short) '
set -g status-interval 5

In your profile ($PROFILE), around your existing prompt:

Terminal window
$TurnoutPrompt = $function:prompt
function prompt {
$line = turnout status --short
if ($line) { Write-Host "[$line] " -NoNewline -ForegroundColor DarkCyan }
& $TurnoutPrompt
}
~/.bashrc
PS1='$(s=$(turnout status --short); [ -n "$s" ] && printf "[%s] " "$s")'"$PS1"
~/.zshrc
setopt PROMPT_SUBST
PROMPT='$(s=$(turnout status --short); [[ -n $s ]] && print -n "[$s] ")'"$PROMPT"

A bar that draws its own pieces - waybar, polybar, a Rainmeter skin - reads turnout status --json instead and picks the fields it needs: .apps[].server, .gateway.state, .gateway.signals, .jobs. See JSON output.