use std::path::PathBuf;
use clap::{Parser, Subcommand};
use crate::types::keys::Scope;
#[derive(Debug, Parser)]
#[command(version, about, long_about = None)]
pub struct CliArgs {
#[command(subcommand)]
pub command: CommandArgs,
}
#[derive(Debug, Subcommand)]
pub enum CommandArgs {
Serve {
#[arg(long, short, default_value_t = 8000)]
port: u16,
#[arg(long, short, default_value = "0.0.0.0")]
addr: String,
#[arg(
long,
value_name = "FILE",
long_help = "Specify a Solana wallet id file (id.json, generated with `solana-keygen new`) the node will be using. Defaults to `~/.config/solana/id.json`."
)]
id: Option<PathBuf>,
},
Keygen {
#[arg(
long,
short,
default_value = "dev",
long_help = "Scope tag is set to `dev` by default. By specifying this, you get a secret key like: `aimo-sk-<tag>-xxxxxxx`"
)]
tag: String,
#[arg(long, short, default_value_t = 90)]
valid_for: u32,
#[arg(
long,
short,
value_delimiter = ',',
long_help = "Specify which scopes to enable with comma-seperated values. Current supported values are: \"completion_model\"",
default_value = "completion_model"
)]
scopes: Vec<Scope>,
#[arg(long, short, default_value_t = 0)]
usage_limit: u64,
#[arg(
long,
value_name = "FILE",
long_help = "Specify a Solana wallet id file (id.json, generated with `solana-keygen new`) to sign the secret key. Defaults to `~/.config/solana/id.json`."
)]
id: Option<PathBuf>,
},
Proxy {
#[arg(long)]
node_url: String,
#[arg(
long,
long_help = "Provide your secret key to access AiMo Network nodes. See `aimo keygen --help`."
)]
secret_key: String,
#[arg(long)]
endpoint_url: String,
#[arg(long)]
api_key: Option<String>,
},
}