use clap::{Args, Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(
name = "agentdiff",
about = "Audit and trace AI contributions in git repositories",
version,
propagate_version = true
)]
pub struct Cli {
#[arg(short = 'C', long, global = true)]
pub repo: Option<std::path::PathBuf>,
#[command(subcommand)]
pub command: Command,
}
#[derive(Subcommand, Debug)]
pub enum Command {
Configure(ConfigureArgs),
Init(InitArgs),
List(ListArgs),
Blame(BlameArgs),
Report(ReportArgs),
Diff(DiffArgs),
Show(ShowArgs),
Config(ConfigArgs),
Keys(KeysArgs),
Verify(VerifyArgs),
Policy(PolicyArgs),
Status(StatusArgs),
Push(PushArgs),
Consolidate(ConsolidateArgs),
InstallCi(InstallCiArgs),
#[command(hide = true)]
SignEntry,
}
#[derive(Args, Debug)]
pub struct StatusArgs {
#[arg(long)]
pub remote: bool,
#[arg(long)]
pub no_fetch: bool,
}
#[derive(Args, Debug)]
pub struct ConfigureArgs {
#[arg(long)]
pub no_claude: bool,
#[arg(long)]
pub no_cursor: bool,
#[arg(long)]
pub no_codex: bool,
#[arg(long)]
pub no_antigravity: bool,
#[arg(long)]
pub no_windsurf: bool,
#[arg(long)]
pub no_opencode: bool,
#[arg(long)]
pub no_copilot: bool,
#[arg(long)]
pub no_mcp: bool,
}
#[derive(Args, Debug)]
pub struct InitArgs {
#[arg(long)]
pub no_git_hook: bool,
}
#[derive(Args, Debug)]
pub struct ListArgs {
#[arg(long)]
pub uncommitted: bool,
#[arg(long)]
pub agent: Option<String>,
#[arg(long)]
pub file: Option<String>,
#[arg(short = 'n', long)]
pub limit: Option<usize>,
#[arg(long)]
pub by_commit: bool,
#[arg(long)]
pub full_prompt: bool,
}
#[derive(Args, Debug)]
pub struct BlameArgs {
pub file: std::path::PathBuf,
#[arg(long)]
pub agent: Option<String>,
}
#[derive(Args, Debug)]
pub struct ReportArgs {
#[arg(long, default_value = "text")]
pub format: ReportFormat,
#[arg(long)]
pub out: Option<std::path::PathBuf>,
#[arg(long, value_name = "PR_NUMBER")]
pub post_pr_comment: Option<Option<u64>>,
#[arg(long)]
pub since: Option<String>,
#[arg(long)]
pub agent: Option<String>,
#[arg(long)]
pub model: Option<String>,
#[arg(long)]
pub by_file: bool,
#[arg(long)]
pub by_model: bool,
}
#[derive(Args, Debug)]
pub struct DiffArgs {
pub commit: Option<String>,
#[arg(long)]
pub ai_only: bool,
}
#[derive(Args, Debug)]
pub struct ShowArgs {
pub sha: String,
}
#[derive(Args, Debug)]
pub struct PushArgs {
#[arg(long)]
pub branch: Option<String>,
#[arg(long)]
pub quiet: bool,
}
#[derive(Args, Debug)]
pub struct ConsolidateArgs {
#[arg(long)]
pub branch: Option<String>,
#[arg(long)]
pub push: bool,
}
#[derive(Args, Debug)]
pub struct ConfigArgs {
#[command(subcommand)]
pub action: ConfigAction,
}
#[derive(Subcommand, Debug)]
pub enum ConfigAction {
Show,
Set { key: String, value: String },
Get { key: String },
}
#[derive(Debug, Clone, clap::ValueEnum)]
pub enum ReportFormat {
Text,
Markdown,
Annotations,
Jsonl,
}
#[derive(Args, Debug)]
pub struct KeysArgs {
#[command(subcommand)]
pub action: KeysAction,
}
#[derive(Subcommand, Debug)]
pub enum KeysAction {
Init,
Register,
Rotate,
}
#[derive(Args, Debug)]
pub struct VerifyArgs {
#[arg(long)]
pub since: Option<String>,
#[arg(long)]
pub strict: bool,
}
#[derive(Args, Debug)]
pub struct PolicyArgs {
#[command(subcommand)]
pub action: PolicyAction,
}
#[derive(Subcommand, Debug)]
pub enum PolicyAction {
Check(PolicyCheckArgs),
}
#[derive(Args, Debug)]
pub struct PolicyCheckArgs {
#[arg(long)]
pub since: Option<String>,
#[arg(long, default_value = "text")]
pub format: PolicyFormat,
}
#[derive(Debug, Clone, clap::ValueEnum)]
pub enum PolicyFormat {
Text,
GithubAnnotations,
}
#[derive(Args, Debug)]
pub struct InstallCiArgs {
#[arg(long)]
pub force: bool,
}