1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Config command arguments
//!
//! Commands for managing robot configurations independently of binary uploads.
use clap::{Args, Subcommand};
use std::path::PathBuf;
/// Config subcommands
#[derive(Subcommand)]
pub enum ConfigCommand {
/// Push local configs to the robot-config service
Push(#[command(flatten)] ConfigPushArgs),
/// Pull configs from the robot-config service to local project
Pull(#[command(flatten)] ConfigPullArgs),
/// List all configs for a robot
List(#[command(flatten)] ConfigListArgs),
/// Show resolved project identity and config paths (project name, robot ID,
/// control plane URL, login status) — useful for confirming a project's
/// identity matches its robot's launcher config.
Show,
/// Validate mecha10.json and every node config it references (or a single
/// arbitrary config file with --path). This is the one command hooks/CI/build
/// all shell out to for config validation — see docs/validate-configs.md.
Validate(#[command(flatten)] ConfigValidateArgs),
}
/// Arguments for config validate command
#[derive(Args)]
pub struct ConfigValidateArgs {
/// Validate a single arbitrary config file instead of the whole project.
/// The kind (project config vs. node config) is auto-detected. Useful for
/// a git hook validating only the files staged in a commit.
#[arg(long)]
pub path: Option<PathBuf>,
}
/// Arguments for config push command
#[derive(Args)]
pub struct ConfigPushArgs {
/// Path to configs directory (default: dist/configs or configs/)
#[arg(short, long)]
pub path: Option<PathBuf>,
/// Robot ID to push configs for (default: from mecha10.json)
#[arg(short, long)]
pub robot_id: Option<String>,
/// Show what would be pushed without actually pushing
#[arg(long)]
pub dry_run: bool,
}
/// Arguments for config pull command
#[derive(Args)]
pub struct ConfigPullArgs {
/// Output directory for configs (default: configs/)
#[arg(short, long)]
pub output: Option<PathBuf>,
/// Robot ID to pull configs for (default: from mecha10.json)
#[arg(short, long)]
pub robot_id: Option<String>,
/// Overwrite existing config files
#[arg(long)]
pub force: bool,
}
/// Arguments for config list command
#[derive(Args)]
pub struct ConfigListArgs {
/// Robot ID to list configs for (default: from mecha10.json)
#[arg(short, long)]
pub robot_id: Option<String>,
/// Show full config values (not just keys)
#[arg(short, long)]
pub verbose: bool,
}