{"id":13454083,"url":"https://github.com/awekrx/AutoDoc-ChatGPT","last_synced_at":"2025-03-24T05:33:04.545Z","repository":{"id":142233332,"uuid":"589160631","full_name":"awekrx/AutoDoc-ChatGPT","owner":"awekrx","description":"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.","archived":false,"fork":false,"pushed_at":"2023-03-10T19:19:29.000Z","size":38,"stargazers_count":395,"open_issues_count":1,"forks_count":31,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-01T08:10:06.720Z","etag":null,"topics":["ai","auto-comments","auto-documentation","autodoc","automated-documentation","automation","chatgpt","chatgpt-api","cli-documentation","comments","docs","documentation","documentation-generation","documentation-generator","documentation-tool","openai","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awekrx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-15T09:16:25.000Z","updated_at":"2024-07-31T22:12:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"326172ea-84ff-4424-888c-3568c5695933","html_url":"https://github.com/awekrx/AutoDoc-ChatGPT","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awekrx%2FAutoDoc-ChatGPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awekrx%2FAutoDoc-ChatGPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awekrx%2FAutoDoc-ChatGPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awekrx%2FAutoDoc-ChatGPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awekrx","download_url":"https://codeload.github.com/awekrx/AutoDoc-ChatGPT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221939068,"owners_count":16904905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","auto-comments","auto-documentation","autodoc","automated-documentation","automation","chatgpt","chatgpt-api","cli-documentation","comments","docs","documentation","documentation-generation","documentation-generator","documentation-tool","openai","python"],"created_at":"2024-07-31T08:00:50.769Z","updated_at":"2024-10-28T21:30:21.697Z","avatar_url":"https://github.com/awekrx.png","language":"Python","funding_links":[],"categories":["GitHub projects","Python","ChatGPT 工具"],"sub_categories":["程序猿专区"],"readme":"# AutoDoc-ChatGPT\n\nAutoDoc-ChatGPT is a Python script that leverages the power of ChatGPT model to automatically generate documentation for any programming language.\n\nWith 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.\n\n## Getting Started\n\n### Installing\n\nClone this repository to your local machine:\n\n```bash\ngit clone https://github.com/awekrx/AutoDoc-ChatGPT.git\n```\n\nThen install the required packages:\n\n```bash\npip install -r requirements.txt\n```\n\n## Supported programming languages\n\n- [X] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/python/python-original.svg\" height=\"20\" /\u003e Python\n- [X] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-original.svg\" height=\"20\" /\u003e JavaScript\n- [X] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/typescript/typescript-original.svg\" height=\"20\" /\u003e TypeScript\n- [ ] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/go/go-original.svg\" height=\"20\" /\u003e Go\n- [ ] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/csharp/csharp-original.svg\" height=\"20\" /\u003e C#\n- [ ] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/cplusplus/cplusplus-original.svg\" height=\"20\" /\u003e C++\n- [ ] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/php/php-original.svg\" height=\"20\" /\u003e PHP\n- [ ] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/ruby/ruby-original.svg\" height=\"20\" /\u003e Ruby\n- [ ] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/rust/rust-plain.svg\" height=\"20\" /\u003e Rust\n- [ ] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/java/java-original.svg\" height=\"20\" /\u003e Java\n- [ ] \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/kotlin/kotlin-original.svg\" height=\"20\" /\u003e Kotlin\n\nAnd others...\n\n\u003e `disclaimer`: TypeScript and JavScript has some bugs and is under testing\n\u003e\n\u003e `disclaimer_2.0`: There is a known error commenting files with 2 or more classes that have methods with the same name.\n\u003e\n\n## Usage\n\n### Edit config\n\nOpen `config.ini` and add `email` and `password` there if you are not using OAuth authorization.\nOtherwise open [ChatGPT](https://chat.openai.com) and get the `__Secure-next-auth.session-token` cookie and write it to the `session-token`.\n\n### Start\n\n```bash\npy main.py -file \"path to the file\"\n```\n\nThe path to the file can be either relative or absolute.\n\nAfter execution, the file `yourfilename_commented.language` is created in the folder with the desired file.\n\nOR\n\n```bash\npy main.py -file \"path to the file\"\n```\n\n__Not recommended, little tested.__\nYou can specify a file with a comment option to create such comments.\n\n### Usage example\n\n![Usage preview](./images/usage-preview.png)\n\n## Alternative usage\n\nYou can also use this as a function in python.\n\n```python\nfrom modules.autodoc import AutoDoc\nimport configparser\n\nconfig = configparser.ConfigParser()\nconfig.read(\"config.ini\")\n\nauth = {\n    \"email\": config[\"ChatGPT\"][\"email\"],\n    \"password\": config[\"ChatGPT\"][\"password\"],\n    \"session_token\": config[\"ChatGPT\"][\"session_token\"]\n}\n\nresult = AutoDoc(\n        auth,\n        \"Code for commenting\",\n        \"language code\",\n        \"example comment model (optional)\"\n    ).start()\nprint(result)\n# out: Code with comments\n```\n\n## Disclaimer\n\nDoesn'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.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Acknowledgments\n\nThanks a lot to the development of AI and separately to [СhatGPT](https://chat.openai.com) for generating the Readme.\n\nAnd also [acheong08](https://github.com/acheong08) for creating [ChatGPT](https://github.com/acheong08/ChatGPT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawekrx%2FAutoDoc-ChatGPT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawekrx%2FAutoDoc-ChatGPT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawekrx%2FAutoDoc-ChatGPT/lists"}