use aha::models::common::model_mapping::WhichModel;
use clap::{Args, Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(name = "aha")]
#[command(version, about, long_about = None)]
pub(crate) struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub(crate) enum Commands {
Cli(CliArgs),
Serv(ServArgs),
Ps(ServListArgs),
Delete(DeleteArgs),
Download(DownloadArgs),
Run(RunArgs),
List(ListArgs),
}
#[derive(Args, Debug)]
pub(crate) struct ServerCommonArgs {
#[arg(short, long, default_value = "127.0.0.1")]
pub address: String,
#[arg(short, long, default_value_t = 10100)]
pub port: u16,
#[arg(long)]
pub allow_remote_shutdown: bool,
}
#[derive(Args, Debug)]
pub(crate) struct PathCommonArgs {
#[arg(long)]
pub weight_path: Option<String>,
#[arg(long)]
pub gguf_path: Option<String>,
#[arg(long)]
pub mmproj_path: Option<String>,
#[arg(long)]
pub onnx_path: Option<String>,
#[arg(long)]
pub config_path: Option<String>,
}
#[derive(Args, Debug)]
pub(crate) struct CliArgs {
#[arg(short, long)]
pub model: WhichModel,
#[command(flatten)]
pub server_common: ServerCommonArgs,
#[arg(long)]
pub save_dir: Option<String>,
#[arg(long)]
pub download_retries: Option<u32>,
#[command(flatten)]
pub path_common: PathCommonArgs,
}
#[derive(Args, Debug)]
pub(crate) struct ServArgs {
#[arg(short, long)]
pub model: WhichModel,
#[command(flatten)]
pub server_common: ServerCommonArgs,
#[command(flatten)]
pub path_common: PathCommonArgs,
}
#[derive(Args, Debug)]
pub(crate) struct ServListArgs {
#[arg(short, long)]
pub compact: bool,
}
#[derive(Args, Debug)]
pub(crate) struct DownloadArgs {
#[arg(short, long)]
pub model: WhichModel,
#[arg(short, long)]
pub save_dir: Option<String>,
#[arg(long)]
pub download_retries: Option<u32>,
}
#[derive(Args, Debug)]
pub(crate) struct RunArgs {
#[arg(short, long)]
pub model: WhichModel,
#[arg(short, long, num_args = 1..=2, value_delimiter = ' ')]
pub input: Vec<String>,
#[arg(short, long)]
pub output: Option<String>,
#[command(flatten)]
pub path_common: PathCommonArgs,
}
#[derive(Args, Debug)]
pub(crate) struct DeleteArgs {
#[arg(short, long)]
pub model: WhichModel,
}
#[derive(Args, Debug)]
pub(crate) struct ListArgs {
#[arg(short, long)]
pub json: bool,
}