Expand description
Shared output formatting utilities (color, verbosity, bar charts, etc.). Shared output formatting utilities for CLI reports.
All colored output flows through this module so that NO_COLOR support
and verbosity filtering are centralised in one place.
§Color Policy
The NO_COLOR environment variable disables all
color output when set (to any value). Check once at startup via
color_enabled() and pass the result through to the formatting helpers.
§Verbosity Levels
Three levels control how much output the user sees:
| Level | Errors | Warnings | Summary | Findings | Verbose details |
|---|---|---|---|---|---|
Quiet | yes | no | final | no | no |
Default | yes | yes | yes | key | no |
Verbose | yes | yes | yes | all | yes |
Enums§
- Confidence
Tier - Confidence tier for display purposes.
- Verbosity
- CLI output verbosity level.
Functions§
- color_
enabled - Returns
trueif colored output is enabled. - format_
bar_ chart - Format a horizontal bar chart entry.
- format_
bordered_ box - Format text inside a bordered box using box-drawing characters.
- format_
copy_ block - Format a “copy this” block — content framed by horizontal rules but with
no vertical border characters, so the user can select and paste the content
directly without stripping
│symbols. - format_
error_ hint - Format an error message with optional hint lines.
- format_
human_ size - Format a byte count as a human-readable size.
- format_
info - Format an info message:
info: {message}. - format_
number - Format a number with thousands separators.
- format_
section_ header - Format a section header using box-drawing characters.
- format_
tier_ bullet - Format a confidence tier bullet.
- format_
warn - Format a warning message:
warn: {message}. - styled_
tier_ bullet - Return the colored bullet string for a confidence tier.
- tier_
bullet_ char - Return the bullet character for a confidence tier.