book/cli/README.md
This directory contains the refactored, modular CLI for the MLSysBook project. The CLI has been broken down from a monolithic 4000+ line script into maintainable, testable modules.
cli/
├── __init__.py # Package initialization
├── main.py # Main CLI application class
├── core/ # Core functionality
│ ├── config.py # Configuration management
│ └── discovery.py # Chapter/file discovery
├── commands/ # Command implementations
│ └── build.py # Build operations
├── formats/ # Format-specific handlers (future)
└── utils/ # Shared utilities (future)
core/config.py)core/discovery.py)commands/build.py)main.py)The modular CLI has replaced the original binder and is available as ./binder in the project root:
# Show help
./binder help
# Build commands
./binder build # Build full book (HTML)
./binder build intro,ml_systems # Build specific chapters (HTML)
./binder build pdf intro # Build chapter as PDF
./binder build epub # Build full book as EPUB
# Preview commands
./binder preview # Start live dev server for full book
./binder preview intro # Start live dev server for chapter
# Management
./binder list # List all chapters
./binder status # Show current status
./binder doctor # Run comprehensive health check
The modular CLI has successfully replaced the original monolithic binder script:
./binder - Modular CLI (4000+ lines → organized modules)All functionality has been preserved and enhanced:
The modular architecture enables easy addition of:
formats/commands/utils/