Detailed guides for each part of the Milo framework. Start with State to understand the core architecture, then explore the features you need.
flowchart TB
subgraph Core
Store[Store]
Reducer[Reducers]
Middleware[Middleware]
end
subgraph UI
Templates[Kida Templates]
Forms[Forms]
Input[KeyReader]
end
subgraph Effects
Sagas[Sagas]
ThreadPool[ThreadPoolExecutor]
end
subgraph Multi-Screen
Flow[Flow]
Screens[FlowScreens]
Navigate[@@NAVIGATE]
end
subgraph AI["AI Integration"]
MCP[MCP Server]
Gateway[Gateway]
LLMS[llms.txt]
end
Input -->|"@@KEY"| Store
Store --> Reducer
Reducer -->|state| Templates
Reducer -->|ReducerResult| Sagas
Sagas --> ThreadPool
ThreadPool -->|"Put(action)"| Store
Flow --> Screens
Screens --> Reducer
Navigate --> Flow
Middleware -->|wraps| Store
Forms -->|form_reducer| Reducer
MCP -->|"tools/call"| Reducer
Gateway -->|proxies| MCP
State Management
Redux-style Store with dispatch, listeners, middleware, and saga scheduling.
Sagas
Generator-based side effects with Call, Put, Select, Fork, and Delay.
Commands
Lightweight Cmd thunks, Batch, Sequence, TickCmd, and ViewState for simple side effects.
Multi-Screen Flows
Declarative multi-screen state machines with the >> operator.
Interactive Forms
Text, select, confirm, and password fields with validation and TTY fallback.
CLI & Commands
AI-native CLI with typed commands, automatic argparse, MCP tools, and llms.txt.
Input Handling
Cross-platform key reader with full escape sequence support.
Output Formatting
Structured output with plain, JSON, table, and template formats.
Command Groups
Nested command groups for hierarchical CLI structures.
Context & Global Options
Execution context with verbosity levels, output format, and custom global options.
Lazy Loading
Deferred command imports for fast CLI startup with large command sets.
Configuration
Configuration system with TOML/YAML/JSON loading, deep merge, profiles, and origin tracking.
Templates
Kida-powered terminal rendering with built-in form, field, help, and progress templates.
Pipeline Orchestration
Declarative build pipelines with phases, dependency graphs, and Store integration.
Dev Server
Hot-reload dev server with filesystem polling and @@HOT_RELOAD dispatch.
Plugins & Hooks
Hook registry with named extension points, listeners, and Store middleware.
MCP Server
Expose CLI commands as MCP tools, register CLIs for discovery, and run a unified gateway.
llms.txt Generation
Generate AI discovery documents from CLI command definitions.
Testing
Snapshot testing, session recording, replay, and deterministic assertions.
Help Rendering
Drop-in argparse HelpFormatter using Kida templates.