Skip to main content

Module style

Module style 

Source
Expand description

Human-facing console output: colored status lines and interactive confirmation.

§Why this is not gum

The shell-installer house style reaches for gum and falls back to raw ANSI when it is absent. A CLI cannot borrow that directly: shelling out to a formatter would make a runtime dependency out of pretty output, and this project ships one binary with no runtime dependencies at all. What transfers is the shape of the output stack — info / ok / warn, one visual grammar, and graceful degradation — so it is reimplemented here in a dozen lines of ANSI instead.

§Degradation is the contract

Color is emitted only when stdout is a terminal and NO_COLOR is unset. Everything here is therefore inert under a pipe, a file, a test harness capturing to a Vec<u8>, and robot mode — which matters more than the color does: NDJSON consumers and golden-output tests must never have to strip escape sequences. Prompts follow the same rule and refuse to block when there is no human attached.

Structs§

SayPresenter
Renders the say lifecycle as something a person wants to read.

Functions§

confirm
Asks a yes/no question, defaulting to no.
decorate
Whether human-facing decoration should be emitted at all.
detail
Dims secondary detail so it reads as subordinate to the line above it.
emphasis
Emphasizes a path or value inside a sentence.
info
A step in progress, or a neutral fact worth showing.
is_interactive
Whether a human is reading stdout, as opposed to a pipe, a file, an agent, or CI.
ok
A completed step.
warn
Something the user should notice but which is not a failure.