mecha10-cli 0.6.5

Mecha10 CLI tool
Documentation
//! Run command arguments

use clap::{Args, Subcommand};

/// Run subcommands
#[derive(Subcommand, Debug)]
pub enum RunCommand {
    /// Run robot target (edge/on-robot nodes)
    Robot(RunRobotArgs),

    /// Run remote target (cloud/remote server nodes)
    Remote(RunRemoteArgs),

    /// Run rl target (a trained RL policy in production, excludes the simulator)
    Rl(RunRlArgs),
}

/// Arguments for `run robot`. Always runs the release-profile binary, so there is no
/// `--release`/`-r` flag here.
#[derive(Args, Debug)]
pub struct RunRobotArgs {
    /// Specific nodes to run (comma-separated, default: all target nodes)
    #[arg(short, long)]
    pub nodes: Option<String>,
}

/// Arguments for `run remote`. Always runs docker compose detached (background), so there is no
/// `--release`/`-r` flag here.
#[derive(Args, Debug)]
pub struct RunRemoteArgs {
    /// Specific nodes to run (comma-separated, default: all target nodes)
    #[arg(short, long)]
    pub nodes: Option<String>,
}

/// Arguments for `run rl`. Always runs docker compose detached (background), so there is no
/// `--release`/`-r` flag here.
#[derive(Args, Debug)]
pub struct RunRlArgs {
    /// Specific nodes to run (comma-separated, default: all target nodes)
    #[arg(short, long)]
    pub nodes: Option<String>,

    /// Download-only mode (LAB-2769): download + unpack the robot's latest RL project bundle
    /// (`mecha10 build rl`'s LAB-2767/2768 output) into the working directory, then exit - skips
    /// starting the `rl` target's Docker Compose stack entirely. This is the training-dispatch
    /// path: a Kestra-dispatched trainer host runs this ahead of `rl_task_runner.run` so
    /// `AssetResolver`/`local_config` see the real project's `configs/rl/`/`configs/simulation/`
    /// files instead of whatever's baked into the `mecha10/trainer` image. Requires `--robot-id`.
    #[arg(long)]
    pub download_bundle_only: bool,

    /// Robot ID whose RL project bundle to download. Required (and only meaningful) together with
    /// `--download-bundle-only` - the normal Docker Compose `run rl` path reads the robot ID from
    /// the current project's `mecha10.json` instead, since it always runs from within an
    /// initialized project directory (unlike the trainer host, which starts from a bare image).
    #[arg(long)]
    pub robot_id: Option<String>,
}