Milo API Reference

Browse Python API documentation by package.

Packages

Modules

_cells

Terminal display-cell width helpers. Python string length counts code points, but terminals lay text out in...

_child

Persistent child process for MCP gateway communication.

_cli_help

Markdown help generation for CLI command trees.

_command_defs

Command definition types and helpers.

_compat

Cross-platform compatibility helpers.

_errors

Structured error hierarchy with format_compact() for terminal display.

_jsonrpc

Shared JSON-RPC output helpers for mcp.py and gateway.py.

_mcp_router

Shared MCP method dispatch for leaf servers and gateway.

_protocols

Protocols — stdlib/typing only, no internal imports.

_types

Frozen dataclasses, enums, and type aliases — no internal imports.

app

App event loop and terminal rendering.

cli

CLI entry point — milo dev, milo replay.

commands

CLI application with command decorator and dispatch.

completions

Shell completion generation for bash, zsh, fish, and PowerShell.

components_cli

`milo components` — discover bundled and user-defined template components.

config

Configuration system with deep merge, environment overlays, and origin tracking.

context

Execution context for CLI command handlers.

dev

Hot-reload dev server with smart file watching.

doctor

Built-in diagnostic command for CLI health checks.

flow

Declarative screen state machine with >> operator.

form

Form fields and form reducer.

gateway

Milo MCP gateway — one MCP server that proxies to all registered CLIs.

groups

Nestable command groups for hierarchical CLI structures.

help

HelpRenderer — argparse formatter_class for styled help output.

live

Live-rendering primitives for non-event-loop use. Re-exports from `kida.terminal`.

llms

llms.txt generation from CLI command definitions.

mcp

MCP server — expose CLI commands as tools via JSON-RPC on stdin/stdout.

middleware

Middleware stack for MCP and CLI call interception.

milo

Milo — Template-driven CLI applications for free-threaded Python.

observability

Observability for MCP requests — logging, stats, correlation IDs.

output

Structured output formatting for CLI commands.

pipeline

Pipeline orchestration with observable state through the Store/saga system.

plugins

Plugin system with hook registry and Store middleware integration.

reducers

Composable reducer combinators for common interaction patterns.

registry

Milo CLI registry — tracks installed CLIs for gateway discovery.

schema

Function signature → JSON Schema for MCP tool compatibility.

state

Store, dispatch, saga runner, combine_reducers.

streaming

Streaming support for long-running CLI commands.

templates

Built-in templates and template environment factory.

theme

Theme system for styled CLI output.

verify

Self-diagnosis for agent-built milo CLIs (`milo verify`). Answers "is this CLI correctly built?" via six checks: 1.

version_check

Non-blocking version check with periodic caching.