Skip to content

feat(docs): add CLI reference documentation generator#245

Closed
ssh-esh wants to merge 6 commits into
mainfrom
docs-part1
Closed

feat(docs): add CLI reference documentation generator#245
ssh-esh wants to merge 6 commits into
mainfrom
docs-part1

Conversation

@ssh-esh
Copy link
Copy Markdown
Contributor

@ssh-esh ssh-esh commented Apr 28, 2026

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 extractor
  • scripts/generate-docs.ts: orchestrates generation: builds the full program, extracts schemas, writes Markdown reference pages and per-command JSON Schema files to docs/reference/
  • npm run docs:generate / npm run docs:check — generate docs or verify all commands have descriptions
  • CI docs-check job: verifies docs generate without errors, committed docs are up-to-date (git diff), and all commands have descriptions

JSON 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 test passes (24 new tests for doc-generator)
  • npm run docs:generate produces docs without errors
  • npm run docs:check reports all commands have descriptions
  • Regenerating docs produces no diff (freshness check)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 1 0 0 0.11s
✅ COPYPASTE jscpd yes no no 5.21s
✅ REPOSITORY gitleaks yes no no 86.58s
✅ REPOSITORY git_diff yes no no 0.31s
✅ REPOSITORY secretlint yes no no 14.22s
✅ REPOSITORY trivy yes no no 24.42s
✅ TYPESCRIPT eslint 3 0 0 4.49s
✅ YAML yamllint 1 0 0 0.85s

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@ssh-esh ssh-esh changed the title Docs part1 feat(docs): add CLI reference documentation generator Apr 28, 2026
@ssh-esh ssh-esh marked this pull request as ready for review April 28, 2026 16:06
@ssh-esh ssh-esh requested review from JoshMock, MattDevy and margaretjgu and removed request for JoshMock April 28, 2026 16:06
@JoshMock JoshMock self-assigned this Apr 30, 2026
@JoshMock
Copy link
Copy Markdown
Member

JoshMock commented May 1, 2026

Closing in favor of #264

@JoshMock JoshMock closed this May 1, 2026
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.

2 participants