Skip to content

Conversation

@ereslibre
Copy link
Collaborator

This PR introduces a new documentation generation system for the Rover CLI by creating a dedicated command-reference binary that automatically generates markdown documentation from the CLI command definitions.

The refactoring extracts the program creation logic into a reusable function that can be used both by the main CLI and documentation utilities, enabling automated documentation generation without runtime side effects.

Changes

  • Created command-reference.ts as a new binary for generating CLI documentation
  • Extracted CLI program creation logic into lib/program.ts with createProgram() function
  • Added support for excluding runtime hooks during documentation generation via excludeRuntimeHooks option
  • Updated package.json to include command-reference binary in the CLI package
  • Modified build configuration in tsdown.config.ts to build both entry points
  • Updated npm scripts to build all entry points with simplified tsdown command

Notes

The new documentation generation system provides a foundation for maintaining up-to-date CLI reference documentation that stays synchronized with the actual command definitions. The modular approach ensures the documentation generator can introspect the command structure without triggering validation hooks that require a git repository context.

@ereslibre ereslibre self-assigned this Sep 18, 2025
@ereslibre
Copy link
Collaborator Author

Used by https://github.com/endorhq/docs/issues/20 to generate the command reference.

@ereslibre ereslibre marked this pull request as draft September 18, 2025 09:44
@ereslibre
Copy link
Collaborator Author

Converting to draft as there are a couple of TS issues.

@ereslibre
Copy link
Collaborator Author

@Angelmmiguel this binary should not be part of the "official release", is just a way for us to generate the documentation in an automated way (it has some hardcoded things, but we should make it completely generic, not right now).

Not sure how to do the "this should not be part of the official release" bit.

@ereslibre ereslibre marked this pull request as ready for review September 18, 2025 09:51
Copy link
Contributor

@Angelmmiguel Angelmmiguel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is pretty cool as it automates the docs generation. However, I prefer to keep a strict separation between source code (end users) and internal tools. My comments are all in that direction, but I really like this idea for generating our docs!

@ereslibre ereslibre force-pushed the rover/task-43-lYPFt8cIVJJt branch from 0028947 to cebe483 Compare September 23, 2025 06:57
@ereslibre ereslibre force-pushed the rover/task-43-lYPFt8cIVJJt branch from d353490 to d2baba5 Compare September 23, 2025 09:29
Copy link
Contributor

@Angelmmiguel Angelmmiguel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Added a minor comment, but approving in advance

@ereslibre ereslibre merged commit e2ab785 into main Sep 24, 2025
4 checks passed
@ereslibre ereslibre deleted the rover/task-43-lYPFt8cIVJJt branch September 24, 2025 15:51
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.

3 participants