Skip to main content

A CLI tool for refactoring code using OpenAI's models

Project description

Codegpt

0.2.0

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

Getting Started

pip install codegpt --upgrade

And set your openapi API key as an environment variable like they recommend: In their docs here

Windows users can also use setx like:

$ setx OPENAI_SECRET_KEY=<YOUR_API_KEY>

from an admin console.

Be careful! But try this

Usage To try Codegpt, you can run the following command:

codegpt do <filenames>

It will prompt you for directions to follow, and it'll do whatever you want. Write new docs, add comments to code, just make sure to ask it to "edit" or "comment" or whatever so it knows to change files or not.

Or use the quick command to do some neat stuff, like:

Generate docs

codegpt quick docs <filenames>

Change variable names to be more readable

codegpt quick varnames <filenames>

Add comments to your code automatically

codegpt quick comment <filenames>

Check for bugs (iffy, but worth a shot)

codegpt quick bugs <filenames>

Check for vulnerabilities (even more iffy, but worth a shot)

codegpt quick vulns <filenames>

Try to make code less miserable

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.

Propose endpoints as issues, I've got a few ideas:

  • Write tests for file
  • Generate SQL query from table spec files
  • Generate new file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codegpt-0.2.6.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

codegpt-0.2.6-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file codegpt-0.2.6.tar.gz.

File metadata

  • Download URL: codegpt-0.2.6.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.13 Linux/5.17.6-200.fc35.x86_64

File hashes

Hashes for codegpt-0.2.6.tar.gz
Algorithm Hash digest
SHA256 bc75594c4301e372b19706b5f2fe27c585a32a6a22f82cf04f9f974f0f3eacd8
MD5 d8d7eac4cff83666c03c5a27d1b372c1
BLAKE2b-256 0e2192d5d80016e5608f37dd57dff77bd1b7406a21cb53357ce162ac7f0b2d69

See more details on using hashes here.

File details

Details for the file codegpt-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: codegpt-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.13 Linux/5.17.6-200.fc35.x86_64

File hashes

Hashes for codegpt-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7e25bc77fe37ae4f9b7aaac7c7bb3f8ba16978f3d248a21b20b27fc785cf677f
MD5 8ce56669f077d106d48c2862398a8b1c
BLAKE2b-256 5add8d11b7c675295afd71568c1278416dd117c8088e4bfcceea83f8513ad360

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page