Skip to content

[cli] clap CLI with --config flag and listen subcommand #6

@obchain

Description

@obchain

Context

The first runnable binary. charon loads .env (via dotenvy), initializes structured logging, parses CLI args via clap, and loads + validates the config. This is the shell every later subcommand plugs into.

Scope

  • charon-cli/src/main.rs with #[tokio::main]
  • clap derive-based CLI: --config / -c flag + listen subcommand
  • dotenvy::dotenv() loads .env silently if present
  • tracing_subscriber with EnvFilter (defaults to INFO, overridable via RUST_LOG)
  • Loads config via Config::load() and logs a one-line summary on success

Acceptance criteria

  • cargo run -- --config config/default.toml listen works
  • cargo run -- --help prints a usage summary
  • cargo run -- --version prints the version from Cargo.toml
  • Log output is structured and respects RUST_LOG
  • Errors bubble up with file-path context when config is missing or malformed

References

  • Delivered in commit 9a5b67a
  • PRD section 3c (CLI bootstrap)

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)priority:p1-coreCore MVP scopestatus:readyScoped and ready to pick uptype:featureNew capability or deliverable

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions