JackBekket / Reflexia

A code which comment and enchance itself
0 stars 2 forks source link

Reflexia

Reflexia is a code summarizer that can be used to generate summaries of code files in a project. It uses a combination of command-line arguments, environment variables, and configuration files to determine how to process the code. The project also includes a helper service that can be used to generate summaries of code snippets.

Project Configuration

The project uses a configuration file to specify the settings for the summarizer. The configuration file can be specified using the -l flag. The configuration file can be in TOML format and contains the following fields:

Summarization Process

The summarization process begins by reading the configuration file and parsing the settings. The project then iterates through the files in the project directory, excluding any files specified in the .gitignore file. For each file, it checks if it matches any of the file filters specified in the configuration file. If a match is found, the file content is read, and a summary is generated using the appropriate prompt from the configuration file. The summaries are then stored in a map, where the key is the relative path to the file, and the value is the generated summary.

Output

The project generates several output files:

The project also has the option to create a README file for each package in the project, as well as to overwrite the existing README file in the root project directory.

Edge Cases

The project has several edge cases that can be handled using command-line arguments:

Environment Variables

The project uses the following environment variables:

Run Instructions

  1. Make sure you have the necessary dependencies installed.
  2. Create a configuration file in TOML format and specify the settings for the summarizer.
  3. Run the project with the desired command-line arguments and environment variables.

Example

reflexia -l config.toml -c -s -r -p -br -f -bp

This command will run the Reflexia project using the configuration file config.toml, exclude project root folder specific files, not create SUMMARY.md and README.md, not create README.md for every package in the project, overwrite README.md for the root project directory instead of creating README_GENERATED.md, save individual file summary intermediate result to the FILES.md, and create README_GENERATED.md if README.md exists in the package directory instead of overwriting.

./reflexia -l go.toml -f -d  -g https://github.com/JackBekket/Hellper

This command will start to autodocumentize -g repository (public), it will create README_GENERATED.MD and create summary for all files