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    /// Overrides the keyring file's location. Defaults to
38    /// $PIGEON_CONFIG_DIR/keyring.toml, or the OS-conventional config
39    /// directory for `pigeon` if that isn't set either (ADR-0145).
40    #[arg(long, global = true)]
41    pub keyring_path: Option<PathBuf>,
42}
43
44#[derive(Subcommand, Debug)]
45pub enum Commands {
46    /// Manage email identities and bucket-configs
47    Keyring(KeyringArgs),
48    /// Run job-orchestrated pipelines (e.g. email-sync)
49    Job(JobArgs),
50}