Skip to main content

cove_cli/
cli.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser)]
4#[command(name = "cove", about = "Claude Code session manager", version)]
5#[command(args_conflicts_with_subcommands = true)]
6pub struct Cli {
7    /// Session name (default behavior: start or resume a session)
8    pub name: Option<String>,
9
10    /// Working directory
11    pub dir: Option<String>,
12
13    #[command(subcommand)]
14    pub command: Option<Command>,
15}
16
17#[derive(Debug, Subcommand)]
18pub enum Command {
19    /// List active sessions
20    #[command(alias = "ls")]
21    List,
22    /// Kill a single session tab
23    Kill {
24        /// Session name to kill
25        name: String,
26        /// Skip graceful shutdown (instant kill, no /exit)
27        #[arg(long, short)]
28        force: bool,
29    },
30    /// Kill all sessions
31    AllKill {
32        /// Skip graceful shutdown (instant kill, no /exit)
33        #[arg(long, short)]
34        force: bool,
35    },
36    /// Reattach to existing session
37    Resume,
38    /// Interactive session navigator (launched by start)
39    Sidebar,
40    /// Handle Claude Code hook events (called by hooks, not directly)
41    Hook {
42        #[command(subcommand)]
43        event: HookEvent,
44    },
45    /// Install Claude Code hooks for session status detection
46    Init,
47    /// Launch Claude Code in a standalone Ghostty window (voice mode works here)
48    Voice {
49        /// Session name
50        name: Option<String>,
51        /// Working directory
52        dir: Option<String>,
53    },
54}
55
56#[derive(Debug, Subcommand)]
57pub enum HookEvent {
58    /// Claude received a user prompt (UserPromptSubmit hook)
59    UserPrompt,
60    /// Claude finished responding (Stop hook)
61    Stop,
62    /// Claude is about to show an AskUserQuestion (PreToolUse hook) [legacy]
63    Ask,
64    /// User answered an AskUserQuestion (PostToolUse hook) [legacy]
65    AskDone,
66    /// Claude is about to use a tool (PreToolUse hook, wildcard matcher)
67    PreTool,
68    /// Claude finished using a tool (PostToolUse hook, wildcard matcher)
69    PostTool,
70    /// Claude session ended (SessionEnd hook)
71    SessionEnd,
72}