cli/commands/app.rs
1use clap::Subcommand;
2
3#[derive(Subcommand, Debug)]
4pub enum AppCommands {
5 /// List available app preset categories and their destination paths
6 List,
7 /// Show detailed information about a specific app preset category
8 Info {
9 /// Category to inspect (e.g. vim, starship)
10 #[arg(value_name = "CATEGORY")]
11 category: String,
12 /// Explicitly execute generators to evaluate final transformed content
13 #[arg(long)]
14 run_generators: bool,
15 /// Print a unified diff against installed content (or an empty file before install)
16 #[arg(long)]
17 diff: bool,
18 },
19 /// Install app preset files for all or a specific category
20 Install {
21 /// Category to install (e.g. JetBrains, starship). Installs all if omitted.
22 #[arg(value_name = "CATEGORY")]
23 category: Option<String>,
24 /// Print what would be installed without making any changes
25 #[arg(long)]
26 dry_run: bool,
27 /// Replace user-modified files that are already managed by shine
28 #[arg(long)]
29 replace_managed: bool,
30 /// Approve the displayed lifecycle Plan without prompting
31 #[arg(long, conflicts_with = "dry_run")]
32 yes: bool,
33 },
34 /// Explicitly refresh installed generated files for an app preset
35 Refresh {
36 /// App preset category to refresh
37 #[arg(value_name = "CATEGORY")]
38 category: String,
39 /// Optional generator source path; refreshes all installed generators when omitted
40 #[arg(value_name = "FILE")]
41 file: Option<String>,
42 /// Overwrite a managed destination that was modified after install
43 #[arg(long)]
44 force: bool,
45 /// Approve the displayed security Plan without prompting
46 #[arg(long)]
47 yes: bool,
48 },
49 /// Review and recover an interrupted app lifecycle operation
50 Recover {
51 /// Approve the displayed recovery Plan without prompting
52 #[arg(long)]
53 yes: bool,
54 },
55 /// Uninstall installed app preset files and optionally restore backups
56 Uninstall {
57 /// Category to uninstall (e.g. vim, starship). Uninstalls all if omitted.
58 #[arg(value_name = "CATEGORY")]
59 category: Option<String>,
60 /// Remove app config files even if they were modified after install
61 #[arg(long)]
62 force: bool,
63 /// Also remove the app presets directory and manifest after uninstalling
64 #[arg(long)]
65 purge: bool,
66 /// Print what would be removed without making any changes
67 #[arg(long)]
68 dry_run: bool,
69 /// Approve the displayed lifecycle Plan without prompting
70 #[arg(long, conflicts_with = "dry_run")]
71 yes: bool,
72 },
73 /// Apply or remove an app preset's external artifact integration
74 Artifact {
75 #[command(subcommand)]
76 command: AppArtifactCommands,
77 },
78}
79
80#[derive(Subcommand, Debug)]
81pub enum AppArtifactCommands {
82 /// Apply the artifact integration declared by an app preset
83 Apply {
84 #[arg(value_name = "APP_ID")]
85 app_id: String,
86 /// Approve the displayed security Plan without prompting
87 #[arg(long)]
88 yes: bool,
89 },
90 /// Remove the artifact integration declared by an app preset
91 Remove {
92 #[arg(value_name = "APP_ID")]
93 app_id: String,
94 /// Approve the displayed security Plan without prompting
95 #[arg(long)]
96 yes: bool,
97 },
98}