# Live2D Cubism CLI Harness ## Architecture This CLI harness provides command-line access to Live2D Cubism model files (.model3.json, .moc3, .motion3.json, .exp3.json, etc.) without requiring the Live2D Cubism Editor or runtime. ### What it does - **Inspect** — Parse .model3.json and display model structure - **Validate** — Check all referenced files exist - **Edit** — Modify motions, expressions, textures, and model references - **Lint** — Best practice checks (naming, texture sizes, structure) - **Batch** — Edit multiple models at once - **Diff** — Detailed comparison at field/motion/expression level - **Preview** — Generate HTML preview of a model - **Watch** — Auto-validate on file changes - **Atlas** — Texture atlas analysis (merge/split suggestions) - **Migrate** — Model format version upgrades - **Undo** — Auto-backup before edits, with rollback support - **Scan** — Batch-discover models in a directory tree - **Export** — Output model summary as JSON or CSV - **Orphan** — Find unreferenced files - **Manifest** — File inventory with checksums - **Runtime** — Compatibility checks for Cubism Viewer, Web SDK, Yoyo - **Flatten** — Flatten directory for deployment ### File format reference | File type | Extension | Purpose | |-----------|-----------|---------| | Model data | `.moc3` | Binary model mesh + rig | | Textures | `.png` | Character artwork layers | | Physics | `.physics3.json` | Hair/clothing simulation | | Pose | `.pose3.json` | Part switching | | Motion | `.motion3.json` | Animation keyframes | | Expression | `.exp3.json` | Expression presets | | UserData | `.userdata3.json` | Custom metadata | | DisplayInfo | `.cdi3.json` | Parameter display names | ### Dependencies - Python 3.10+ - Click 8.1+ ## Commands (42 total) ### Read ```bash inspect # Model overview validate [--strict] # Check files exist motions [-g group] # List motions motion-info # Motion analysis expressions # List expressions expr-info # Expression analysis textures # List textures with sizes physics # Physics config moc3 # Moc3 binary info params # Parameter groups param-list # All params across motions/expressions deps # Dependency graph compare # Quick comparison diff # Detailed diff scan [-v] # Find all models export [--format] # Export as JSON/CSV stats # Project overview manifest # File inventory with checksums ``` ### Edit (auto-backup) ```bash edit-motion -g -i [--fade-in/--fade-out/--file] add-motion -g --file rm-motion -g -i add-expr -n -f rm-expr -n edit-texture -i --path edit-model [--moc3/--physics/--pose/--userdata] param-edit -p -v rename-group --old --new find-replace -f -r [--dry-run] ``` ### Generation ```bash init [--dir] # Full model template gen-motion [--duration/--fps/--loop/--out] gen-expr [--fade-in/--fade-out/--out] ``` ### Analysis ```bash lint [--level] # Best practice checks runtime-check [--target cubism-viewer|web-sdk|yoyo|all] atlas [--merge/--split/--max-size] orphan # Find unreferenced files ``` ### Workflow ```bash undo [--list/--backup] backup-clean [--keep/--dry-run] restore-file --file batch [--set-fade-in/--set-fade-out/--add-motion-*/--add-expr-*/--set-moc3/--dry-run] snapshot [--embed/--out] watch [--interval] flatten --out-dir [--dry-run] migrate [--target-version/--dry-run] pack -o yoyo-check ``` ### Global ```bash --json # JSON output (any command) --version # Show version ```