feat(docs): add CLI reference documentation generator#245
Closed
ssh-esh wants to merge 6 commits into
Closed
Conversation
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts MegaLinter is graciously provided by OX Security |
5 tasks
Member
|
Closing in favor of #264 |
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.
To reviewers: This is a large PR. It's best to review by commit. The last commit adds all the generated files (Markdown docs + JSON schemas). All preceding commits contain the feature logic and tests.
Closes https://github.com/elastic/agentic-interface-program/issues/54
Adds automatic CLI reference documentation generation from the command tree.
src/lib/doc-generator.ts: walks the Commander command tree and extracts structured metadata (options, args, aliases) into plain objects, with a Markdown renderer and JSON Schema extractorscripts/generate-docs.ts: orchestrates generation: builds the full program, extracts schemas, writes Markdown reference pages and per-command JSON Schema files todocs/reference/npm run docs:generate/npm run docs:check— generate docs or verify all commands have descriptionsdocs-checkjob: verifies docs generate without errors, committed docs are up-to-date (git diff), and all commands have descriptionsJSON Schema files are generated per leaf command (empty schemas filtered out per review feedback). Each command's Markdown section links to its schema file for machine consumption.
Follow-up: man page generation tracked in elastic/agentic-interface-program#83.
Test plan
npm testpasses (24 new tests for doc-generator)npm run docs:generateproduces docs without errorsnpm run docs:checkreports all commands have descriptions