use clap::{Args, Parser, Subcommand};
use std::path::PathBuf;
use crate::snapshots::SnapshotScope;
#[derive(Parser)]
#[command(about, version, author, long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
#[command(alias = "l", alias = "ls")]
List,
#[command(alias = "a")]
Apply {
target: String,
#[arg(long, default_value = "common", help = "Scope of settings to include")]
scope: SnapshotScope,
#[arg(long, help = "Override model setting")]
model: Option<String>,
#[arg(long, help = "Path to settings file (default: .claude/settings.json)")]
settings_path: Option<PathBuf>,
#[arg(long, help = "Create backup of current settings before applying")]
backup: bool,
#[arg(long, help = "Skip confirmation prompt")]
yes: bool,
},
#[command(alias = "creds", alias = "cred")]
Credentials {
#[command(subcommand)]
command: CredentialCommands,
},
}
#[derive(Subcommand)]
pub enum CredentialCommands {
#[command(alias = "l", alias = "ls")]
List,
Clear {
#[arg(long, help = "Skip confirmation prompt")]
yes: bool,
},
}
#[derive(Args, Clone)]
pub struct SnapArgs {
pub name: String,
#[arg(
long,
default_value = "common",
help = "Scope of settings to include in snapshot"
)]
pub scope: SnapshotScope,
#[arg(long, help = "Path to settings file (default: .claude/settings.json)")]
pub settings_path: Option<PathBuf>,
#[arg(long, help = "Description for the snapshot")]
pub description: Option<String>,
#[arg(long, help = "Overwrite existing snapshot with same name")]
pub overwrite: bool,
}
#[derive(Args, Clone)]
pub struct ApplyArgs {
pub target: String,
#[arg(long, default_value = "common", help = "Scope of settings to include")]
pub scope: SnapshotScope,
#[arg(long, help = "Override model setting")]
pub model: Option<String>,
#[arg(long, help = "Path to settings file (default: .claude/settings.json)")]
pub settings_path: Option<PathBuf>,
#[arg(long, help = "Create backup of current settings before applying")]
pub backup: bool,
#[arg(long, help = "Skip confirmation prompt")]
pub yes: bool,
}