use clap::{Parser, ValueEnum};
use std::path::PathBuf;

/// Sync mcpServers.json to the global MCP configuration of AI clients.
#[derive(Parser)]
#[command(name = "mcp_sync", about = "同步 MCP 配置到 AI 客户端")]
pub struct Cli {
    /// Target clients, comma separated (claude, codex, copilot, gemini, cursor, opencode, droid); defaults to all.
    #[arg(
        long = "clients",
        value_delimiter = ',',
        num_args = 1..,
        default_values = ["claude", "codex", "copilot", "gemini", "cursor", "opencode", "droid"]
    )]
    pub clients: Vec<Client>,

    /// Source config path, defaults to ~/data/config/ai_conf/mcpServers.json.
    #[arg(long = "config")]
    pub config: Option<PathBuf>,
}

/// Supported AI clients.
#[derive(Clone, ValueEnum)]
pub enum Client {
    #[value(name = "claude")]
    Claude,
    #[value(name = "codex")]
    Codex,
    #[value(name = "copilot")]
    Copilot,
    #[value(name = "gemini")]
    Gemini,
    #[value(name = "cursor")]
    Cursor,
    #[value(name = "opencode")]
    Opencode,
    #[value(name = "droid")]
    Droid,
}
