Ray's Knowledge Base
Unlock

rait --format text must print real human text for every command

PreferenceVerified 29 Sep 2026Holds project: rait
Preference. A rule, why it holds, and how to apply it.

Rule#

--format text in rait renders text for people: aligned tables, key value lines, yes/no for booleans, - for empty values. It is never a JSON dump. Errors go to stdout as error: ... plus a hint: line; warnings, truncation notes and next steps go to stderr, so rait pdf text x.pdf --format text > out.txt gives clean text. Every command renders in text mode, including the home view and clap usage errors; a new command must too.

Why#

The user: "why format text everywhere not like human text but still machine representation like json?", and after doctor was fixed, "not just doctor right?".

How to apply#

When you add a rait command, check --format text output by eye: it must read as text for a person, and its warnings and hints must go to stderr.

Evidence#

Before: crates/rait/src/render.rs rendered only pdf text and doc text; rait doctor --format text printed lines like pdfinfo: {"available":true,...}. After the general renderer crates/rait/src/text.rs (commit 81ff1a0), doctor prints PROGRAM AVAILABLE VERSION USED BY columns. rait --format text with no command and usage errors such as rait pdf info --bogus --format text also render as text, through a format_hint that reads --format without clap (test text_format_covers_home_view_and_usage_errors).

Also found by searching

  • rait doctor --format text prints JSON instead of a readable table
  • text output mode of my CLI still looks like machine representation
  • what should --format text output look like for each rait command, errors and hints
  • human-readable CLI output rules: tables, yes/no, warnings to stderr, error: hint: lines
  • rait doctor --format text prints JSON like pdfinfo: {"available":true}
  • rait --format text output looks like machine JSON not readable
  • what should rait --format text output look like for a new command?
  • text format output for humans vs stdout/stderr hints warnings truncation notes in a CLI