src
The repo-guide/src
directory serves as the root for the source code of the repo-guide
tool.
The key subdirectory within this directory is repo_guide
, which contains the core application logic. This includes the command-line interface definition and the documentation generation processes.
The entry point is repo_guide/__main__.py
, which calls the cli
function defined in repo_guide/cli.py
.
repo_guide/cli.py
defines the command-line interface using the click
library. The DocGenerator
class within this file manages the documentation generation process. This includes crawling the input directory, filtering files, constructing prompts for the LLM, generating documentation, writing the generated documentation to the output directory, and creating a basic mkdocs.yml
configuration file. The _build_prompt
method constructs an XML prompt containing directory structure and file contents to send to the LLM. The cli
function orchestrates parsing command-line arguments, initializing the DocGenerator
, generating the documentation, and optionally starting a local documentation server, and building/deploying the static site to GitHub Pages.