Skip to main content

A CLI tool for developers using GPT-3.

Project description

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

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.

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.

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:

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

Uploaded Source

Built Distribution

codegpt-0.3.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codegpt-0.3.0.tar.gz
  • Upload date:
  • Size: 21.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.3.0.tar.gz
Algorithm Hash digest
SHA256 e26a9893088879f4704c5b00bcbb8c7dbf6b5a22581ea07cc859ff7d486695c2
MD5 4e48c351e69cc5687bb055bb4f0218ca
BLAKE2b-256 a59558dae498caacbf7145083f2ae18f0696f884673ee21a28011e272258793e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codegpt-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22fc4c5cd605255cfc289c2f7aa31329a54ed23ebd066a96f50ab64e80521d2c
MD5 6a390a93d968d7f9b1a529f8bcadc729
BLAKE2b-256 05121e3e8779aede411f1f24d928f155c6144d9f8541b64f06ba76cb78cc1993

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