// cli.rs — Command-line argument parsing // // All fields are Option so unset args don't override config file // values. The layering order is: // defaults < config file < CLI args // // Subcommands: // (none) Launch the TUI agent // read Print new output since last check and exit // write Send a message to the running agent use clap::{Parser, Subcommand}; use std::path::PathBuf; #[derive(Parser, Debug)] #[command(name = "poc-agent", about = "Substrate-independent AI agent")] pub struct CliArgs { /// Select active backend ("anthropic" or "openrouter") #[arg(long)] pub backend: Option, /// Model override #[arg(short, long)] pub model: Option, /// API key override #[arg(long)] pub api_key: Option, /// Base URL override #[arg(long)] pub api_base: Option, /// Enable debug logging #[arg(long)] pub debug: bool, /// Print effective config with provenance and exit #[arg(long)] pub show_config: bool, /// Override all prompt assembly with this file #[arg(long)] pub system_prompt_file: Option, /// Project memory directory #[arg(long)] pub memory_project: Option, /// Max consecutive DMN turns #[arg(long)] pub dmn_max_turns: Option, #[command(subcommand)] pub command: Option, } #[derive(Subcommand, Debug)] pub enum SubCmd { /// Print new output since last read and exit Read { /// Stream output continuously instead of exiting #[arg(short, long)] follow: bool, /// Block until a complete response is received, then exit #[arg(long)] block: bool, }, /// Send a message to the running agent Write { /// The message to send message: Vec, }, }