{"id":18862021,"url":"https://github.com/marco-rosner/gendocsgpt","last_synced_at":"2025-04-14T13:04:13.827Z","repository":{"id":194184374,"uuid":"690277410","full_name":"marco-rosner/genDocsGPT","owner":"marco-rosner","description":"CLI to generate API documentation in MarkDown based on the models and api handlers for a given project using ChatGPT.","archived":false,"fork":false,"pushed_at":"2023-09-22T15:41:06.000Z","size":465,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-09T09:30:40.679Z","etag":null,"topics":["chatgpt","documentation","generator","gpt","openai","pytest","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/genDocsGPT/","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/marco-rosner.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}},"created_at":"2023-09-11T22:20:03.000Z","updated_at":"2024-04-05T00:46:08.000Z","dependencies_parsed_at":"2023-09-22T08:08:03.230Z","dependency_job_id":null,"html_url":"https://github.com/marco-rosner/genDocsGPT","commit_stats":null,"previous_names":["marco-rosner/gendocsgpt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-rosner%2FgenDocsGPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-rosner%2FgenDocsGPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-rosner%2FgenDocsGPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-rosner%2FgenDocsGPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marco-rosner","download_url":"https://codeload.github.com/marco-rosner/genDocsGPT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223633802,"owners_count":17176858,"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":["chatgpt","documentation","generator","gpt","openai","pytest","python"],"created_at":"2024-11-08T04:33:01.181Z","updated_at":"2024-11-08T04:33:01.866Z","avatar_url":"https://github.com/marco-rosner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![genDocsGPT](https://img.shields.io/pypi/v/genDocsGPT.svg)](https://pypi.org/project/genDocsGPT/) [![Python Versions](https://img.shields.io/badge/Python-3.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11-blue)](https://www.python.org) [![Test workflow](https://github.com/marco-rosner/genDocsGPT/actions/workflows/test.yml/badge.svg)](https://github.com/marco-rosner/genDocsGPT/actions/workflows/test.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT.png?raw=true \"genDocsGPT\")\n\n## Generate Docs using ChatGPT\n\nCLI to generate API documentation in MarkDown based on the models and api handlers for given project using ChatGPT.\n\n## genDocsGPT badge\n\n[![genDocsGPT](https://img.shields.io/badge/Docs%20generated%20by-genDocsGPT-blue)](https://github.com/marco-rosner/genDocsGPT)\n\n## ChatGPT API Key\n\nThe genDosGPT demand a ChatGPT API Key that you can generate after create your free account in [OpenAI](https://www.openai.com/). Tutorial [here](https://www.maisieai.com/help/how-to-get-an-openai-api-key-for-chatgpt). After this, create a `.env` file in the following format:\n\n```\nAPI_KEY=\"chatgpt_api_Key\"\n```\n\n## Usage\n\n```\nusage: genDocsGPT [-h] [-v, --verbose] -m / --model \u003cmodel_paths\u003e -a / --api \u003capi_paths\u003e \n[-o / --output \u003cfilename\u003e] [-t / --token \u003ctoken\u003e] [--env \u003cfilename\u003e] [--gpt_model \u003cmodel\u003e]\n\nCLI to generate API documentation in MarkDown based on the models and api handlers for \ngiven project using ChatGPT.\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --verbose         Show all the messages to debug\n  -m / --model \u003cmodel_paths\u003e\n                        Model paths. If more than one, separate with a comma\n  -a / --api \u003capi_paths\u003e\n                        API paths. If more than one, separate with a comma\n  -o / --output \u003cfilename\u003e\n                        Filename to the documentation generated. Default: ./api.md\n  -t / --token \u003ctoken\u003e  ChatGPT API KEY\n  --env \u003cfilename\u003e      Env file that MUST and ONLY have API_KEY=\"chatgpt_api_key\". \n                        Default: ./.env\n  --gpt_model \u003cmodel\u003e   Model that will be used by ChatGPT. Default: gpt-3.5-turbo\n\nWe do not recommend using it in non-open-source projects.\n```\n\n### Standalone\n\n![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-standalone.png?raw=true \"genDocsGPT\")\n\nThe [genDocsGPT.sh](https://github.com/marco-rosner/genDocsGPT/blob/main/usage/Standalone/genDocsGPT.sh), the bash script above, should be used in projects where the documentation should be generated not frequently. You only need to copy this file, **change the configuration** (models, API handlers…), paste it into your project, create the .env file with the ChatGPT API Key, and run this bash script.\n\nI am using this standalone version in the [DadosJusBr’s GraphQL](https://github.com/marco-rosner/dadosjusbr-graphql) project which is a Node/ExpressJS using Apollo Server. So, I created a script in the [package.json](https://github.com/marco-rosner/dadosjusbr-graphql/blob/main/package.json) to run it only using: `npm run genDocsGPT` or `yarn genDocsGPT`\n\n### GitHub Action\n\n![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-gh-action.png?raw=true \"genDocsGPT\")\n\nThis GitHub Action will run after every commit in the main/master branch and create a pull request that you only need to approve (or not) and the documentation will be updated.\n\nFor [genDocsGPT.yml](https://github.com/marco-rosner/lightweight-go-server/blob/main/.github/workflows/genDocsGPT.yml) works fine in your project, you should set the model, API handlers paths, and other options ([line 30](https://github.com/marco-rosner/lightweight-go-server/blob/main/.github/workflows/genDocsGPT.yml#L30)), create, in the GitHub, the secret **ChatGPT_API_KEY** ([_tutorial here_](https://docs.github.com/pt/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)), and change the workflow permissions ([_tutorial here_](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions)) to “**Read and Write permissions**” and use the “**Allow GitHub Action to create and approve pull requests**”.\n\n![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-permissions.png?raw=true \"Workflow permissions after the changes needed\")\n\nFor more detail, I integrated this GitHub Action in the [Lightweight Go Server](https://github.com/marco-rosner/lightweight-go-server) project, a [Go servers benchmark between Echo, Gin, and Fiber](https://blog.stackademic.com/go-servers-benchmark-echo-fiber-and-gin-caadd9a78319).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarco-rosner%2Fgendocsgpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarco-rosner%2Fgendocsgpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarco-rosner%2Fgendocsgpt/lists"}