Skip to content

docs(cli): generated agent-discoverable command & flag reference (DRG-483) - #20

Merged
luke-speechify merged 1 commit into
mainfrom
docs/agent-reference
Sep 8, 2026
Merged

docs(cli): generated agent-discoverable command & flag reference (DRG-483)#20
luke-speechify merged 1 commit into
mainfrom
docs/agent-reference

Conversation

@luke-speechify

Copy link
Copy Markdown
Contributor

Adds full, agent-discoverable documentation covering every command and flag — generated from the CLI's own Commander definitions, so it can never drift from what the binary actually accepts.

What ships

  • llms.txt — the llms.txt-standard index (title, summary, links to each command).
  • llms-full.txt — every command and flag inline, in one file.
  • docs/ — one page per command (login, logout, whoami, say, voices, voices list/get, api, mcp, mcp install) plus docs/global-options.md.

Each page has usage, arguments, command-specific options (with defaults, choices, required markers), and subcommand links.

How it's built

  • src/docs/reference.ts walks the Commander tree and renders the docs deterministically (no dates, no version) so a checked-in copy can be diffed.
  • pnpm docs:generate writes the files. A vitest drift guard fails pnpm test when the checked-in copies are stale — and CI runs typecheck/build/test (not lint), so the guard is actually enforced.
  • Extracted a side-effect-free buildProgram() into src/program.ts; both bin.ts and the generator build the same tree.

Small CLI improvement

  • Gave the positional arguments descriptions (say [text], api <endpoint>, voices get [voice-id]) so they now show up in both --help and the generated docs.

Discovery

Context7 already indexes the repo (context7.json), and docs/ + the llms*.txt files are not excluded — so these land in the hosted index for answer engines.

Testing

  • 216 tests pass; drift guard verified (tampering a doc fails the suite).
  • typecheck, biome, and tsup build all clean.

…G-483)

Full docs covering every command and flag, generated from the CLI's own commander
definitions so they can't drift from what the binary accepts.

- `llms.txt` (llms.txt-standard index) + `llms-full.txt` (everything inline) at
  the repo root, and `docs/` with one page per command plus `global-options.md`.
- `src/docs/reference.ts` walks the command tree and renders the docs
  deterministically (no dates/version); `pnpm docs:generate` writes them and a
  vitest drift guard fails `pnpm test` when the checked-in copies are stale (CI
  runs typecheck/build/test, so the guard is enforced there).
- Extract a side-effect-free `buildProgram()` into `src/program.ts` so both the
  entry point and the generator build the same tree; `bin.ts` now imports it.
- Give the positional args (`say [text]`, `api <endpoint>`, `voices get
  [voice-id]`) descriptions so they surface in both `--help` and the docs.
- README: link the reference and document `pnpm docs:generate`.
@luke-speechify
luke-speechify merged commit dcefea2 into main Sep 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant