docs: add CLI reference page and remove CLI from API docs (#704)#852
Open
planetf1 wants to merge 7 commits intogenerative-computing:mainfrom
Open
docs: add CLI reference page and remove CLI from API docs (#704)#852planetf1 wants to merge 7 commits intogenerative-computing:mainfrom
planetf1 wants to merge 7 commits intogenerative-computing:mainfrom
Conversation
…-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
Contributor
|
The PR description has been updated. Please fill out the template for your PR to be reviewed. |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?