Skip to main content

Crate degenbot_cli

Crate degenbot_cli 

Source
Expand description

degenbot-cli - the degenbot console binary (ADR-051 D2).

One argv facade, one command model. This crate owns exactly the things degenbot_cli_core cannot own by charter:

  • argv declaration (argv): the clap v4 derive tree for the whole command vocabulary, and the argv -> Command mapping. See argv’s module docs for where clap’s shape differs from the retired Python click tree.
  • rendering (render): typed CommandReport lines to stdout, typed CliError to stderr with its ExitCode.
  • interaction (prompt): the stdin/stdout Prompter the arms ask; the prompt policy stays declared data in cli-core (D4).
  • sinks (sinks): the tracing registry + console fmt layer, booted in the same order as the Python driver (typed config first, then the subscriber), and progress (progress): the indicatif bar, which exists only here (D9).
  • SIGINT ownership (signal, D7): first Ctrl+C feeds cli-core’s CancelHandle; a second aborts.

cli-core stays clap-free and indicatif-free (asserted by just check-cli-core-purity); this crate stays free of every domain-engine dependency (asserted by just check-cli-shell-purity).

Re-exports§

pub use argv::Cli;
pub use argv::Commands;

Modules§

argv
The clap v4 argv tree and the argv -> Command mapping (ADR-051 D2).
progress
The indicatif progress bar (ADR-051 D9).
prompt
The stdin/stdout Prompter (ADR-051 D4/D2).
render
stdout/stderr rendering of typed console results (ADR-051 D2/Q1).
signal
SIGINT ownership (ADR-051 D7).
sinks
The telemetry sinks + boot order (ADR-043, ADR-051 D2/D9).

Constants§

VERSION_LINE
The banner --version prints: the workspace version (ADR-009 lockstep) plus the shared build receipt, embedded by build.rs.

Functions§

run
The binary entry: collect the process argv (minus the program name) and delegate to the console composition root.
run_args
Parse args (argv WITHOUT the program name), boot the sinks, resolve the argv into a Command, run it and render the result. This is the ONE console composition root: the degenbot binary and the Python cli_main passthrough both land here, so their sequences cannot drift apart.