Skip to content

aramperes/readit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This README was generated using readit. It may not be accurate.

ReadIt

GitHub license GitHub issues GitHub issues closed

Introduction

ReadIt is a Node.js script that automatically generates README files for Github repositories, summarizing the code using the OpenAI API. By using this package, developers can save time writing a README file from scratch, ensuring a consistent structure and decreasing the probability of missing important details. A well-written README file can help other developers use the code, learn how to contribute, and even encourage people to support the project.

Installation

To use ReadIt, follow these steps:

  1. Clone the repository: git clone https://github.com/aramperes/readit.git
  2. Install dependencies: npm install
  3. Create a .env file in the root directory, containing your OpenAI API Key:
OPENAI_API_KEY=<your API key>
  1. Run the script with the desired arguments:
node . <path to repo> <url of repo> <primary language>

Note that this package requires Node.js and an API key from the OpenAI API.

High-level architecture

The script is executed by running index.js, which imports modules from openai, ./lib, and ./lib/prompt.js. It then reads the command line arguments, creates an instance of the OpenAI API, and defines the function createReadme, which performs the core functionality of generating a README for a repository.

Firstly, createReadme uses the readSourceFiles function from ./lib/source.js to read the source code of a repository and returns a collection of SourceBag objects containing the code. Then, the function generates prompts using the codeSummaryPrompt and readmePrompt functions from ./lib/prompt.js. The prompts are then used to generate summaries of the code using the OpenAI API.

Finally, createReadme generates the final README by combining the prompts and the response generated by the OpenAI API. It does this by first creating a default prompt and then appending prompts for each file in the repository. The response generated by the OpenAI API is then appended, resulting in the final README.

How to contribute

If you find any issues with the package or would like to contribute, feel free to submit an issue or a pull request on the GitHub repository page. All contributions are welcome and greatly appreciated!

License

ReadIt is open source and available under the MIT License. Please see the LICENSE file for more information.

About

README generation using GPT-3.5

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published