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
use clap::{Args, Parser, Subcommand};
use std::path::PathBuf;
use crate::snapshots::SnapshotScope;
/// Main CLI parser
#[derive(Parser)]
#[command(about, version, author, long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
/// Available CLI commands
#[derive(Subcommand)]
pub enum Commands {
/// List and manage snapshots [aliases: l, ls]
#[command(alias = "l", alias = "ls")]
List,
/// Apply a snapshot or template [alias: a]
#[command(alias = "a")]
Apply {
/// Snapshot name or template type (deepseek, glm, k2, k2-thinking, kat-coder-pro, kat-coder-air, kat-coder, kimi, longcat, fishtrip, fish, minimax, seed-code, zenmux, anyrouter, openrouter)
target: String,
/// What to include in the snapshot (default: common)
#[arg(long, default_value = "common", help = "Scope of settings to include")]
scope: SnapshotScope,
/// Override model setting
#[arg(long, help = "Override model setting")]
model: Option<String>,
/// Path to settings file (default: .claude/settings.json)
#[arg(long, help = "Path to settings file (default: .claude/settings.json)")]
settings_path: Option<PathBuf>,
/// Backup current settings before applying
#[arg(long, help = "Create backup of current settings before applying")]
backup: bool,
/// Skip confirmation prompt
#[arg(long, help = "Skip confirmation prompt")]
yes: bool,
/// CLI mode: skip all interactive prompts, use parameters/defaults
#[arg(long, help = "Non-interactive mode: skip prompts, use params/defaults")]
cli: bool,
/// Effort level (xhigh/high/medium/low)
#[arg(long, help = "Set effort level (default: xhigh in CLI mode)")]
effort: Option<String>,
/// API key to use (skips interactive key selection)
#[arg(long, help = "API key to use (skips interactive selection)")]
api_key: Option<String>,
/// Disable co-authored-by attribution in commits
#[arg(long, help = "Disable co-authored-by attribution in commits")]
no_co_author: bool,
},
/// Manage saved credentials [aliases: creds, cred]
#[command(alias = "creds", alias = "cred")]
Credentials {
/// Subcommand for credential management
#[command(subcommand)]
command: CredentialCommands,
},
}
/// Credential management commands
#[derive(Subcommand)]
pub enum CredentialCommands {
/// List saved credentials [aliases: l, ls]
#[command(alias = "l", alias = "ls")]
List,
/// Clear all saved credentials
Clear {
/// Skip confirmation prompt
#[arg(long, help = "Skip confirmation prompt")]
yes: bool,
},
}
/// Arguments for snapshot creation
#[derive(Args, Clone)]
pub struct SnapArgs {
/// Name for the snapshot
pub name: String,
/// What to include in the snapshot (default: common)
#[arg(
long,
default_value = "common",
help = "Scope of settings to include in snapshot"
)]
pub scope: SnapshotScope,
/// Path to settings file (default: .claude/settings.json)
#[arg(long, help = "Path to settings file (default: .claude/settings.json)")]
pub settings_path: Option<PathBuf>,
/// Description for the snapshot
#[arg(long, help = "Description for the snapshot")]
pub description: Option<String>,
/// Overwrite existing snapshot with same name
#[arg(long, help = "Overwrite existing snapshot with same name")]
pub overwrite: bool,
}
/// Arguments for applying snapshots/templates
#[derive(Args, Clone)]
pub struct ApplyArgs {
/// Snapshot name or template type
pub target: String,
/// What to include in the snapshot (default: common)
#[arg(long, default_value = "common", help = "Scope of settings to include")]
pub scope: SnapshotScope,
/// Override model setting
#[arg(long, help = "Override model setting")]
pub model: Option<String>,
/// Path to settings file (default: .claude/settings.json)
#[arg(long, help = "Path to settings file (default: .claude/settings.json)")]
pub settings_path: Option<PathBuf>,
/// Backup current settings before applying
#[arg(long, help = "Create backup of current settings before applying")]
pub backup: bool,
/// Skip confirmation prompt
#[arg(long, help = "Skip confirmation prompt")]
pub yes: bool,
}