# Migrate Existing CLIs URL: /milo-cli/docs/get-started/migrate-existing-cli/ Section: migrate-existing-cli Tags: migration, cli -------------------------------------------------------------------------------- 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. Terminal From argparse Replace parser-first argparse code with typed Milo command handlers. Terminal From Click Translate Click command decorators, options, groups, and context into Milo. Terminal From Typer Move from type-hint CLI ergonomics to Milo's CLI/MCP/llms.txt contract. From Python Fire Narrow automatic Python object exposure into explicit Milo command contracts. Network From Cobra Map Cobra command trees, flags, and generated app structure into Milo groups. 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 or Annotated[..., 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 From argparse From Click From Typer From Python Fire From Cobra Official References Checked argparse documentation Click commands and groups Typer first steps Python Fire guide Cobra getting started -------------------------------------------------------------------------------- Metadata: - Author: lbliii - Word Count: 201 - Reading Time: 1 minutes