Skip to content

AutoDoc-ChatGPT is a Python script that leverages the power of ChatGPT model to automatically generate documentation for any programming language. With AutoDoc-ChatGPT, you can easily generate comprehensive documentation for your codebase.

License

Notifications You must be signed in to change notification settings

HiveMinds/AutoDoc-ChatGPT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoDoc-ChatGPT

AutoDoc-ChatGPT is a Python script that leverages the power of ChatGPT model to automatically generate documentation for any programming language.

With AutoDoc-ChatGPT, you can easily generate comprehensive documentation for your codebase. Simply provide the path to file you wish to document, and AutoDoc-ChatGPT will generate a detailed description of its functionality, parameters, and return values in natural language.

Getting Started

Installing

Clone this repository to your local machine:

git clone https://github.com/awekrx/AutoDoc-ChatGPT.git

Then install the required packages:

pip install -r requirements.txt

Supported programming languages

discaimer: TypeScript has some bugs and is under testing

Usage

Edit config

Open config.ini and add email and password there if you are not using OAuth authorization. Otherwise open ChatGPT and get the __Secure-next-auth.session-token cookieand write it to the session-token.

Start

py main.py -file "path to the file"

The path to the file can be either relative or absolute.

After execution, the file yourfilename_commented.language is created in the folder with the desired file.

OR

py main.py -file "path to the file" -example "path to the example file"

Not recommended, little tested. You can specify a file with a comment option to create such comments.

Usage example

Usage preview

Alternative usage

You can also use this as a function in python.

from modules.autodoc import AutoDoc
import configparser

config = configparser.ConfigParser()
config.read("config.ini")

auth = {
    "email": config["ChatGPT"]["email"],
    "password": config["ChatGPT"]["password"],
    "session_token": config["ChatGPT"]["session_token"]
}

result = AutoDoc(
        auth,
        "Code for commenting",
        "language code",
        "example comment model (optional)"
    ).start()
print(result)
# out: Code with comments

Disclaimer

Doesn't always create correct comments. It doesn't always mean what you want. Use as a draft of comments that may need to be edited.

License

This project is licensed under the MIT License.

Acknowledgments

Thanks a lot to the development of AI and separately to СhatGPT for generating the Readme. And also acheong08 for creating ChatGPT.

Future

Add JavaScript, C#, C++, Go and other languages...

About

AutoDoc-ChatGPT is a Python script that leverages the power of ChatGPT model to automatically generate documentation for any programming language. With AutoDoc-ChatGPT, you can easily generate comprehensive documentation for your codebase.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.8%
  • TypeScript 4.2%