Skip to main content

Module ui

Module ui 

Source
Expand description

Terminal UI helpers — styled status lines, spinners, and progress bars; with COMINDLY_LOG_FORMAT=json, the same messages as one JSON event per line.

Everything writes to stderr so comindly serve’s stdout stays pure JSON-RPC; a server’s log lines go to stdout. Styling and animation degrade when stderr is not a TTY (pipes, CI).

Structs§

Terminal
Renders core’s events: styled lines and progress bars at a terminal, one JSON object per line with COMINDLY_LOG_FORMAT=json, plain progress lines every 30 s otherwise.

Functions§

err
Error line (✗).
field
Dim label: followed by a value.
header
Bold section header.
json_logs
One JSON object per line instead of styled text, for platform logs (COMINDLY_LOG_FORMAT=json).
note
Dim, indented detail line.
ok
Success line (✓).
progress
Determinate pos/len progress bar on stderr.
right_align
Right-align the given (0-based) columns — for numbers, which read best flush-right.
spinner
Indeterminate spinner on stderr with a steady tick.
step
In-progress step (→).
table
A preset unicode table that wraps to the terminal width. Add rows, then print it.
usage
LLM tokens and cost so far, attached to progress events.
warn
Warning line (!).