docs: add CLI reference page and remove CLI from API docs (#704)#852
docs: add CLI reference page and remove CLI from API docs (#704)#852planetf1 merged 11 commits intogenerative-computing:mainfrom
Conversation
|
The PR description has been updated. Please fill out the template for your PR to be reviewed. |
|
Is the "how to test locally" info in AGENTS.md? If not, could you add it? |
psschwei
left a comment
There was a problem hiding this comment.
Content layout — Is the single-page format with all commands right for the CLI's size, or should individual commands have their own pages?
Navigation — The CLI reference sits under Docs > Reference (alongside the glossary). The API Reference has its own top-level tab. Is this placement correct, or should the CLI reference live elsewhere?
My two cents: I would put CLI reference in its own section and have each command be its own page. But it's not a strong opinion, so ok to go in a different direction too.
Content in general looks good and the page loads, so looks like a good addition.
@psschwei AGENTS.md points to tooling/docs-autogen/README.md where the tooling is described. However that was in need of updating. Doing so now. (I think I did, but lost it in a previous worktree) |
@psschwei That was one option I considered, but it felt like a lot of clicking for a fairly short reference. We do have a nav top right showing sections. Adding a page per command does mean deep-linking is possible (for better or worse)can you fix I figured see what reviewers think and I'll go with consensus. Adding command per page will mean adding some code to update the nav.
|
@serjikibm Updated the docs on build process -- the API docs are also built in CI, so won't appear without running the build. Did you get any errors during the build process? I updated the code docs - See the
I can say it's the 'coded' behaviour... So the 'm serve' is a standalone page in it's own right in the 'regular' documentation, not the reference. It has more detail than an auto-generated reference and existed before Maybe that page should be renamed 'serve your mellea ap as an OpenAI compatible endpoint' -- except a shorter version. the m-serve command ref could point there? Names welcome. But yes, that is in docs section so I would expect the tab to change. |
psschwei
left a comment
There was a problem hiding this comment.
LGTM
I'll approve, we can either have the discussion now or revisit if folks have an opinion once it merges. In theory, we also have some time for folks to chime in before @planetf1 's next work day starts, but in practice ... 😄
|
My suggestion is that if this is a step forward and doesnt make things worse, let's get it in, and then I'd ask reviewers to raise issues on improvements/fixes |
…-computing#704) Remove cli/ from the generated API reference (it's a user tool, not a public Python API) and replace it with an auto-generated CLI Reference page under docs/docs/reference/cli.md. The new generate_cli_reference.py script introspects the Typer app at build time, extracting flags, types, defaults, help strings, and structured docstring sections (Prerequisites, Output, Examples, See Also). Strict mode (--strict) fails the build if any command has incomplete documentation. - Remove "cli" from PACKAGES in generate-ast.py - Remove cli from audit_coverage.py discovery and quality scope - Add generate_cli_reference.py with strict validation - Integrate into build.py (Step 4, --strict) and CI workflow - Add 21 unit tests for the generator (test_cli_reference.py) - Wire docs-autogen tests into docs-publish CI workflow - Enrich all CLI command docstrings with Prerequisites, Output, Examples, and See Also sections - Add cross-links from 5 guide pages back to CLI reference - Add 12 Mintlify redirects for old /api/cli/* URLs - Remove dead m decompose glossary entry - Add CLI docstring convention to CONTRIBUTING.md and AGENTS.md - Add clidocs/clidocs-clean poe tasks
The full tooling/docs-autogen/ test suite has 13 pre-existing failures in test_validate.py, test_escape_mdx.py, and test_anchor_collisions.py. Scope the CI step to test_cli_reference.py to avoid blocking on unrelated failures.
- Fix wrong filename in module docstring (hyphens -> underscores) - Validate before writing file (fail early with --strict) - Add missing redirects for serve/ and fix/ old API pages - Add Examples: section to CONTRIBUTING.md template and rules
- Convert See Also link text from URL slugs to human-readable titles with proper capitalisation (3/3 reviewer consensus) - Remove dead discover_cli_commands() from audit_coverage.py - Switch flag formatting from double to single backticks - Filter --help param from synopsis, options tables, and strict validator - Apply _rst_to_md to root intro text - Simplify test_rst_backticks test now double backticks are gone
- Add clidocs/clidocs-clean to quick start - Add Step 4 (generate_cli_reference.py) to pipeline overview - Add generate_cli_reference.py and test file to file structure - Remove cli/ from generated docs tree, add reference/cli.md - Remove stale Makefile shim reference - Fix make -> poe reference in validate step
Document the install command (matching CI) and Node.js requirement for local doc builds and previews.
generate_cli_reference.py now catches ImportError during CLI app import and prints the required install command instead of a raw traceback.
- Correct apidocs intro: build.py now runs 4 steps, not 2 - Document --strict distinction: clidocs is lenient, apidocs pipeline is always strict; add standalone --strict invocation example - Add CLI reference generator configuration section (--strict, --docs-root, --source-dir, --skip-cli-reference) - Document that full clean requires apidocs-clean + clidocs-clean - Add test_cli_reference.py to Development examples - Replace stale `make docs` references with `uv run poe apidocs`
- Pipeline Overview: replace validate.py (step 3) with the actual build.py step 3 (generate-ast.py --nav-only); move validate.py to an "optional tools" section below the diagram - AGENTS.md: add test command and link to docs-autogen README so the full local testing workflow is traceable from the agent guide
- Prerequisites: document node@22 PATH override for systems running node v25+ (mintlify dev rejects non-LTS versions) - Troubleshooting: add entries for node version error and API Reference tab 404 (generated artefacts must be built first)
|
rebased due to conflicts |
|
Ok. merging. please raise any followups as new issues. |
64e49d7


Type of PR
Description
Objective
The
cli/package was included in the generated API reference docs, which is wrong — it's a user-facing tool, not a public Python API. Simultaneously, there was no single CLI reference; coverage was scattered across guide pages. This PR removes CLI internals from the API docs and adds a proper, auto-generated CLI reference page.What the CLI reference looks like
A single page at Docs > Reference > CLI Reference documenting all
msubcommands (serve,alora,decompose,eval,fix). Each command section includes:All content is sourced from the Python source code — Typer metadata (
help=strings, types, defaults) plus structured docstring sections (Prerequisites:,Output:,Examples:,See Also:). Output is standard Markdown, portable across doc frameworks.CLI Reference - Mellea.pdf
How it is built and validated
Generation pipeline:
tooling/docs-autogen/generate_cli_reference.pyimports the Typer app, converts it to its underlying Click model viatyper.main.get_command(), walks the command tree, and emitsdocs/docs/reference/cli.md.build.pyas Step 4, runs with--strictflag.--strictvalidates before writing — fails the build if any command is missing a summary,Prerequisites:,Output:section, or has options withouthelp=text. No incomplete output is produced.uv run poe clidocs.CI enforcement:
docs-publish.ymlrunsbuild.pywhich now includes strict CLI reference generation.markdownlintcovers the generated page (it lands indocs/docs/reference/).SEO: 17 Mintlify redirects for old
/api/cli/*URLs (all submodules includingserve/andfix/).Changes
generate-ast.pyPACKAGES,audit_coverage.pydiscovery/quality scope, deaddiscover_cli_commands()removedgenerate_cli_reference.py— Typer introspection,--strictvalidation, proper title-cased See Also links,--helpfiltered from output, friendly error on missing extrastest_cli_reference.py— 21 testsbuild.pyStep 4,pyproject.tomlpoe tasks,.gitignoredocs-publish.yml— CLI reference test stepPrerequisites:,Output:,Examples:,See Also:/api/cli/*URLs →/reference/cliCONTRIBUTING.mdCLI docstring convention (includingExamples:),AGENTS.mdcoding standardsm decomposeentry (CLI reference now covers it)Testing
tooling/docs-autogen/test_cli_reference.py)--strictflag)markdownlintclean on generated outputHow to test locally
Full details in
tooling/docs-autogen/README.md.Key pages to verify:
/reference/cli— all commands, flags, examples, cross-linksclientries should remain/guide/m-decompose,/integrations/m-serve,/advanced/lora-and-alora-adapters,/evaluation-and-observability/evaluate-with-llm-as-a-judge,/how-to/refactor-prompts-with-cli/api/cli/mshould redirect to/reference/cliQuestions for reviewers
--strictCI enforcement. Does this approach make sense for keeping docs in sync with minimal overhead?