Skip to main content

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    },
13    /// Install app preset files for all or a specific category
14    Install {
15        /// Category to install (e.g. JetBrains, starship). Installs all if omitted.
16        #[arg(value_name = "CATEGORY")]
17        category: Option<String>,
18        /// Print what would be installed without making any changes
19        #[arg(long)]
20        dry_run: bool,
21        /// Replace user-modified files that are already managed by shine
22        #[arg(long)]
23        replace_managed: bool,
24    },
25    /// Explicitly refresh installed generated files for an app preset
26    Refresh {
27        /// App preset category to refresh
28        #[arg(value_name = "CATEGORY")]
29        category: String,
30        /// Optional generator source path; refreshes all installed generators when omitted
31        #[arg(value_name = "FILE")]
32        file: Option<String>,
33        /// Overwrite a managed destination that was modified after install
34        #[arg(long)]
35        force: bool,
36    },
37    /// Uninstall installed app preset files and optionally restore backups
38    Uninstall {
39        /// Category to uninstall (e.g. vim, starship). Uninstalls all if omitted.
40        #[arg(value_name = "CATEGORY")]
41        category: Option<String>,
42        /// Remove app config files even if they were modified after install
43        #[arg(long)]
44        force: bool,
45        /// Also remove the app presets directory and manifest after uninstalling
46        #[arg(long)]
47        purge: bool,
48        /// Print what would be removed without making any changes
49        #[arg(long)]
50        dry_run: bool,
51    },
52    /// Apply or remove an app preset's external artifact integration
53    Artifact {
54        #[command(subcommand)]
55        command: AppArtifactCommands,
56    },
57}
58
59#[derive(Subcommand, Debug)]
60pub enum AppArtifactCommands {
61    /// Apply the artifact integration declared by an app preset
62    Apply {
63        #[arg(value_name = "APP_ID")]
64        app_id: String,
65    },
66    /// Remove the artifact integration declared by an app preset
67    Remove {
68        #[arg(value_name = "APP_ID")]
69        app_id: String,
70    },
71}