Skip to main content

Module argv

Module argv 

Source
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 as exchange activate|deactivate --chain <slug|id> --name <dex>, resolving the pair against RETIRED_EXCHANGES.
  • aave activate|deactivate. Python spelled the market as a verb (aave activate ethereum_aave_v3); cli-core takes chain_id and resolves the deployment from AAVE_DEPLOYMENTS, so the tree is aave 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 --socket required. The flag is therefore optional here - cli-core owns the cascade.
  • database reset. Python marks it hidden=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 --node occurrence: 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.
VerifyFlags
The --verify-chunk / --verify-all gate pairs shared by both updaters.

Enums§

AavePositionSub
The aave position command group.
AaveSub
The aave command group.
Commands
The command groups.
ConfigSub
The config command group: the read-only view of the operator file.
DatabaseSub
The database command group.
DirectionArg
The --direction choice on path add.
ExchangeSub
The exchange command group.
FacetArg
The strategy facet selector.
FamilyArg
The pool family selector.
FleetPostureSub
The fleet posture command group.
FleetSub
The fleet command group.
PathSub
The path command group.
PoolSub
The pool command group.
StrategySub
The strategy command group (ADR-055 facets): the strategy activation and parameter surface over the typed config.

Functions§

context
The CliContext the 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 Command over 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.