code-errrors
Building a Command Line Tool which provides suggestions when developers face errors while coding!
How it works
- Give a command to run
code-errors gcc hello.c
. - It will run the command given and the error we get, should be parsed and sent to OPEN AI.
- Print the suggestion given by OPEN AI.
Steps to set it up
Installation
Run the following commands for MacOS:
- Get an OPENAI API key from https://openai.com/api/ after signing up.
- Create an environment variable by the name
OPENAI_SK
. An example of setting this up in MacOS or Linux is placingexport OPENAI_SK="<your_api_key>"
in~/.bash_profile
and runningsource ~/.bash_profile
. - Now, run your code with a command
code-errors <command>
.
Usage - Example
Write a hello.c
file with the code (bonus if you can find the obvious error)
int
This looks like a simple hello world program. Let's compile it using our favourite complier gcc
.
Run: code-errors gcc hello.c
Result:
;
) );
)
)
)