1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
use clap::{Parser, Subcommand};
/// `claco` (Claude Code Helper) is a CLI tool for boosting Claude Code productive.
#[derive(Parser)]
#[command(name = "claco")]
#[command(author, version, about = "`claco` (Claude Code Helper) is a CLI tool for boosting Claude Code productive.", long_about = None)]
pub struct Cli {
/// Enable verbose logging
#[arg(short, long, global = true)]
pub verbose: bool,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Manage custom agents
#[command(subcommand)]
Agents(AgentsSubcommand),
/// Manage slash commands
#[command(subcommand)]
Commands(CommandsSubcommand),
/// Manage hooks
Hooks {
#[command(subcommand)]
action: HooksAction,
},
/// List all user input messages for the current project
#[command(alias = "showmeyourtalk")]
History {
/// Show messages from a specific session ID
#[arg(short, long)]
session: Option<String>,
},
/// Display session info by ID (defaults to most recent session)
Session {
/// Session ID to display (if not provided, shows most recent session)
session_id: Option<String>,
},
/// List all projects with their sessions
Projects,
/// Manage Claude Code settings
#[command(subcommand)]
Settings(SettingsSubcommand),
}
#[derive(Subcommand)]
pub enum HooksAction {
/// List all hooks
List {
/// Scope to list hooks from (user or project, defaults to showing both)
#[arg(long)]
scope: Option<String>,
},
/// Add a new hook
Add {
/// Scope to add hook to (user or project)
#[arg(long, default_value = "project")]
scope: String,
/// Event type to hook into
#[arg(long)]
event: String,
/// Matcher pattern for the hook (optional, defaults to empty string)
#[arg(long, default_value = "")]
matcher: String,
/// Command to execute when hook is triggered
#[arg(long)]
command: String,
},
/// Delete hooks interactively
Delete {
/// Interactive mode to select and delete hooks
#[arg(long, default_value = "true")]
interactive: bool,
},
}
#[derive(Subcommand)]
pub enum CommandsSubcommand {
/// List all slash commands
List {
/// Scope: user or project (defaults to showing both)
#[arg(long, value_enum)]
scope: Option<Scope>,
},
/// Import slash command from GitHub markdown file
Import {
/// GitHub URL to the markdown file (e.g., https://github.com/owner/repo/blob/main/path/to/file.md)
url: String,
/// Scope: user or project (defaults to project)
#[arg(long, value_enum, default_value = "project")]
scope: Scope,
},
/// Remove all slash commands (with confirmation)
Clean {
/// Scope: user or project (defaults to project)
#[arg(long, value_enum, default_value = "project")]
scope: Scope,
},
/// Generate a command template
#[command(alias = "gen")]
Generate {
/// The filename for the template (optional, defaults to command-template.md)
filename: Option<String>,
},
/// Delete commands interactively
Delete {
/// Interactive mode to select and delete commands
#[arg(short, long, default_value = "true")]
interactive: bool,
},
}
#[derive(clap::ValueEnum, Clone, Debug)]
pub enum Scope {
User,
Project,
#[value(name = "project.local")]
ProjectLocal,
}
#[derive(Subcommand)]
pub enum SettingsSubcommand {
/// Apply settings from a file or URL to Claude Code settings
Apply {
/// Path to local settings file or GitHub URL
source: String,
/// Scope: user or project (defaults to project)
#[arg(long, value_enum, default_value = "project")]
scope: Scope,
/// Overwrite existing settings (abort by default when duplicates exist)
#[arg(long, default_value = "false")]
overwrite: bool,
},
}
#[derive(Subcommand)]
pub enum AgentsSubcommand {
/// List all agents
List {
/// Scope: user or project (defaults to showing both)
#[arg(long, value_enum)]
scope: Option<Scope>,
},
/// Import agent from file or URL
Import {
/// Path to agent file or GitHub URL
source: String,
/// Scope: user or project (defaults to project)
#[arg(long, value_enum, default_value = "project")]
scope: Scope,
},
/// Delete agents interactively
Delete {
/// Interactive mode to select and delete agents
#[arg(short, long, default_value = "true")]
interactive: bool,
},
/// Remove all agents (with confirmation)
Clean {
/// Scope: user or project (defaults to project)
#[arg(long, value_enum, default_value = "project")]
scope: Scope,
},
/// Generate an agent template
#[command(alias = "gen")]
Generate {
/// The filename for the template (optional, defaults to agent-template.md)
filename: Option<String>,
},
}