{"id":23087783,"url":"https://github.com/ak3847/codebase-analyzer","last_synced_at":"2025-06-22T12:07:42.984Z","repository":{"id":215988557,"uuid":"740191863","full_name":"AK3847/Codebase-Analyzer","owner":"AK3847","description":"A python-script to analyze your GitHub repository via ChatGPT LLM for code improvements, bug fixes etc.","archived":false,"fork":false,"pushed_at":"2024-02-07T17:24:01.000Z","size":18800,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T20:02:41.691Z","etag":null,"topics":["chatgpt","chatgpt-api","github-automation","llm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AK3847.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-07T19:34:16.000Z","updated_at":"2024-02-09T09:28:07.000Z","dependencies_parsed_at":"2024-12-16T20:00:41.127Z","dependency_job_id":"3bf1dbe7-e34e-4ef4-b44f-86c8e187c7ae","html_url":"https://github.com/AK3847/Codebase-Analyzer","commit_stats":null,"previous_names":["ak3847/codebase-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AK3847/Codebase-Analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AK3847%2FCodebase-Analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AK3847%2FCodebase-Analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AK3847%2FCodebase-Analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AK3847%2FCodebase-Analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AK3847","download_url":"https://codeload.github.com/AK3847/Codebase-Analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AK3847%2FCodebase-Analyzer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261289419,"owners_count":23136070,"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","chatgpt-api","github-automation","llm"],"created_at":"2024-12-16T20:00:26.213Z","updated_at":"2025-06-22T12:07:37.971Z","avatar_url":"https://github.com/AK3847.png","language":"Python","readme":"# Codebase-Analyzer 🤖\nA python-script to analyze your github repository via ChatGPT LLM for code improvements,bug fixes etc.\n- [How to use?](https://github.com/AK3847/Codebase-Analyzer/edit/main/README.md#how-to-use)\n- [How it works?](https://github.com/AK3847/Codebase-Analyzer/tree/main#how-it-works)\n- [Python Modules used](https://github.com/AK3847/Codebase-Analyzer/tree/main?tab=readme-ov-file#python-modules-used)\n##  How to use? 🚀\n- First clone or download \u0026 unzip this repository.\n  \n```terminal\n git clone https://github.com/AK3847/Codebase-Analyzer.git\n```\n- Navgiate to `Codebase-Analyzer` folder and run the following command to install all the python module requirements:\n```terminal\n  pip install -r requirements\n```\n- Then run the following command in the terminal to start the script:\n  \n```terminal\npython main.py\n```\n- You will get an ouput like below in the terminal: \u003cbr\u003e\n  ![Screenshot 2024-01-09 023242](https://github.com/AK3847/Codebase-Analyzer/assets/94222544/7310c561-f2d8-4397-83bc-06fd8728edea) \u003cbr\u003e\n  \n- Kindly provide a _GITHUB Authorization Token_ ( you can get one from [here](https://github.com/settings/tokens) ) \u003cbr\u003e\n\n- Next chose either one of the option : \u003cbr\u003e\n  ![image](https://github.com/AK3847/Codebase-Analyzer/assets/94222544/779e8e3b-6d69-49f4-9dbe-f06302c091fa)\u003cbr\u003e\n  \n- Now the script will download all the files from repository in the `repo-downloads` folder \u003cbr\u003e\n  ![image](https://github.com/AK3847/Codebase-Analyzer/assets/94222544/56a675ff-c045-4492-ac4a-9e336a7d08c9) \u003cbr\u003e\n  \n- Next provide _OpenAI API Key_ ( register \u003ca href=\"https://platform.openai.com/signup\"\u003ehere\u003c/a\u003e to start with initial free credits): \u003cbr\u003e\n  ![Screenshot 2024-01-09 024135](https://github.com/AK3847/Codebase-Analyzer/assets/94222544/a1f12ace-8ea2-4c4d-a0ef-2cf9bee29c38)\n\n\n- Now the LLM will start to analyze code files one-by-one and output is shown in terminal: \u003cbr\u003e\n![image](https://github.com/AK3847/Codebase-Analyzer/assets/94222544/bd5c1ef3-49e8-472a-a1e5-49b1083ea18c) \u003cbr\u003e\n\n- At last all the suggestions will be stored in `suggestions.txt` file: \u003cbr\u003e\n  ![image](https://github.com/AK3847/Codebase-Analyzer/assets/94222544/c2f84f8d-7d89-4cc9-ad1b-07880fc41a43)\n\n##  How it works? ✨\n- First using the provided Github authorization token we fetch the repository using `Github` module of python, this is done in \u003ckbd\u003egithub_fetch.py\u003ckbd\u003e\n- Next we download all the files such as c,c++,java,python,html,css etc from the repository into our  `repo-downlaods` local folder.\n  \u003e The file extensions to be selected can be modified via \u003ckbd\u003eutils.py\u003c/kbd\u003e\n  \n  \u003e In case the folder is not empty, the tool automatically clears all the folder content to avoid file-mismatch.\n- We connect with the Eden AI which in turn provides us free access to ChatGPT 3.5 turbo via API.\n- Then all files are sent to LLM one by one via `requests` module of python with a `prompt`, this is done in \u003ckbd\u003eanalyze_codeabase.py\u003c/kbd\u003e\n  \u003e The prompt can be modified via \u003ckbd\u003eutils.py\u003c/kbd\u003e\n- All suggestions are stored in `suggestions.txt` file for later use.\n\n##  Python Modules used: 🐍\n```\n  os\n  json\n  requets\n  shutil\n  json\n  re\n  openai\n  github\n  rich\n  pwinput\n  tiktoken\n```\n- _All of this are imported in_ `utils.py`\n\n## Contribution 🤝\n- Any and all contribution are welcome for this project, you can raise issue with headings as:\n 1. New Feature Suggestion\n 1. Bug Fix\n 1. Code quality/efficiency Improvement\n 1. Other..\n- Features/Functionalities to be added soon:\n    - By pass the token-limit (_4096 right now_) to analyze larger code files ;)\n    - Improve the UI/UX in terminal\n    - Storing the API-Key more securely\n      \n_(Raise an issue if you can help me achieve above features ^\\_^ )_\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fak3847%2Fcodebase-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fak3847%2Fcodebase-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fak3847%2Fcodebase-analyzer/lists"}