# Build CLIs

URL: /milo-cli/docs/build-clis/
Section: build-clis
Description: Build typed command-line tools that also expose MCP tools and llms.txt discovery.

---

> For a complete page index, fetch /milo-cli/llms.txt.

Build human-facing commands and agent-facing tools from the same typed Python
functions. Start with commands and groups, then add schemas, context, output
formatting, llms.txt, and MCP.

Commands

Register typed command handlers and run them from argv

(./commands/)

Groups

Organize commands into nested namespaces

(./groups/)

Context and Output

Use injected context, global options, and structured returns

(./context/)

MCP Server

Expose commands as MCP tools and run the gateway

(./mcp/)

CLI & Commands

AI-native CLI with typed commands, automatic argparse, MCP tools, and llms.txt.

(/milo-cli/docs/build-clis/commands/)

Output Formatting

Structured output with plain, JSON, table, and template formats.

(/milo-cli/docs/build-clis/output/)

Command Groups

Nested command groups for hierarchical CLI structures.

(/milo-cli/docs/build-clis/groups/)

Context & Global Options

Execution context with verbosity levels, output format, and custom global options.

(/milo-cli/docs/build-clis/context/)

Lazy Loading

Deferred command imports for fast CLI startup with large command sets.

(/milo-cli/docs/build-clis/lazy/)

MCP Server

Expose CLI commands as MCP tools, register CLIs for discovery, and run a unified gateway.

(/milo-cli/docs/build-clis/mcp/)

llms.txt Generation

Generate AI discovery documents from CLI command definitions.

(/milo-cli/docs/build-clis/llms/)

Help Rendering

Drop-in argparse HelpFormatter using Kida templates.

(/milo-cli/docs/build-clis/help/)

## In This Section

CLI & Commands (/milo-cli/docs/build-clis/commands/)

AI-native CLI with typed commands, automatic argparse, MCP tools, and llms.txt.

Command Groups (/milo-cli/docs/build-clis/groups/)

Nested command groups for hierarchical CLI structures.

Context & Global Options (/milo-cli/docs/build-clis/context/)

Execution context with verbosity levels, output format, and custom global options.

Help Rendering (/milo-cli/docs/build-clis/help/)

Drop-in argparse HelpFormatter using Kida templates.

Lazy Loading (/milo-cli/docs/build-clis/lazy/)

Deferred command imports for fast CLI startup with large command sets.

llms.txt Generation (/milo-cli/docs/build-clis/llms/)

Generate AI discovery documents from CLI command definitions.

MCP Server (/milo-cli/docs/build-clis/mcp/)

Expose CLI commands as MCP tools, register CLIs for discovery, and run a unified gateway.

Output Formatting (/milo-cli/docs/build-clis/output/)

Structured output with plain, JSON, table, and template formats.

Related Pages

Dispatch Contract (/milo-cli/docs/reference/dispatch/)

How CLI, programmatic, and MCP command calls agree.

Related

Quickstart (/milo-cli/docs/get-started/quickstart/)

Build a typed CLI command that also works as an MCP tool.

Related

From Python Fire (/milo-cli/docs/get-started/migrate-existing-cli/from-fire/)

Narrow automatic Python object exposure into explicit Milo command contracts.

Related

cli (/milo-cli/tags/cli/)

commands (/milo-cli/tags/commands/)
