# llms

URL: /milo-cli/api/milo/llms/
Section: milo
Description: llms.txt generation from CLI command definitions.

---

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

Open LLM text
(/milo-cli/api/milo/llms/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fllms%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fllms%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fllms%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fllms%2Findex.txt)

Module

#
`llms`

llms.txt generation from CLI command definitions.

4Functions

## 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]`
