Skip to main content

vtcode_core/cli/args/
exec.rs

1use clap::{Args, Subcommand, ValueEnum};
2
3/// `exec` subcommands.
4#[derive(Subcommand, Debug, Clone)]
5pub enum ExecSubcommand {
6    /// Resume a previous exec session with a follow-up prompt
7    #[command(
8        long_about = "Resume a previous exec session with a follow-up prompt.\n\nExamples:\n  vtcode exec resume session-123 \"continue from the prior investigation\"\n  vtcode exec resume --last \"continue from the prior investigation\"\n  echo \"continue from stdin\" | vtcode exec resume --last"
9    )]
10    Resume(ExecResumeArgs),
11    /// Run an evaluation suite for regression or capability testing
12    #[command(
13        long_about = "Run an evaluation suite against the agent. Each task in the suite is\n\
14                      executed autonomously, then verified with environment probes.\n\
15                      Results are aggregated into a report with pass@k and pass^k metrics.\n\n\
16                      `vtcode eval` is a shorthand alias for this subcommand.\n\n\
17                      Examples:\n  vtcode exec eval --suite my-suite.json\n  vtcode exec eval --suite suite.json --output report.md\n  vtcode exec eval --suite suite.json --format json --output report.json"
18    )]
19    Eval(ExecEvalArgs),
20}
21
22/// Report format for eval runs.
23#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, ValueEnum)]
24pub enum EvalOutputFormat {
25    /// Human-readable markdown report.
26    #[default]
27    Markdown,
28    /// Machine-readable JSON envelope with run metadata for reproducible,
29    /// publishable benchmark results.
30    Json,
31}
32
33/// Arguments for `vtcode exec eval` (and the `vtcode eval` alias).
34#[derive(Args, Debug, Clone)]
35pub struct ExecEvalArgs {
36    /// Path to the eval suite JSON file
37    #[arg(long, value_name = "FILE")]
38    pub suite: String,
39    /// Optional path to write the report (format follows --format)
40    #[arg(long, value_name = "FILE")]
41    pub output: Option<String>,
42    /// Report format: markdown (human) or json (reproducible benchmark envelope)
43    #[arg(long, value_enum, default_value_t = EvalOutputFormat::Markdown)]
44    pub format: EvalOutputFormat,
45}
46
47/// Arguments for `vtcode exec resume`.
48#[derive(Args, Debug, Clone)]
49pub struct ExecResumeArgs {
50    /// Resume the most recent archived exec session
51    #[arg(long)]
52    pub last: bool,
53    /// Search archived exec sessions across every workspace
54    #[arg(long)]
55    pub all: bool,
56    /// Archived session identifier to resume, or the prompt when `--last` is used
57    #[arg(value_name = "SESSION_ID_OR_PROMPT", required_unless_present = "last")]
58    pub session_or_prompt: Option<String>,
59    /// Follow-up prompt to execute when resuming a specific session. Use `-` to force reading from stdin.
60    #[arg(value_name = "PROMPT")]
61    pub prompt: Option<String>,
62}