mecha10-cli 4.2.2

Mecha10 CLI tool
Documentation
# Changelog

All notable changes to `mecha10-cli` will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [4.2.2] - 2026-10-26

## [4.2.1] - 2026-10-25

## [4.2.0] - 2026-10-25

## [4.1.0] - 2026-10-25

## [4.0.5] - 2026-10-22

## [4.0.4] - 2026-10-22

## [4.0.3] - 2026-10-22

## [4.0.2] - 2026-10-22

## [4.0.1] - 2026-10-22

## [4.0.0] - 2026-10-21

## [3.0.0] - 2026-10-21

## [2.0.0] - 2026-10-21

## [1.0.0] - 2026-10-21

## [0.10.0] - 2026-10-18

## [0.9.0] - 2026-10-17

## [0.8.2] - 2026-10-17

## [0.8.1] - 2026-10-17

## [0.8.0] - 2026-10-16

## [0.7.0] - 2026-10-15

### Removed

- `mecha10 train --target local` removed - `mecha10 train` now always dispatches remotely via
  mecha10-api/Kestra. Along with it: the `--target` flag itself, `JobDefinition::local_env_vars`,
  and the project-venv/`PATH` Python-interpreter resolution that only existed to spawn
  `rl_task_runner.run` locally.

### Changed

- `resume_run_id` removed from `configs/rl/jobs/*.yml` job definitions - it's a per-invocation
  dispatch value, not a template concern. Pass `mecha10 train --resume-run-id <id>`, or omit it
  to pick interactively from your completed runs - `mecha10 train --target local` now gets the
  same picker remote dispatch already had, instead of requiring a hand-edited job file.
- `tune_run_id` also removed from job definitions, same reasoning. No replacement flag/picker
  yet - `train-from-tune` has no dispatch path today (no scaffolded template, not
  remote-dispatchable); this should be populated by mecha10-api once that flow type actually
  gets one.

## [0.6.5] - 2026-09-26

## [0.6.4] - 2026-09-26

## [0.6.3] - 2026-09-02

## [0.7.0] - 2026-08-15

### Added

- `mecha10 train` command with warm-start/tune resume support (#292)
- Project-level Python dependency preflight gate for `mecha10 dev` (#336)
- Unified CLI model info across origins with eager robot-side artifact delivery (LAB-1808, #333)

### Fixed

- Verified and hardened the aarch64 CC/AR cross-linker fix (#329, #331, #332)
- Resolved model storage collisions and made node-runner source-aware (#327)
- Resolved `mujoco-sim`'s python env, surfaced subprocess failures, added `video-streamer` to simulation mode (#316)
- Kept `websocket-bridge` running when switching into simulation mode (#312)
- Fixed teleop spawn failures not persisting across mode changes, and surfaced node spawn failures during lifecycle mode changes (#305, #311)
- Pinned the actual framework version instead of the literal `"latest"` in `mecha10 add` (#304)
- Fixed dashboard connection-status flicker, hardened robot-control crashes, fixed teleop key warning (#303)
- `ssh://` now used for RL bundle git deps, with fast failure on git auth errors (#335)

### Changed

- Collapsed `mecha10 models` into the `mecha10 model` CLI verb (#337)
- Connected model registry to runtime config (LAB-1777, #293)
- Reconnected node config loading to semantic validation (LAB-1767, #285)
- Added unit tests for CLI handlers build/config/node/remote/upload (LAB-1781, #294)

## [0.6.2] - 2026-08-11

## [0.6.1] - 2026-08-11

## [0.6.0] - 2026-08-10

## [0.5.0] - 2026-08-10

## [0.4.0] - 2026-08-10

## [0.3.2] - 2026-08-09

## [0.3.1] - 2026-07-16

## [0.3.0] - 2026-06-26

## [0.2.6] - 2026-04-15

## [0.2.5] - 2026-04-15

## [0.2.4] - 2026-04-14

## [0.2.3] - 2026-04-14

## [0.2.2] - 2026-04-14

## [0.2.1] - 2026-04-14

## [0.2.0] - 2026-04-14

## [0.1.46] - 2026-01-21

## [0.1.45] - 2026-01-21

## [0.1.44] - 2026-01-15

## [0.1.41] - 2026-01-09

## [0.1.40] - 2026-01-09

## [0.1.39] - 2026-01-09

## [0.1.38] - 2026-01-08

## [0.1.37] - 2026-01-06

## [0.1.36] - 2026-01-06

## [0.1.35] - 2026-01-05

## [0.1.34] - 2026-01-04

## [0.1.33] - 2026-01-04

## [0.1.32] - 2026-01-04

## [0.1.31] - 2026-01-03

## [0.1.30] - 2026-01-02

## [0.1.29] - 2026-01-01

## [0.1.28] - 2026-01-01

## [0.1.27] - 2026-01-01

## [0.1.26] - 2025-12-31

## [0.1.25] - 2025-12-31

## [0.1.24] - 2025-12-30

## [0.1.23] - 2025-12-30

## [0.1.21] - 2025-12-29

## [0.1.20] - 2025-12-28

## [0.1.19] - 2025-12-28

## [0.1.18] - 2025-12-28

## [0.1.17] - 2025-12-27

## [0.1.16] - 2025-12-27

## [0.1.15] - 2025-12-18

### Changed (Branch: p3)

#### Architecture Migration - Complete 3-Layer Pattern
- ✅ **Commands Layer**: All commands converted to pure `clap::Args` structs
  - 31 command files, all <100 lines
  - Zero business logic in command definitions
  - Clean separation of CLI parsing and execution

- ✅ **Handlers Layer**: Complete orchestration refactor
  - 26 handlers implementing the CliContext pattern
  - All handlers use `ctx.service()` accessors
  - Proper UI/UX handling (spinners, progress bars, error messages)
  - No business logic - pure orchestration

- ✅ **Services Layer**: Business logic extraction
  - 12 fully-featured services with comprehensive APIs
  - `DockerService`: Container and compose operations (72 tests)
  - `RedisService`: Redis connection management (32 tests)
  - `ConfigService`: Project configuration (33 tests)
  - `ProjectService`: Project structure and validation (42 tests)
  - `SimulationService`: Godot simulation generation (42 tests)
  - `ProcessService`: Child process management (27 tests)
  - `TemplateService`: Code generation (12 tests)
  - `ComponentCatalogService`: Component discovery (6 tests)
  - `TopicMonitorService`: Redis stream topic monitoring (4 tests) ✨ NEW
  - `DiscoveryService`: Network node discovery
  - `DeploymentService`: Deployment operations
  - `PackageService`: Package management

- ✅ **UI Components Layer**: Reusable terminal UI components
  - `InteractiveMenu`: Terminal-based keyboard navigation (223 lines) ✨ NEW
  - Supports up/down arrows, Enter to select, Esc to cancel
  - Used by topics command, can be reused by other handlers

- ✅ **CliContext**: Unified context pattern
  - Lazy-initialized service accessors
  - Shared configuration across all handlers
  - Environment validation
  - Builder pattern for flexible construction

#### Quality Improvements
- ✅ Zero compilation errors achieved
- ✅ All clippy warnings resolved
- ✅ Comprehensive test coverage (392 tests passing)
- ✅ 70-75% test coverage across services

#### Command Implementations

**Topics Command** - Complete 3-layer refactoring ✨:
- ✅ Migrated from mixed architecture to clean 3-layer separation
- ✅ Created `TopicMonitorService` for Redis stream monitoring
- ✅ Created `InteractiveMenu` UI component for reusable terminal menus
- ✅ Reduced handler from 427→137 lines (-68%)
- ✅ `mecha10 topics list` - Interactive topic browser with real-time monitoring
- ✅ Fully uses CliContext pattern

**Init Command** - Functional but needs refactoring:
- ✅ `mecha10 init` - Complete project scaffolding
- ✅ Interactive wizard for project creation
- ✅ Template support (basic, rover, arm, humanoid)
- ✅ Example node generation (speaker, listener)
- ✅ Development mode with local framework support
- ⚠️ Handler is 1187 lines (needs refactoring)

**Other Commands**:
- ✅ `mecha10 dev` - Development mode with hot-reload
- ✅ `mecha10 build` - Project building
- ✅ `mecha10 run` - Production runtime
- ✅ `mecha10 sim` - Simulation management
- ✅ `mecha10 deploy` - Deployment orchestration
- ✅ `mecha10 logs` - Log viewing
- ✅ `mecha10 status` - Project status
- ✅ `mecha10 clean` - Artifact cleanup
- ✅ `mecha10 quality` - Code quality checks
- ✅ `mecha10 package` - Package operations

### Added
- Library API exports for programmatic use
- Comprehensive rustdoc documentation
- Service module system with clear boundaries
- Handler test utilities
- Context builder with environment precedence

### Technical Debt
See [Architecture: CLI Architecture](https://linear.app/laboratory-one/document/architecture-cli-architecture-317362bc270e) (Linear) for details:
- ❌ `handlers/init.rs`: 1187 lines (HIGH priority - refactoring plan available)
  - Needs extraction to `InitService` and `ProjectTemplateService`
- ✅ `handlers/topics.rs`: RESOLVED - reduced from 427→137 lines (-68%)
- ⚠️ Some services exceed 400-line limit (simulation.rs, process.rs, project.rs, etc.)
- ⚠️ discovery.rs in commands/ contains logic (should be service or removed)
- 📋 Refactoring plans documented with priorities

### Migration Notes
- All commands maintain backward compatibility
- No breaking API changes for end users
- Library exports provide programmatic access
- Comprehensive examples in lib.rs documentation

### Notes
- Not yet published to crates.io
- Currently in active development (branch: p3)
- Breaking changes may occur before 1.0.0
- Architecture now matches documented patterns