Use these recipes when you already have a CLI command and want to move it to Milo's typed function contract. Each page shows a small before/after and the specific concepts to translate.
Migration Rule
Move behavior first, then output polish:
- Convert one command handler into a typed Python function.
- Register it with
@cli.command. - Add docstring
Args:entries orAnnotated[..., Description(...)]. - Run
uv run milo verify app.py. - Add the four command contract tests before migrating the next command.
Keep old CLI compatibility wrappers only where users depend on exact argv shape. Milo's main contract is the function signature; schema, MCP, and llms.txt are derived from that signature.
Recipes
The mature-CLI guide adds the inventory, phased cutover, output/exit contract, agent-surface allowlist, exact-version canary, and downstream release policy needed when preserving an established command tree.