Skip to main content

chronicle/
cli.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser)]
4#[command(name = "chronicle", about = "Track and replay Claude Code agent sessions")]
5pub struct Cli {
6    #[command(subcommand)]
7    pub command: Option<Commands>,
8}
9
10#[derive(Subcommand)]
11pub enum Commands {
12    /// Initialize chronicle in the current project
13    Init,
14    /// Launch the TUI dashboard
15    Tui,
16    /// List recorded sessions
17    Sessions,
18    /// Restore files to their state at a specific event
19    Restore {
20        /// Event ID to restore to
21        event_id: i64,
22    },
23    /// Manage hooks
24    Hooks {
25        #[command(subcommand)]
26        command: HooksCommands,
27    },
28    /// Manage the chronicle daemon
29    Daemon {
30        #[command(subcommand)]
31        command: DaemonCommands,
32    },
33    /// Relay hook data from stdin to the daemon (used by hook scripts)
34    HookRelay,
35}
36
37#[derive(Subcommand)]
38pub enum HooksCommands {
39    /// Show installed hook configuration
40    Show,
41    /// Remove chronicle hooks
42    Remove,
43}
44
45#[derive(Subcommand)]
46pub enum DaemonCommands {
47    /// Start the daemon
48    Start,
49    /// Stop the daemon
50    Stop,
51    /// Show daemon status
52    Status,
53}