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
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(name = "claudy", version, about = "Multi-provider launcher for Claude CLI", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
/// List configured providers
#[command(name = "list", alias = "ls")]
List,
/// Interactive provider configuration
#[command(name = "setup", alias = "config")]
Setup {
/// Provider ID to configure
provider: Option<String>,
},
/// Show provider details
#[command(name = "show", alias = "info")]
Show {
/// Profile name
profile: String,
},
/// Test connectivity to providers
#[command(name = "ping", alias = "test")]
Ping {
/// Profile name to test (all if omitted)
profile: Option<String>,
},
/// Check system status and paths
#[command(name = "doctor", alias = "status")]
Doctor,
/// Synchronize claudy and claude shim
#[command(name = "sync", alias = "install")]
Sync,
/// Update claudy to the latest version
Update,
/// Uninstall claudy and remove all files
Uninstall,
/// Manage Claude configuration modes
#[command(name = "mode")]
Mode {
/// Action: create, list, remove
action: String,
/// Mode name (for create/remove)
name: Option<String>,
},
/// Manage the remote code channel
#[command(subcommand)]
Channel(ChannelCommands),
/// Manage MCP server for Claude Code (agent bridge)
#[command(subcommand)]
Mcp(McpCommands),
/// Usage analytics and recommendations dashboard
#[command(subcommand)]
Analytics(AnalyticsCommands),
/// Manage Claude sessions
#[command(subcommand)]
Session(SessionCommands),
}
#[derive(Subcommand, Debug, Clone)]
pub enum McpCommands {
/// Run the MCP server (called by Claude Code)
Run,
/// Register claudy as an MCP server in Claude Code settings
Install,
/// Remove claudy from Claude Code MCP settings
Uninstall,
}
#[derive(Subcommand, Debug)]
pub enum ChannelCommands {
/// Run the channel server in the foreground
Serve {
/// Profile to use for Claude sessions
#[arg(long)]
profile: Option<String>,
/// Listen address (overrides config)
#[arg(long)]
listen: Option<String>,
},
/// Start the channel server in the background
Start {
/// Profile to use for Claude sessions
#[arg(long)]
profile: Option<String>,
/// Listen address (overrides config)
#[arg(long)]
listen: Option<String>,
},
/// Stop the running channel server
Stop,
/// Restart the channel server
Restart {
/// Profile to use for Claude sessions
#[arg(long)]
profile: Option<String>,
/// Listen address (overrides config)
#[arg(long)]
listen: Option<String>,
},
/// Show channel server status
Status,
/// Add a channel platform (telegram, slack, discord)
Add {
/// Platform to add
platform: String,
},
/// Remove a channel platform
Remove {
/// Platform to remove
platform: String,
},
/// Enable the channel service (auto-start on login)
Enable,
/// Disable the channel service (stop auto-starting on login)
Disable,
}
#[derive(Subcommand, Debug)]
pub enum AnalyticsCommands {
/// Open the analytics dashboard
Dashboard,
/// Ingest session data from ~/.claude/projects/
Ingest {
/// Re-ingest all files, ignoring checkpoints
#[arg(long)]
full: bool,
/// Filter by project name
#[arg(long)]
project: Option<String>,
},
/// Show usage recommendations
Recommend,
/// Export analytics data
Export {
/// Output format: csv or json
#[arg(long, default_value = "json")]
format: String,
/// Filter by project name
#[arg(long)]
project: Option<String>,
/// Number of days to include
#[arg(long, default_value = "30")]
days: u32,
},
/// Sync model pricing from models.dev and Anthropic pricing page
SyncPricing,
/// Generate a compact JSON insights summary for LLM analysis
Insights {
/// Number of days to analyze (default: 7)
#[arg(long, default_value = "7")]
days: u32,
/// Start date (YYYY-MM-DD), overrides --days
#[arg(long)]
from: Option<String>,
/// End date (YYYY-MM-DD), overrides --days
#[arg(long)]
to: Option<String>,
/// Filter by project name
#[arg(long)]
project: Option<String>,
},
/// Recalculate all costs using the latest pricing data
Recalculate,
}
#[derive(Subcommand, Debug)]
pub enum SessionCommands {
/// Find sessions with invalid thinking blocks (from non-Anthropic providers)
/// and convert them so the session can be resumed with Claude.
#[command(name = "sanitize")]
Sanitize {
/// Filter by project name (case-insensitive substring)
#[arg(long, short)]
project: Option<String>,
/// Sanitize all flagged sessions without interactive selection
#[arg(long, short)]
all: bool,
/// Skip the confirmation prompt
#[arg(long, short = 'y')]
yes: bool,
},
}