use clap::{Args, Subcommand};
#[derive(Args)]
pub struct StatusArgs {
#[arg(long, short)]
pub detailed: bool,
}
impl StatusArgs {
pub fn run(&self) -> anyhow::Result<()> {
println!("Showing current status...");
Ok(())
}
}
#[derive(Subcommand, Debug)]
pub enum PresetCommands {
Create {
name: String,
#[arg(long)]
description: Option<String>,
#[arg(long, value_parser = parse_kv)]
tag: Vec<String>,
#[arg(long, value_parser = parse_kv)]
agent: Vec<String>,
},
List {
#[arg(long)]
tag: Vec<String>,
#[arg(long, default_value = "table")]
format: String,
},
Show {
name: String,
},
Apply {
name: String,
#[arg(long)]
agent: Vec<String>,
#[arg(long)]
dry_run: bool,
#[arg(long)]
no_backup: bool,
},
Update {
name: String,
#[arg(long)]
description: Option<String>,
#[arg(long)]
tag: Vec<String>,
#[arg(long, value_parser = parse_kv)]
agent: Vec<String>,
},
Delete {
name: String,
#[arg(long)]
force: bool,
},
Validate {
name: String,
},
Import {
input: String,
#[arg(long, default_value = "merge")]
strategy: String,
#[arg(long)]
dry_run: bool,
},
Export {
output: String,
#[arg(long)]
preset: Vec<String>,
#[arg(long)]
include_models: bool,
#[arg(long)]
include_active: bool,
},
}
#[derive(Subcommand, Debug)]
pub enum BatchCommands {
Switch {
model: String,
#[arg(long)]
agent: Vec<String>,
#[arg(long, default_value = "0")]
parallel: usize,
#[arg(long)]
dry_run: bool,
},
Validate {
#[arg(long)]
agent: Vec<String>,
},
Status {
#[arg(long, default_value = "table")]
format: String,
},
}
fn parse_kv(s: &str) -> Result<String, String> {
let parts: Vec<&str> = s.split(':').collect();
if parts.len() == 2 {
Ok(s.to_string())
} else {
Err(format!("Invalid key:value format: {}", s))
}
}
#[derive(Subcommand, Debug)]
pub enum WizardCommands {
Init {
#[arg(long)]
resume: bool,
#[arg(long)]
reset: bool,
#[arg(long)]
non_interactive: bool,
},
Wizard {
#[arg(long)]
name: Option<String>,
},
}
#[derive(Subcommand, Debug)]
pub enum DoctorCommands {
Doctor {
#[arg(short, long)]
verbose: bool,
#[arg(short, long)]
json: bool,
#[arg(long)]
fix: bool,
},
Detect,
}
#[derive(Subcommand, Debug)]
pub enum CompletionCommands {
Install {
shell: String,
#[arg(long)]
path: Option<String>,
#[arg(long)]
no_modify_config: bool,
},
Uninstall {
shell: String,
#[arg(long)]
path: Option<String>,
},
Generate {
shell: String,
},
}
#[derive(Subcommand, Debug)]
pub enum SyncCommands {
Init {
#[arg(long)]
encrypt: bool,
#[arg(long)]
encryption_method: Option<String>,
#[arg(long)]
no_encrypt: bool,
},
Remote {
#[command(subcommand)]
command: RemoteSubCommands,
},
Push {
#[arg(long)]
remote: Option<String>,
#[arg(long)]
branch: Option<String>,
#[arg(long)]
no_encrypt: bool,
},
Pull {
#[arg(long)]
remote: Option<String>,
#[arg(long)]
branch: Option<String>,
#[arg(long)]
strategy: Option<String>,
},
Status,
}
#[derive(Subcommand, Debug)]
pub enum RemoteSubCommands {
Add {
url: String,
},
Remove {
name: String,
},
List,
SetUrl {
name: String,
url: String,
},
}
impl WizardCommands {
pub fn run(&self) -> anyhow::Result<()> {
Ok(())
}
}
impl DoctorCommands {
pub fn run(&self) -> anyhow::Result<()> {
Ok(())
}
}
impl CompletionCommands {
pub fn run(&self) -> anyhow::Result<()> {
Ok(())
}
}
impl SyncCommands {
pub fn run(&self) -> anyhow::Result<()> {
Ok(())
}
}
impl RemoteSubCommands {
pub fn run(&self) -> anyhow::Result<()> {
Ok(())
}
}