robin/cli/
commands.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser)]
4#[command(author, version, about)]
5pub struct Cli {
6    #[command(subcommand)]
7    pub command: Option<Commands>,
8
9    /// List all available commands
10    #[arg(short, long)]
11    pub list: bool,
12
13    /// Interactive mode
14    #[arg(short, long)]
15    pub interactive: bool,
16
17    /// Send system notification when command completes
18    #[arg(long)]
19    pub notify: bool,
20}
21
22#[derive(Subcommand)]
23pub enum Commands {
24    /// Initialize a new .robin.json file
25    Init {
26        /// Template to use (android, ios, flutter, rails, node, python, rust, go)
27        #[arg(long)]
28        template: Option<String>,
29    },
30    
31    /// Add a new command
32    Add {
33        /// Command name
34        name: String,
35        /// Command script
36        script: String,
37    },
38
39    /// Check development environment setup
40    Doctor,
41
42    /// Update development tools to their latest versions
43    DoctorUpdate,
44
45    /// Run a script
46    #[command(external_subcommand)]
47    Run(Vec<String>),
48}