systemprompt_cli/commands/admin/evals/
mod.rs1pub mod list;
12pub mod promote;
13pub mod replay;
14pub mod run;
15mod shared;
16pub mod show;
17
18use anyhow::Result;
19use clap::Subcommand;
20
21use crate::context::CommandContext;
22use crate::shared::render_result;
23
24#[derive(Debug, Subcommand)]
25pub enum EvalsCommands {
26 #[command(about = "Judge a sample of recent AI requests (auto-improve pass)")]
27 Run(run::RunArgs),
28
29 #[command(about = "List evaluation runs")]
30 List(list::ListArgs),
31
32 #[command(about = "Show a run and its results")]
33 Show(show::ShowArgs),
34
35 #[command(about = "Replay a run's failures as a new replay run")]
36 Replay(replay::ReplayArgs),
37
38 #[command(about = "Promote an AI request into the golden case set")]
39 Promote(promote::PromoteArgs),
40}
41
42pub async fn execute(cmd: EvalsCommands, ctx: &CommandContext) -> Result<()> {
43 let result = match cmd {
44 EvalsCommands::Run(args) => run::execute(args, ctx).await?,
45 EvalsCommands::List(args) => list::execute(args, ctx).await?,
46 EvalsCommands::Show(args) => show::execute(args, ctx).await?,
47 EvalsCommands::Replay(args) => replay::execute(args, ctx).await?,
48 EvalsCommands::Promote(args) => promote::execute(args, ctx).await?,
49 };
50 render_result(&result, &ctx.cli);
51 Ok(())
52}