Module

llms

llms.txt generation from CLI command definitions.

Functions

generate_llms_txt 1 str
Generate llms.txt content from a CLI's registered commands. Follows the llms.t…
def generate_llms_txt(cli: CLI) -> str

Generate llms.txt content from a CLI's registered commands.

Follows the llms.txt specification (https://llmstxt.org/). Output is a curated Markdown document that helps AI agents discover what the CLI can do. Groups produce nested headings.

Parameters
Name Type Description
cli CLI
Returns
str
_format_group 3 None
Format a command group as a section with nested headings.
def _format_group(group: Group, lines: list[str], depth: int) -> None
Parameters
Name Type Description
group Group
lines list[str]
depth int
_format_command 1 str
Format a single command as an llms.txt entry.
def _format_command(cmd: CommandDef | LazyCommandDef) -> str
Parameters
Name Type Description
cmd CommandDef | LazyCommandDef
Returns
str
_detect_workflows 1 list[str]
Heuristically detect command workflows via output→input parameter overlap.
def _detect_workflows(cli: CLI) -> list[str]
Parameters
Name Type Description
cli CLI
Returns
list[str]