-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.rs
More file actions
112 lines (94 loc) · 2.97 KB
/
Copy pathcli.rs
File metadata and controls
112 lines (94 loc) · 2.97 KB
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
use clap::{Parser, Subcommand, ValueEnum};
use std::path::PathBuf;
/// Claude Configuration Synchronization Tool
///
/// Sync agents, skills, and commands between global (~/.claude) and project-specific (.claude) directories
#[derive(Parser, Debug)]
#[command(name = "ccsync")]
#[command(about, long_about = None, version)]
#[allow(clippy::struct_excessive_bools)]
pub struct Cli {
/// Enable verbose output
#[arg(short, long, global = true)]
pub verbose: bool,
/// Accept all items in interactive mode without prompting
#[arg(long, global = true)]
pub yes_all: bool,
/// Preview changes without executing (dry-run)
#[arg(long, global = true)]
pub dry_run: bool,
/// Override global path (default: ~/.claude)
#[arg(long, global = true, value_name = "PATH")]
pub global_path: Option<PathBuf>,
/// Override local path (default: ./.claude)
#[arg(long, global = true, value_name = "PATH")]
pub local_path: Option<PathBuf>,
/// Use specific config file
#[arg(long, global = true, value_name = "PATH")]
pub config: Option<PathBuf>,
/// Ignore all config files
#[arg(long, global = true)]
pub no_config: bool,
/// Preserve symlinks instead of following them
#[arg(long, global = true)]
pub preserve_symlinks: bool,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
/// Sync from global (~/.claude) to local (./.claude)
ToLocal {
/// Filter by configuration type(s)
#[arg(short = 't', long = "type", value_enum)]
types: Vec<ConfigType>,
/// Conflict resolution strategy
#[arg(long, value_enum, default_value = "fail")]
conflict: ConflictMode,
},
/// Sync from local (./.claude) to global (~/.claude)
ToGlobal {
/// Filter by configuration type(s)
#[arg(short = 't', long = "type", value_enum)]
types: Vec<ConfigType>,
/// Conflict resolution strategy
#[arg(long, value_enum, default_value = "fail")]
conflict: ConflictMode,
},
/// Show sync status without making changes
Status {
/// Filter by configuration type(s)
#[arg(short = 't', long = "type", value_enum)]
types: Vec<ConfigType>,
},
/// Display detailed differences between configurations
Diff {
/// Filter by configuration type(s)
#[arg(short = 't', long = "type", value_enum)]
types: Vec<ConfigType>,
},
/// Show active configuration and debug settings
Config,
}
#[derive(Debug, Clone, ValueEnum)]
pub enum ConfigType {
/// Agent configurations
Agents,
/// Skill configurations
Skills,
/// Command configurations
Commands,
/// All configuration types
All,
}
#[derive(Debug, Clone, ValueEnum)]
pub enum ConflictMode {
/// Exit on conflicts (default)
Fail,
/// Overwrite with warning
Overwrite,
/// Skip conflicting files
Skip,
/// Keep newer file
Newer,
}