kivgraph --help, -h and help write to stdout and exit 0. So does a
bare kivgraph: an invocation with no command asks what the program does, and
it is answered with this same table. An unknown command writes a single
line to stderr and exits 2, rather than dumping the whole surface at
someone who mistyped one word.
The script is a fixed stub: it carries no command name, no flag and no
vocabulary, and forwards the words typed so far to kivgraph __complete. That
is what keeps it from going out of date when a flag is added, and it is what
lets completion answer the questions a static script cannot: --generation
completes the generations on disk, --target the clients this machine has, and
--tool the tools this installation has actually been called with. A flag that
takes a path defers to the shell’s own file completion.
ui needs the web bundle, which is only linked in when the binary is built
with the webassets tag. A build without it marks the command as unavailable
in the help and refuses to start rather than serving a “bundle not available”
page. The published release bundle carries the viewer.
A one-shot command reports in plain text when stderr is a terminal and as a
JSON record when it is not; serve and ui always log JSON, because a client
reads their stderr. Progress is INFO and only a failure is ERROR.