Expand description
doiget capabilities — single-shot inventory JSON for LLM cold-boot
(#214).
Emits a single JSON value describing the full surface of this
doiget binary: subcommands (walked from the live clap::Command
tree so the inventory cannot drift from the parser), positional args
and named flags per subcommand, global flags, the four
super::output::OutputMode values, hand-maintained env-var + example tables, the
doiget_* MCP tool list, compile-time features, and a docs map
pointing at the canonical spec files.
Design rationale: the existing --help output lists subcommand
names but the rest of doiget’s surface (env vars, MCP tools, JSON
schemas, ADR refs) is scattered across docs/. An LLM cold-booted
into doiget — no repo access, no follow-up doc reads — cannot
discover those via --help alone. This subcommand closes that gap
with one round-trip.
§Output mode
doiget capabilities is a product-output command per the
ADR-0017 convention (--mode is informational; the JSON inventory
is the artefact). --mode quiet is the one mode that suppresses
stdout (#203 / CONFIG.md §5); every other mode emits the same JSON.
§Wire-format stability (whole module)
Every pub struct / enum below carries #[non_exhaustive]. Adding
a field is non-breaking; renaming or removing one is a
compile-time break for downstream Rust consumers and a
[BREAKING]-class change for JSON consumers (CHANGELOG must call
it out). The per-item #[non_exhaustive] attributes intentionally
carry no inline comment; this module-doc says it once.
Structs§
- ArgSpec
- Capabilities
- Top-level capability inventory. Serialised to stdout as one JSON
value. Field names are part of the public wire format: renaming
any field is a semver minor with a CHANGELOG
\[BREAKING\]callout (same discipline asEntryInfo/MigrationReportin #213). - Docs
- EnvVar
- Flag
Spec - McpTool
- Subcommand
Spec
Enums§
- ArgKind
- What kind of positional argument an
ArgSpecdescribes. - Flag
Kind - What kind of value (if any) a
FlagSpeccarries. - Json
Mode - How a subcommand interacts with
--mode json.
Functions§
- build_
capabilities - Build the
Capabilitiesinventory fromcli(the clap parser for this binary, supplied by the caller because theClistruct lives inmain.rsand is not exposed in the library crate). The caller iscommands::main::run_dispatchviaCli::command(). - run
- Run the
doiget capabilitiessubcommand. Honorssuper::output::OutputMode:Quietsuppresses stdout (#203); every other mode emits the same pretty-printed JSON inventory. The caller passes the liveclap::Commandso the clap walk operates on the binary’s actualClitree (which the lib half of this crate can’t reach directly — theClistruct lives inmain.rs).