Expand description
Central semantic output module (OSS_SPEC.md §19.4).
Non-contract CLI output (progress, warnings, headers, status lines)
should go through this module rather than raw println!/eprintln!
so every message is:
- Echoed to stderr for humans, leaving stdout reserved for
machine-readable output (
--json,--help-agent, etc.) — tools piping stdout tojqnever see incidental status text. - Mirrored to the always-on tracing file log so we have a trail of what the CLI told the user.
- Coloured consistently on a TTY (via a tiny ANSI helper) and plain when stderr is redirected.
Callers that emit machine-readable output (e.g. JSON replies to
--json flags) or dedicated discovery surfaces
(--help-agent, --debug-agent, zad commands, zad docs,
zad man) MUST continue to use raw println! so the contract holds
byte-for-byte.
Functions§
- error
- Renders
msgas an error. Does not exit — the caller propagates aResultupward. - header
- Renders
msgas a prominent header/section separator. Unlike the others, headers include a blank line before the banner. - info
- Renders
msgas an informational note (same weight asstatusbut typed so future theming can distinguish them). - status
- Renders
msgas a neutral status line — the default for user-facing progress (“Loaded 4 channels”). - warn
- Renders
msgas a warning that doesn’t abort the command.