use clap::{Args, Subcommand};
#[derive(Args)]
#[command(after_help = r#"Examples:
aid ask "What is the latest Rust edition?"
aid ask "Explain this error" --files src/main.rs -o explanation.md"#)]
pub struct AskArgs {
pub prompt: String,
#[arg(long)]
pub agent: Option<String>,
#[arg(short, long)]
pub model: Option<String>,
#[arg(long)]
pub files: Vec<String>,
#[arg(short, long)]
pub output: Option<String>,
}
#[derive(Args)]
#[command(after_help = r#"Examples:
aid query "What does gamma=0 mean in CryptoSwap?"
aid query "Explain this" --auto
aid query "Key insight" -g wg-abc1 --finding"#)]
pub struct QueryArgs {
pub prompt: String,
#[arg(short, long)]
pub auto: bool,
#[arg(short, long)]
pub model: Option<String>,
#[arg(short, long)]
pub group: Option<String>,
#[arg(long)]
pub finding: bool,
}
#[derive(Args)]
#[command(after_help = r#"Examples:
aid memory add discovery "The auth module uses bcrypt not argon2"
aid memory add convention "Use anyhow::Result in CLI handlers" --tier critical
aid memory list --type convention
aid memory search "auth"
aid memory forget m-a3f1"#)]
pub struct MemoryArgs {
#[command(subcommand)]
pub action: MemoryCommands,
}
#[derive(Subcommand)]
pub enum MemoryCommands {
Add {
#[arg(name = "TYPE")]
memory_type: String,
content: String,
#[arg(long)]
tier: Option<String>,
#[arg(long)]
project: Option<String>,
},
List {
#[arg(long = "type")]
memory_type: Option<String>,
#[arg(long)]
all: bool,
#[arg(long)]
stats: bool,
#[arg(long)]
project: Option<String>,
},
Search {
query: String,
#[arg(long)]
project: Option<String>,
},
Update { id: String, content: String },
Forget { id: String },
History { id: String },
}
#[derive(Args)]
pub struct KgArgs {
#[command(subcommand)]
pub action: KgCommands,
}
#[derive(Subcommand)]
pub enum KgCommands {
Add {
subject: String,
predicate: String,
object: String,
#[arg(long)]
valid_from: Option<String>,
#[arg(long)]
source: Option<String>,
},
Query {
entity: String,
#[arg(long)]
as_of: Option<String>,
},
Invalidate {
id: i64,
},
Timeline { entity: String },
Search { query: String },
Stats,
}