Skip to main content

Module cli_spec

Module cli_spec 

Source
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 CliSpec for the current Ralph CLI.
emit_cli_spec_json_pretty
Emit deterministic pretty JSON for the current Ralph CLI.