Expand description
CLI spec command implementation (wired into the hidden/internal ralph __cli-spec command).
Responsibilities:
- Provide a small “command layer” entrypoint that produces the deterministic CLI spec JSON for the current build of Ralph.
- Keep the execution/IO boundary separate from clap introspection and contract modeling.
Not handled here:
- Registering a user-facing
ralph cli-spec(or similar) top-level command in clap. - Reading/writing files or printing to stdout/stderr.
Invariants/assumptions:
- Uses
Cli::command()as the canonical source of the clap command tree. - Output must be deterministic across invocations within the same build.
Functions§
- build_
cli_ spec - Build the structured
CliSpecfor the current Ralph CLI. - emit_
cli_ spec_ json_ pretty - Emit deterministic pretty JSON for the current Ralph CLI.