use std::path::PathBuf;
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(
name = "evorule",
version,
about = "evorule: no intelligence, only best practices of execution",
long_about = "evorule CLI - load and execute user-written JSON rules.\n\
Zero network, zero telemetry, zero system dependencies, suited for compliance-sensitive local use.\n\
The fact log uses the evorule-reactor WAL format, interoperable with the evorule-governance audit chain."
)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Subcommand, Debug)]
pub enum Command {
Run {
rules_dir: PathBuf,
#[arg(long, conflicts_with = "payload_file")]
payload: Option<String>,
#[arg(long)]
payload_file: Option<PathBuf>,
#[arg(long, short = 'o')]
output: Option<PathBuf>,
#[arg(long, default_value_t = crate::executor::DEFAULT_MAX_STEPS)]
max_steps: usize,
},
Replay {
fact_log: PathBuf,
},
Diff {
a: PathBuf,
b: PathBuf,
},
Validate {
rules_dir: PathBuf,
},
VerifyChain {
fact_log: PathBuf,
},
ScanWalDir {
wal_dir: PathBuf,
#[arg(long)]
baseline: Option<PathBuf>,
#[arg(long)]
sentinel_log: Option<PathBuf>,
#[arg(long)]
json: Option<PathBuf>,
},
TruncatePartialLine {
wal_file: PathBuf,
#[arg(long)]
confirm: bool,
},
CompileEvopack {
rules_file: PathBuf,
#[arg(short = 'o')]
output: PathBuf,
},
AnchorKeygen {
#[arg(long)]
output: Option<PathBuf>,
},
AnchorPubkey {
seed: String,
},
VerifyAnchors {
audit: PathBuf,
#[arg(long)]
pubkey: Option<String>,
},
}