Skip to main content

A CLI tool for refactoring code using OpenAI's models

Project description

Codegpt

0.2.13

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)> -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

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

Uploaded Source

Built Distribution

codegpt-0.2.13-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codegpt-0.2.13.tar.gz
  • Upload date:
  • Size: 19.5 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.13.tar.gz
Algorithm Hash digest
SHA256 d29160727e1e0be523ad4d75e1799950c19f3eb31892433a754eec72b808ed3a
MD5 fbb9c27d1b0cec92c00dcccbe88ef4b7
BLAKE2b-256 e46b8e299f9037daf5360c2eb46ad61e700d10e9160d898b0034ad0489f9eca1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codegpt-0.2.13-py3-none-any.whl
  • Upload date:
  • Size: 20.5 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 aadb6c05b2e6a4f317ef04c050cf02311eec5ab8cb99d0b5e6c24975f3937722
MD5 6592df936ce11a94b12010744e5ca388
BLAKE2b-256 a2bcd2813198cf11a4ee8fb20deaa1c1c278b3daa10fb8dfc8ba01a73b562692

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