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
Groups
Organize commands into nested namespaces
Context and Output
Use injected context, global options, and structured returns
MCP Server
Expose commands as MCP tools and run the gateway
CLI & Commands
AI-native CLI with typed commands, automatic argparse, MCP tools, and llms.txt.
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.
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.
Help Rendering
Drop-in argparse HelpFormatter using Kida templates.
In This Section
CLI & Commands
AI-native CLI with typed commands, automatic argparse, MCP tools, and llms.txt.
Command Groups
Nested command groups for hierarchical CLI structures.
Context & Global Options
Execution context with verbosity levels, output format, and custom global options.
Help Rendering
Drop-in argparse HelpFormatter using Kida templates.
Lazy Loading
Deferred command imports for fast CLI startup with large command sets.
llms.txt Generation
Generate AI discovery documents from CLI command definitions.
MCP Server
Expose CLI commands as MCP tools, register CLIs for discovery, and run a unified gateway.
Output Formatting
Structured output with plain, JSON, table, and template formats.
Related Pages
Dispatch Contract
How CLI, programmatic, and MCP command calls agree.
Quickstart
Build a typed CLI command that also works as an MCP tool.
From Python Fire
Narrow automatic Python object exposure into explicit Milo command contracts.