Skip to main content

A CLI tool for refactoring code using OpenAI's models

Project description

Codegpt

0.2.10

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 <instructions (quoted)> <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.

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.11.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

codegpt-0.2.11-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codegpt-0.2.11.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.6 Windows/10

File hashes

Hashes for codegpt-0.2.11.tar.gz
Algorithm Hash digest
SHA256 16ee4a67396e6dec83c93abbb1c1ecedd0a2a9b941fd20b3d2ad704c9f625c07
MD5 3e953c082577f9e681d74a15e7326774
BLAKE2b-256 545bddef2b5734174058250cc527bef6b9930031760bbc50821361720e5210ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codegpt-0.2.11-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.6 Windows/10

File hashes

Hashes for codegpt-0.2.11-py3-none-any.whl
Algorithm Hash digest
SHA256 8cd574b160d412a8f04febd180b4f17680e3755a814f67e3e87320db39344a9f
MD5 0e26b3deb1a54fdf92b31519fb460528
BLAKE2b-256 470b2a70401ae5465362d339518ac1adfa3b36cdbbaed92982360c2349647ace

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