pub fn run(
cli: &Command,
mode: OutputMode,
quiet_was_explicit: bool,
) -> Result<()>Expand description
Run the doiget capabilities subcommand.
capabilities is an artifact command per ADR-0017 Amendment 1:
its stdout output IS the deliverable (the inventory JSON an LLM
reads on cold-boot). It honors only explicit Quiet —
--quiet / -q / --mode quiet / DOIGET_MODE=quiet — and emits
the inventory on every other path. The quiet_was_explicit
discriminator is what distinguishes the two cases:
| mode | quiet_was_explicit | behaviour |
|---|---|---|
non-Quiet | - | emit |
Quiet (explicit) | true | suppress |
Quiet (non-TTY) | false | emit (#219) |
The non-TTY case is the one #219 / #220 report: an LLM tool
executor captures stdout, so stdout_is_tty() is false, the
resolver falls through to Quiet, but the caller wants the JSON
inventory exactly because it’s about to be machine-parsed. The
table’s bottom row is the fix.
The caller passes the live clap::Command so the clap walk
operates on the binary’s actual Cli tree (which the lib half of
this crate can’t reach directly — the Cli struct lives in
main.rs).