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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
// Shared clap subcommand enums used by the main CLI entrypoint.
// Keeps main.rs focused on command wiring rather than enum definitions.
// Depends on clap derive macros only.
use clap::Subcommand;
#[derive(Subcommand)]
pub enum ConfigAction {
/// List configured agents
Agents,
/// Register custom agent
AddAgent {
name: String,
command: String,
#[arg(long)]
streaming: bool,
},
/// Clear rate-limit marker for an agent (or "all")
ClearLimit {
/// Agent name (e.g. codex, gemini) or "all"
agent: String,
},
/// Show pricing table
Pricing {
#[arg(long)]
update: bool,
},
/// List available skills
Skills,
/// Display skill token estimates for prompt budgeting
PromptBudget,
/// List available templates
Templates,
}
#[derive(Subcommand)]
pub enum GroupAction {
/// Create a workgroup
Create {
/// Workgroup name
name: String,
/// Shared context files (e.g. src/types.rs)
#[arg(long, short)]
context: Option<String>,
/// Custom workgroup ID (default: auto-generated wg-xxxx)
#[arg(long)]
id: Option<String>,
},
/// List workgroups
List,
/// Show one workgroup and its member tasks
Show {
group_id: String,
},
/// Update a workgroup name and/or shared context
Update {
group_id: String,
#[arg(long)]
name: Option<String>,
#[arg(long)]
context: Option<String>,
},
/// Delete a workgroup definition
Delete {
group_id: String,
},
/// Cancel all non-terminal tasks in a workgroup
Cancel {
group_id: String,
},
/// Summarize workgroup results with milestones, findings, costs
Summary {
/// Workgroup ID (e.g. wg-abc1)
group_id: String,
},
/// Post or list workgroup findings
Finding {
#[command(subcommand)]
action: GroupFindingAction,
},
/// Send a message to the workgroup's broadcast channel
Broadcast {
/// Workgroup ID
group_id: String,
/// Message to broadcast
message: String,
},
}
#[derive(Subcommand)]
pub enum ContainerAction {
/// Build a container image from a Containerfile
Build {
tag: String,
#[arg(long)]
file: Option<String>,
},
/// List running dev containers
List,
/// Stop and remove a dev container
Stop {
name: String,
},
}
#[derive(Subcommand)]
#[allow(clippy::large_enum_variant)]
pub enum GroupFindingAction {
/// Post a finding to a workgroup
Add {
/// Workgroup ID
group: String,
/// Finding content
content: Option<String>,
#[arg(long)]
stdin: bool,
#[arg(long)]
file: Option<String>,
/// Source task ID (optional)
#[arg(long)]
task: Option<String>,
#[arg(long)]
severity: Option<String>,
#[arg(long)]
title: Option<String>,
#[arg(long, name = "finding-file")]
finding_file: Option<String>,
#[arg(long)]
lines: Option<String>,
#[arg(long)]
category: Option<String>,
#[arg(long)]
confidence: Option<String>,
},
/// List findings for a workgroup
List {
/// Workgroup ID
group: String,
#[arg(long)]
json: bool,
#[arg(long)]
count: bool,
#[arg(long)]
severity: Option<String>,
#[arg(long)]
verdict: Option<String>,
},
/// Show a single finding for a workgroup
Get {
/// Workgroup ID
group: String,
/// Finding ID
finding_id: i64,
#[arg(long)]
json: bool,
},
/// Update review metadata for a finding
Update {
/// Workgroup ID
group: String,
/// Finding ID
finding_id: i64,
#[arg(long)]
verdict: Option<String>,
#[arg(long)]
score: Option<String>,
#[arg(long)]
note: Option<String>,
},
}
#[derive(Subcommand)]
pub enum TeamAction {
/// List all teams
List,
/// Show team details and members
Show {
/// Team name
name: String,
},
/// Create a new team definition
Create {
/// Team name
name: String,
},
/// Remove a team definition
Delete {
/// Team name
name: String,
},
}
#[derive(Subcommand)]
pub enum ProjectAction {
/// Initialize project configuration in current repo
Init,
/// Show the detected project configuration
Show,
/// Show the current computed project state
State,
/// Sync project config to CLAUDE.md and global budget
Sync,
}
#[derive(Subcommand)]
pub enum ToolAction {
/// List available tools
List {
/// Filter to a specific team
#[arg(long)]
team: Option<String>,
},
/// Show tool details
Show {
name: String,
/// Search in team tools directory
#[arg(long)]
team: Option<String>,
},
/// Create a new tool definition
Add {
name: String,
/// Create in team tools directory
#[arg(long)]
team: Option<String>,
},
/// Remove a tool definition
Remove { name: String },
/// Test-run a tool with arguments
Test {
name: String,
/// Search in team tools directory
#[arg(long)]
team: Option<String>,
/// Arguments to pass to the tool
args: Vec<String>,
},
}
#[derive(Subcommand)]
pub enum WorktreeAction {
/// Create a worktree for a branch (prints path to stdout)
Create {
/// Branch name for the worktree
branch: String,
/// Base branch to fork from (default: HEAD)
#[arg(long)]
base: Option<String>,
/// Repository path (defaults to current dir)
#[arg(long)]
repo: Option<String>,
},
/// List active aid-managed worktrees
List {
/// Repository path (defaults to current dir)
#[arg(long)]
repo: Option<String>,
},
/// Prune stale aid-managed worktrees
Prune {
/// Repository path (defaults to current dir)
#[arg(long)]
repo: Option<String>,
},
/// Remove a worktree and prune git references
Remove {
/// Branch name of the worktree to remove
branch: String,
/// Repository path (defaults to current dir)
#[arg(long)]
repo: Option<String>,
},
}