Skip to main content

pigeon/
cli.rs

1use std::path::PathBuf;
2
3use clap::{Parser, Subcommand};
4
5use crate::commands::job::cli::JobArgs;
6use crate::commands::keyring::cli::KeyringArgs;
7
8/// Pigeon: authenticate, sink, and transform personal data from external services.
9#[derive(Parser, Debug)]
10#[command(name = "pigeon", version, about, long_about = None)]
11pub struct Cli {
12    #[command(subcommand)]
13    pub command: Commands,
14
15    /// Tracing filter directive for the durable JSONL log (e.g. "info" or
16    /// "pigeon=debug"). Defaults to $RUST_LOG, or "warn,pigeon=info" if that
17    /// isn't set either (ADR-0073).
18    #[arg(long, global = true)]
19    pub log_level: Option<String>,
20
21    /// Overrides where the durable JSONL log is written. Defaults to
22    /// $PIGEON_LOG_DIR/pigeon.jsonl, or the OS-conventional local-data
23    /// directory for `pigeon` if that isn't set either (ADR-0073).
24    #[arg(long, global = true)]
25    pub log_file: Option<PathBuf>,
26
27    /// Port for the local Prometheus metrics endpoint an on-host
28    /// observability agent (e.g. Grafana Alloy) can scrape (ADR-0092).
29    /// Defaults to $PIGEON_METRICS_PORT, or 9091 if that isn't set either.
30    #[arg(long, global = true)]
31    pub metrics_port: Option<u16>,
32
33    /// Disables the local Prometheus metrics endpoint entirely (ADR-0092).
34    #[arg(long, global = true)]
35    pub no_metrics: bool,
36}
37
38#[derive(Subcommand, Debug)]
39pub enum Commands {
40    /// Manage email identities and bucket-configs
41    Keyring(KeyringArgs),
42    /// Run job-orchestrated pipelines (e.g. email-sync)
43    Job(JobArgs),
44}