Skip to main content

Module cli

Module cli 

Source
Expand description

The clap command tree and the top-level dispatcher with the exit-code mapping.

run is the single entry point shared by the binary and the integration tests: it parses argv, routes to a command handler, and collapses the handler’s Result<(), CliError> into the process exit code. Clap’s own parse failures (bad flags, unknown subcommands, missing required args) map to 4; --help / --version map to 0.

§Global flags

--color <auto|always|never> / --no-color set the color policy (honoured together with NO_COLOR / CLICOLOR_FORCE / is_terminal()), --quiet suppresses non-essential stderr chatter, and a global --json puts the active command into machine-output mode (its own --json works too). When the active command is in JSON mode and fails, the dispatcher emits a structured error object on stderr instead of the plain cardanowall: <message> line.

§Environment

Every secret / config flag has a consistent env fallback used on ALL commands:

  • CARDANOWALL_BASE_URL--base-url
  • CARDANOWALL_API_KEY--api-key
  • CARDANOWALL_SEED--seed (identity, sign, submit, inbox)
  • CARDANOWALL_RECIPIENT_KEY--secret-key (verify, inbox)
  • CARDANOWALL_CARDANO_GATEWAY / CARDANOWALL_ARWEAVE_GATEWAY / CARDANOWALL_IPFS_GATEWAY / CARDANOWALL_BLOCKFROST_PROJECT_ID / CARDANOWALL_CONFIRMATION_DEPTH_THRESHOLD / CARDANOWALL_DENY_HOST
  • CARDANOWALL_CONFIG_PATH overrides ~/.cardanowall/config.toml.

Structs§

Cli
The cardanowall CLI: a standalone Label 309 Proof-of-Existence toolkit.
GlobalArgs
Cross-command flags marked global = true so they may appear before OR after the subcommand, e.g. cardanowall --no-color verify … or cardanowall verify … --quiet.
GlobalContext
Cross-command runtime context resolved once from the global flags: the color choice and quiet mode, plus the JSON mode the dispatcher computed.

Enums§

ColorMode
The --color value surface (a clap value-enum mirror of ColorChoice).
Command
The top-level subcommand set.

Functions§

run
Parse args, dispatch, and return the process exit code (04).