use clap::{Parser, Subcommand, ValueEnum};
use std::path::PathBuf;
pub use vct_core::models::resolve_time_range_with_default;
#[derive(ValueEnum, Debug, Clone, Copy)]
pub enum QuotaProvider {
Claude,
Codex,
Copilot,
Cursor,
Grok,
}
#[derive(Parser, Debug)]
#[command(name = "vibe_coding_tracker")]
#[command(author, version = vct_core::VERSION, about, long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Analysis {
#[arg(
value_name = "FILE",
conflicts_with_all = ["daily", "weekly", "monthly", "all"]
)]
file: Option<PathBuf>,
#[arg(long, group = "analysis_format")]
json: bool,
#[arg(long, group = "analysis_format")]
text: bool,
#[arg(long, group = "analysis_format")]
table: bool,
#[arg(long, group = "period")]
daily: bool,
#[arg(long, group = "period")]
weekly: bool,
#[arg(long, group = "period")]
monthly: bool,
#[arg(short, long, group = "period")]
all: bool,
},
Usage {
#[arg(long, group = "usage_format")]
json: bool,
#[arg(long, group = "usage_format")]
text: bool,
#[arg(long, group = "usage_format")]
table: bool,
#[arg(long)]
merge_providers: bool,
#[arg(long, group = "period")]
daily: bool,
#[arg(long, group = "period")]
weekly: bool,
#[arg(long, group = "period")]
monthly: bool,
#[arg(short, long, group = "period")]
all: bool,
},
Version {
#[arg(long)]
json: bool,
#[arg(long)]
text: bool,
},
Update {
#[arg(long)]
check: bool,
#[arg(long, short)]
force: bool,
},
#[command(alias = "fetch")]
Quota {
provider: QuotaProvider,
#[arg(long, group = "quota_format")]
json: bool,
#[arg(long, group = "quota_format")]
text: bool,
#[arg(long, group = "quota_format")]
table: bool,
},
Config {
#[command(subcommand)]
action: Option<ConfigAction>,
},
}
#[derive(Subcommand, Debug, Clone, Copy)]
pub enum ConfigAction {
Path,
Show,
Edit,
Schema,
Migrate,
}