{"id":18334674,"url":"https://github.com/hrshdhgd/codergpt","last_synced_at":"2025-08-27T22:21:13.633Z","repository":{"id":221703216,"uuid":"755039527","full_name":"hrshdhgd/CoderGPT","owner":"hrshdhgd","description":"CoderGPT","archived":false,"fork":false,"pushed_at":"2024-08-22T04:34:29.000Z","size":3036,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-23T05:42:25.813Z","etag":null,"topics":["ai","code-improvement","gpt","langchain"],"latest_commit_sha":null,"homepage":"https://hrshdhgd.github.io/CoderGPT/","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/hrshdhgd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"dei":null}},"created_at":"2024-02-09T10:06:16.000Z","updated_at":"2024-06-29T06:49:27.000Z","dependencies_parsed_at":"2024-02-12T19:27:52.712Z","dependency_job_id":"e3b69af8-5bd9-4fb9-9b76-1685787bc697","html_url":"https://github.com/hrshdhgd/CoderGPT","commit_stats":null,"previous_names":["hrshdhgd/optimgpt"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrshdhgd%2FCoderGPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrshdhgd%2FCoderGPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrshdhgd%2FCoderGPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrshdhgd%2FCoderGPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrshdhgd","download_url":"https://codeload.github.com/hrshdhgd/CoderGPT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223237254,"owners_count":17111344,"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","code-improvement","gpt","langchain"],"created_at":"2024-11-05T19:50:32.092Z","updated_at":"2025-04-06T04:33:30.915Z","avatar_url":"https://github.com/hrshdhgd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoderGPT\n\nCoderGPT is a versatile command-line interface (CLI) designed to enhance coding workflows. It leverages the capabilities of Large Language Models (LLM) and Generative Pre-trained Transformers (GPT) to assist developers in various tasks such as commenting, optimizing, documenting, and testing their code. This tool integrates seamlessly with [langchain](https://github.com/langchain-ai/langchain), providing a powerful backend for code generation and modification.\n\n# Model Providers Implemented\n - [x] OpenAI [`gpt-3.5-turbo`, `gpt-4`, `gpt-4-turbo-preview`(default)]\n - [x] Google [`gemini-pro`]\n - [x] Anthropic [`claude-2.1`]\n\n## Prerequisites\n\nBefore you begin using CoderGPT, you must set the `OPENAI_API_KEY`, `GOOGLE_API_KEY` and `ANTHROPIC_API_KEY` environment variables on your machine. This key enables authentication with the OpenAI and Google APIs, which are essential for the language model's operation.\n\n```sh\nexport OPENAI_API_KEY='your-api-key-here'\nexport GOOGLE_API_KEY='your-api-key-here'\nexport ANTHROPIC_API_KEY='your-api-key-here''\n```\n\nEnsure that you replace `your-api-key-here` with your actual OpenAI API key to enable the full functionality of CoderGPT.\n\n## Getting Started\n\n### Installation\n\nInstall CoderGPT easily using pip:\n\n```shell\npip install codergpt\n```\n\n### Basic Usage\n\nInvoke the CoderGPT CLI with the following syntax:\n\n```shell\ncodergpt [OPTIONS] COMMAND [ARGS]...\n```\n\n#### Options\n\n- `-v, --verbose INTEGER`: Adjust the verbosity level (0 for default, 1 for verbose, 2 for debug).\n- `-q, --quiet`: Suppress output.\n- `--version`: Show the version number and exit.\n- `--model`: Model to use for performing requests.\n  - Available models:\n    - OpenAI: [`gpt-3.5-turbo`, `gpt-4`, `gpt-4-turbo-preview`(default)]\n    - Google: [`gemini-pro`]\n    - Anthropic[`claude-2.1`]\n\n#### Commands\n\n##### Inspect\n\nAnalyze a package and display its file-language mapping.\n\n```shell\ncodergpt --model \u003cmodel-name\u003e inspect \u003cpath\u003e\n```\n\n###### Example\n\n```shell\n$ codergpt --model gpt-4 inspect src/codergpt/\n```\n\n##### Explain\n\nProvide an explanation for a specific function or class within a package.\n\n```shell\ncodergpt explain \u003cpath\u003e [--function \u003cfunction_name\u003e] [--classname \u003cclass_name\u003e]\n```\n\n###### Example\n\n```shell\n$ codergpt explain src/codergpt/explainer/explainer.py --function explain\n```\n\n##### Comment\n\nAutomatically add comments to your code. Choose whether to overwrite the existing file or create a new one.\n\n```shell\ncodergpt comment \u003cpath\u003e [--overwrite/--no-overwrite]\n```\n\n###### Example\n\n```shell\n$ codergpt comment greetings.py --overwrite\n```\n\n##### Optimize\n\nEnhance your code by optimizing it and adding comments. You can decide to overwrite the original file or save the changes separately.\n\n```shell\ncodergpt optimize \u003cpath\u003e [--overwrite/--no-overwrite]\n```\n\n###### Example\n\n```shell\n$ codergpt optimize example.py --overwrite\n```\n\n##### Write Tests\n\nGenerate test cases for a specified code file, targeting particular functions and/or classes.\n\n```shell\ncodergpt write-tests \u003cfilename\u003e [--function \u003cfunction_name\u003e] [--class \u003cclassname\u003e] [--outfile \u003coutput_filename\u003e]\n```\n\n###### Example\n\n```shell\n$ codergpt write-tests example.py --function add --class Calculator\n```\n\n##### Document\n\nCreate documentation for a given code file by processing and explaining the code.\n\n```shell\ncodergpt document \u003cpath\u003e [--outfile \u003coutput_filename\u003e]\n```\n\n###### Example\n\n```shell\n$ codergpt document example.py\n```\n\n## Development \u0026 Contribution\n\nThe CoderGPT CLI is developed in Python, utilizing the `click` library for creating commands. Here's a template for adding a new command:\n\n```python\nimport click\nfrom codergpt import CoderGPT\n\ncoder = CoderGPT()\n\n@click.command()\n@click.argument('path', type=click.Path(exists=True))\ndef new_command(path):\n    # Implement command logic here\n    pass\n```\n\nContributions to CoderGPT are highly encouraged! Please review our [contributing guidelines](CONTRIBUTING.md) before making pull requests.\n\n## License\n\nCoderGPT is open-sourced under the MIT License. For more details, refer to the [LICENSE.md](LICENSE.md) file.\n\n## Acknowledgments\n\nThis project was scaffolded using the [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/README.html) framework, based on the [monarch-project-template](https://github.com/monarch-initiative/monarch-project-template). Updates are managed through [cruft](https://cruft.github.io/cruft/).\n\nFor comprehensive details on the CoderGPT CLI, please refer to [the official documentation](https://hrshdhgd.github.io/CoderGPT/).\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrshdhgd%2Fcodergpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrshdhgd%2Fcodergpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrshdhgd%2Fcodergpt/lists"}