mecha10-cli 0.1.47

Mecha10 CLI tool
Documentation
//! 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),
}

/// 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,
}