Expand description
The clap v4 argv tree and the argv -> Command mapping (ADR-051 D2).
This is the ONE place argv is spelled. The mapping below translates clap
matches into the constructor-parsed values of degenbot-cli-core and never
re-encodes semantics: every arm, flag, prompt and exit code lives there.
§Where clap’s shape differs from the retired click tree
exchange(ADR-051 D5, 34 click verbs -> one data-driven command). Python declared one verb per(chain, DEX)pair (base_aerodrome_v2,ethereum_uniswap_v3, …). cli-core models that asexchange activate|deactivate --chain <slug|id> --name <dex>, resolving the pair againstRETIRED_EXCHANGES.aave activate|deactivate. Python spelled the market as a verb (aave activate ethereum_aave_v3); cli-core takeschain_idand resolves the deployment fromAAVE_DEPLOYMENTS, so the tree isaave activate [--chain-id <id>]with Python’s Ethereum default (1) when no chain layer supplied a value.aave position show <ADDRESS>. The click shape is kept, except that its chain selector IS the global--chain-id(ADR-051 D8) rather than a second, position-local spelling of the same thing; cli-core’s arm takes the resolved session chain id.--socket. cli-core resolves the operator socket through the cascade--socket>DEGENBOT_OPERATOR_SOCKET>~/.config/degenbot/operator.sock(resolve_socket); click declared--socketrequired. The flag is therefore optional here - cli-core owns the cascade.database reset. Python marks ithidden=True. The command is present and visible here (cli-core carries the arm; hiding it would make the Rust tree the only place the arm is unreachable).- Flag help text is the Python help text, so the two surfaces read the
same. The per-flag click
envvar=fallbacks (DEGENBOT_CHUNK_SIZE, …) are NOT re-added: cli-core models these inputs as argv only, and the only env vocabulary the console owns is the driver-domain set of ADR-051 D8.
Structs§
- Cli
- The degenbot console.
- NodeArg
- One
--nodeoccurrence: the endpoint, plus the transport its own value classified as (ADR-062 D6). clap carries the classification so a value no transport can serve is a usage error at parse time, not a later refusal. - Verify
Flags - The
--verify-chunk/--verify-allgate pairs shared by both updaters.
Enums§
- Aave
Position Sub - The
aave positioncommand group. - AaveSub
- The
aavecommand group. - Commands
- The command groups.
- Config
Sub - The
configcommand group: the read-only view of the operator file. - Database
Sub - The
databasecommand group. - Direction
Arg - The
--directionchoice onpath add. - Exchange
Sub - The
exchangecommand group. - Facet
Arg - The strategy facet selector.
- Family
Arg - The pool family selector.
- Fleet
Posture Sub - The
fleet posturecommand group. - Fleet
Sub - The
fleetcommand group. - PathSub
- The
pathcommand group. - PoolSub
- The
poolcommand group. - Strategy
Sub - The
strategycommand group (ADR-055 facets): the strategy activation and parameter surface over the typed config.
Functions§
- context
- The
CliContextthe argv overrides describe (ADR-051 D8). - resolve
- Map argv into a
Command, reading the driver-domain env through the real process environment. - resolve_
with_ env - Map argv into a
Commandover an injectable env seam (tests never mutate the process environment). - write_
missing_ subcommand_ error - Print clap’s own usage block for the no-subcommand-but-args case.