Skip to main content

vtcode_core/cli/args/
schedule.rs

1use clap::{Args, Subcommand, ValueHint};
2use std::path::PathBuf;
3
4/// `schedule` subcommands.
5#[derive(Subcommand, Debug, Clone)]
6pub enum ScheduleSubcommand {
7    /// Create a durable scheduled task
8    #[command(
9        long_about = "Create a durable scheduled task.\n\nExamples:\n  vtcode schedule create --prompt \"check the deployment\" --every 10m\n  vtcode schedule create --prompt \"review the nightly build\" --cron \"0 9 * * 1-5\"\n  vtcode schedule create --reminder \"push the release branch\" --at \"15:00\""
10    )]
11    Create(ScheduleCreateArgs),
12    /// List durable scheduled tasks
13    List,
14    /// Delete a durable scheduled task by id
15    Delete {
16        #[arg(value_name = "TASK_ID")]
17        id: String,
18    },
19    /// Run the local durable scheduler daemon
20    Serve,
21    /// Install the scheduler as a user service
22    #[command(name = "install-service")]
23    InstallService,
24    /// Uninstall the scheduler user service
25    #[command(name = "uninstall-service")]
26    UninstallService,
27}
28
29/// Arguments for `vtcode schedule create`.
30#[derive(Args, Debug, Clone)]
31pub struct ScheduleCreateArgs {
32    /// Optional short label for the task
33    #[arg(long, value_name = "NAME")]
34    pub name: Option<String>,
35    /// Prompt to run with `vtcode exec`
36    #[arg(long, value_name = "PROMPT", conflicts_with = "reminder")]
37    pub prompt: Option<String>,
38    /// Local reminder text to surface without invoking the model
39    #[arg(long, value_name = "TEXT", conflicts_with = "prompt")]
40    pub reminder: Option<String>,
41    /// Fixed interval such as 10m, 2h, or 1d
42    #[arg(long, value_name = "DURATION", conflicts_with_all = ["cron", "at"])]
43    pub every: Option<String>,
44    /// Five-field cron expression
45    #[arg(long, value_name = "EXPR", conflicts_with_all = ["every", "at"])]
46    pub cron: Option<String>,
47    /// One-shot local time (RFC3339, YYYY-MM-DD HH:MM, or HH:MM)
48    #[arg(long, value_name = "TIME", conflicts_with_all = ["every", "cron"])]
49    pub at: Option<String>,
50    /// Workspace to use for prompt tasks
51    #[arg(long, value_name = "PATH", value_hint = ValueHint::DirPath)]
52    pub workspace: Option<PathBuf>,
53}