Skip to content

A little doohicky that uses GPT3 to try and write your code tooling for you. Provide a prompt and tests, GPT3 does the rest!

License

Notifications You must be signed in to change notification settings

cranberryofdoom/ai-code-tooling

Repository files navigation

ai-code-tooling

A little doohicky that uses GPT3 to try and write your code tooling for you. Provide a prompt and tests, GPT3 does the rest!

Currently only supports writing custom lint rules. Will eventually expand to generating codemods and maybe even translating class components to functional components.

How to Use

  1. Run yarn install.
  2. [Recommended] Set up a VM. We're only really telling GPT3 to generate custom lint rules, but it's best to not run arbitrary generated code directly on your computer. 😛
  3. Create an account with OpenAI, grab your secret key, and put it in a .env file at root with the contents: OPENAI_API_KEY=${yourKey}.
  4. Write a test, put it in the tests folder.
  5. Write a prompt, put it in the prompts folder.
  6. Run ts-node ./cli/ai-code-tooling.ts eslint and follow the instructions!

Demo

You can find the generated code of this demo in: ./generated-code/prefer-alto-external-design-system-web-alias-import.ts.

Kapture.2023-02-21.at.21.39.59.mp4

About

A little doohicky that uses GPT3 to try and write your code tooling for you. Provide a prompt and tests, GPT3 does the rest!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published