Skip to main content

oxide_cli/cli/
commands.rs

1use clap::{Subcommand, arg};
2
3#[derive(Subcommand)]
4pub enum AddonCommands {
5  #[command(about = "Install and cache an addon")]
6  Install { addon_id: String },
7
8  #[command(about = "List installed addons")]
9  List,
10
11  #[command(about = "Remove a cached addon")]
12  Remove { addon_id: String },
13}
14
15#[derive(Subcommand)]
16pub enum TemplateCommands {
17  #[command(about = "Download and cache a template locally")]
18  Install {
19    #[arg(help = "Name of the template to install")]
20    template_name: String,
21  },
22
23  #[command(about = "List all locally installed templates")]
24  List,
25
26  #[command(about = "Remove an installed template from the local cache")]
27  Remove {
28    #[arg(help = "Name of the template to remove")]
29    template_name: String,
30  },
31
32  #[command(about = "Publish a GitHub repository as an Oxide template")]
33  Publish {
34    #[arg(help = "GitHub repository URL (e.g. https://github.com/owner/repo)")]
35    template_url: String,
36  },
37}
38
39#[derive(Subcommand)]
40pub enum Commands {
41  #[command(alias = "n", about = "Create a new project from a template")]
42  New {
43    #[arg(help = "Name of the project directory to create")]
44    name: String,
45
46    #[arg(help = "Name of the template to use (e.g. react-vite-ts)")]
47    template_name: String,
48  },
49
50  #[command(alias = "t", about = "Manage templates")]
51  Template {
52    #[command(subcommand)]
53    command: TemplateCommands,
54  },
55
56  #[command(alias = "in", about = "Log in to your Oxide account")]
57  Login,
58
59  #[command(alias = "out", about = "Log out of your Oxide account")]
60  Logout,
61
62  #[command(
63    alias = "a",
64    about = "Show information about the currently logged-in account"
65  )]
66  Account,
67
68  #[command(about = "Manage addons")]
69  Addon {
70    #[command(subcommand)]
71    command: AddonCommands,
72  },
73
74  #[command(external_subcommand)]
75  External(Vec<String>),
76}