# Codegpt
## 0.3
A tool for using GPT just a little quicker. A nearly truly automated footgun. Learn how to revert with git before trying please.
Posting about progress here:
[![Twitter Follow](https://img.shields.io/twitter/follow/_JohnPartee?style=social)](https://twitter.com/_JohnPartee)
## Getting Started
`pip install codegpt --upgrade`
And set your openapi API key as an environment variable like they recommend:
[In their docs here](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety)
Windows users can also use `setx` like:
`$ setx OPENAI_SECRET_KEY=<YOUR_API_KEY>`
from an admin console.
## Your first (safe) command
One cool thing is generating documentation. GPT-3 has a token limit of 4000 for completions, so larger files will be chunked up.
```bash
codegpt docs <paths>
```
And it'll generate docs, one per file. This is great when you're coming into a codebase you've never seen before.
## Unsafe Commands
Everything else can modify files. Have someone hold your beer and try some of these (after you check it into git):
Usage
To try Codegpt, you can run the following command:
```bash
codegpt do <instructions (quoted)> -f readme.md
```
It can do basically anything. Try handing in some files for context and telling it to generate something new - SQL queries, new features, documentation, whatever.
Or use the quick command to do some neat stuff, like:
Generate docs
```bash
codegpt quick docs <filenames>
```
Change variable names to be more readable
```bash
codegpt quick varnames <filenames>
```
Add comments to your code automatically
```bash
codegpt quick comment <filenames>
```
Check for bugs (iffy, but worth a shot)
```bash
codegpt quick bugs <filenames>
```
Check for vulnerabilities (even more iffy, but worth a shot)
```bash
codegpt quick vulns <filenames>
```
Try to make code less miserable
```bash
codegpt quick ugh <filenames>
```
Keep in mind that using GPT-3 for code generation is paid, with a cost of 2 cents per 1,000 tokens.
Just like with a Jr Dev, it's best to break up your tasks into smaller pieces to improve the results.
Raw data
{
"_id": null,
"home_page": "https://github.com/morganpartee/codegpt",
"name": "codegpt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "John Partee",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/fb/bb/7db2ddf545ba1bcb4587e290189b9501089dcba5f2e053dd6ef7ae0d29c0/codegpt-0.3.1.tar.gz",
"platform": null,
"description": "# Codegpt\n\n## 0.3\n\nA tool for using GPT just a little quicker. A nearly truly automated footgun. Learn how to revert with git before trying please.\n\nPosting about progress here:\n\n[![Twitter Follow](https://img.shields.io/twitter/follow/_JohnPartee?style=social)](https://twitter.com/_JohnPartee)\n\n## Getting Started\n\n`pip install codegpt --upgrade`\n\nAnd set your openapi API key as an environment variable like they recommend:\n[In their docs here](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety)\n\nWindows users can also use `setx` like:\n\n`$ setx OPENAI_SECRET_KEY=<YOUR_API_KEY>`\n\nfrom an admin console.\n\n## Your first (safe) command\n\nOne cool thing is generating documentation. GPT-3 has a token limit of 4000 for completions, so larger files will be chunked up.\n\n```bash\ncodegpt docs <paths>\n```\n\nAnd it'll generate docs, one per file. This is great when you're coming into a codebase you've never seen before.\n\n## Unsafe Commands\n\nEverything else can modify files. Have someone hold your beer and try some of these (after you check it into git):\n\nUsage\nTo try Codegpt, you can run the following command:\n\n```bash\ncodegpt do <instructions (quoted)> -f readme.md \n```\n\nIt can do basically anything. Try handing in some files for context and telling it to generate something new - SQL queries, new features, documentation, whatever.\n\nOr use the quick command to do some neat stuff, like:\n\nGenerate docs\n\n```bash\ncodegpt quick docs <filenames>\n```\n\nChange variable names to be more readable\n\n```bash\ncodegpt quick varnames <filenames>\n```\n\nAdd comments to your code automatically\n\n```bash\ncodegpt quick comment <filenames>\n```\n\nCheck for bugs (iffy, but worth a shot)\n\n```bash\ncodegpt quick bugs <filenames>\n```\n\nCheck for vulnerabilities (even more iffy, but worth a shot)\n\n```bash\ncodegpt quick vulns <filenames>\n```\n\nTry to make code less miserable\n\n```bash\ncodegpt quick ugh <filenames>\n```\n\nKeep in mind that using GPT-3 for code generation is paid, with a cost of 2 cents per 1,000 tokens.\n\nJust like with a Jr Dev, it's best to break up your tasks into smaller pieces to improve the results.\n",
"bugtrack_url": null,
"license": "GPL-3.0-or-later",
"summary": "A CLI tool for developers using GPT-3.",
"version": "0.3.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "aa7330810943eb73806545445bfa95c7",
"sha256": "7f5a0bc10aa610fe8a840ac5d75aee37bd51543e3b8234a74fc05967562733d1"
},
"downloads": -1,
"filename": "codegpt-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aa7330810943eb73806545445bfa95c7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 22384,
"upload_time": "2022-12-23T19:12:27",
"upload_time_iso_8601": "2022-12-23T19:12:27.604216Z",
"url": "https://files.pythonhosted.org/packages/91/d3/940fcfe71bd0082827bf8aef734a21715651735a6cb2bf01f6b6b18d162e/codegpt-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "d101dc66f572b3ef734fad8cde7c3c02",
"sha256": "5cf7a553e91f814283c9198e2a6edc6827e1997a52b9da1efadfd6e95c31f542"
},
"downloads": -1,
"filename": "codegpt-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "d101dc66f572b3ef734fad8cde7c3c02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 21375,
"upload_time": "2022-12-23T19:12:29",
"upload_time_iso_8601": "2022-12-23T19:12:29.259394Z",
"url": "https://files.pythonhosted.org/packages/fb/bb/7db2ddf545ba1bcb4587e290189b9501089dcba5f2e053dd6ef7ae0d29c0/codegpt-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-23 19:12:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "morganpartee",
"github_project": "codegpt",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "codegpt"
}