Skip to main content

Module capabilities

Module capabilities 

Source
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 as EntryInfo / MigrationReport in #213).
Docs
EnvVar
FlagSpec
McpTool
SubcommandSpec

Enums§

ArgKind
What kind of positional argument an ArgSpec describes.
FlagKind
What kind of value (if any) a FlagSpec carries.
JsonMode
How a subcommand interacts with --mode json.

Functions§

build_capabilities
Build the Capabilities inventory from cli (the clap parser for this binary, supplied by the caller because the Cli struct lives in main.rs and is not exposed in the library crate). The caller is commands::main::run_dispatch via Cli::command().
run
Run the doiget capabilities subcommand. Honors super::output::OutputMode: Quiet suppresses stdout (#203); every other mode emits the same pretty-printed JSON inventory. 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).