1use clap::{Parser, Subcommand};
7use std::path::PathBuf;
8
9use crate::commands::{
11 AddCommand, AuthCommand, BuildCommand, ConfigCommand, DevArgs, DiagnosticsArgs, FormatArgs, InitArgs, LintArgs,
12 LogsArgs, ModelsCommand, NodeArgs, RemoteCommand, RunCommand, SetupArgs, TopicsCommand, TopologyArgs, UploadArgs,
13};
14
15#[derive(Parser)]
16#[command(name = "mecha10")]
17#[command(about = "Mecha10 CLI - Build autonomous robots with RL", long_about = None)]
18#[command(version)]
19pub struct Cli {
20 #[arg(short, long, default_value = "info", global = true)]
22 pub log_level: String,
23
24 #[arg(short, long, global = true)]
26 pub config: Option<PathBuf>,
27
28 #[command(subcommand)]
29 pub command: Commands,
30}
31
32#[derive(Subcommand)]
33pub enum Commands {
34 Add {
36 #[command(subcommand)]
37 command: AddCommand,
38 },
39
40 Auth {
42 #[command(subcommand)]
43 command: AuthCommand,
44 },
45
46 Build {
48 #[command(subcommand)]
49 command: BuildCommand,
50 },
51
52 Config {
54 #[command(subcommand)]
55 command: ConfigCommand,
56 },
57
58 Dev(#[command(flatten)] DevArgs),
60
61 Diagnostics(#[command(flatten)] DiagnosticsArgs),
63
64 Format(#[command(flatten)] FormatArgs),
66
67 Init(#[command(flatten)] InitArgs),
69
70 Lint(#[command(flatten)] LintArgs),
72
73 Logs(#[command(flatten)] LogsArgs),
75
76 Models {
78 #[command(subcommand)]
79 command: ModelsCommand,
80 },
81
82 #[command(hide = true)]
84 Node(#[command(flatten)] NodeArgs),
85
86 Remote {
88 #[command(subcommand)]
89 command: RemoteCommand,
90 },
91
92 Run {
94 #[command(subcommand)]
95 command: RunCommand,
96 },
97
98 Setup(#[command(flatten)] SetupArgs),
100
101 Status,
103
104 Topics {
106 #[command(subcommand)]
107 command: TopicsCommand,
108 },
109
110 Topology(#[command(flatten)] TopologyArgs),
112
113 Upload(#[command(flatten)] UploadArgs),
115}