This script uses OpenAI to generate a comprehensive README file by analyzing a given code. The README includes an overview section, installation instructions, usage instructions, additional notes or warnings, and a brief section on how to contribute to the script.
Before running this script, make sure your OpenAI API key is correctly set in your environment variables.
To install the necessary dependencies, run the following command:
pip install openai
To use this script, run the following command in your terminal:
python auto-readme.py <path_to_code_file>
Replace <path_to_code_file>
with the path to the code file that you want to analyze.
- The OpenAI API key needs to be provided as an environment variable
OPENAI_API_KEY
. - You will be prompted to provide feedback on the generated README. If the README is acceptable, it will be saved as
README.md
in the current directory. - If the OpenAI API returns an empty response, please try running the script again.
If you would like to contribute to the script, you can follow these steps:
- Fork the repository.
- Create a new branch for your changes.
- Make your changes and test them thoroughly.
- Submit a pull request describing the changes you made.
Please note that all contributions are welcome, but they will be reviewed before they are merged into the main codebase.
Note: Make sure to replace <path_to_code_file>
in the usage instructions with the actual path to the code file you want to analyze.