The WriteGoodComments utility is your clever coding companion that adds a touch of brilliance to your codebase by generating witty comments. Tired of bland comments? Let the magic of OpenAI's language model jazz up your code with comments that stand out!
- ๐งโโ๏ธ AI-Powered Comments: Harness the power of OpenAI's API to create enchanting comments that make your code shine.
- ๐ค Automated Enhancement: Effortlessly enhance your entire codebase with a single command, recursively if desired.
- โ๏ธ Customization: Personalize comment signatures and explore creative realms in code documentation.
-
Clone this repository:
git clone https://github.com/jasonmassey/writegoodcomments.git cd writegoodcomments
-
Make the script executable:
chmod +x writegoodcomments.py
-
Install the required dependencies (assuming you have Python and pip installed):
pip install openai
-
For instructions:
./writegoodcomments.py
-
To generate comments in a specific file:
./writegoodcomments.py your_file.js
-
To enhance JavaScript files:
./writegoodcomments.py *.js
-
To change the comment signature (e.g., to "randy--"):
./writegoodcomments.py -changesig randy-- *.js
-
To recursively enhance all code files in the current directory:
./writegoodcomments.py -r .
The utility prompts you for your OpenAI API key during the first run and stores it in a configuration file for future use. For manual changes, edit the .writegoodcomments
file in your home directory.
This utility was created by @jasonmassey to add a sprinkle of creativity to your code.
WriteGoodComments is intended for fun and educational purposes. It's a cheeky experiment in code commentary and might not always provide accurate or relevant comments. Use responsibly!
This project is not affiliated with OpenAI. It's just a nerdy developer's side project. Enjoy! ๐