Basic program in Javascript (Node.js) that allows the usage of OpenAI's API through the terminal.
Ensure you have Node.js version 16.x + installed. Then run the following:
npm i -g gpt-terminal
Or
npm install --global gpt-terminal
Once you installed the npm package, you need to setup your API key:
Create an environment file .ENV
(where you downloaded this module) that contains your API Key .
<YOUR_API_KEY>
will be replaced with your ChatGPT API Key.
Just write this extremely difficult command in your terminal:
gpt
Once you're done with that, a new pop-ul will appear on screen:
Just type your question for ChatGPT.
If you want to give a file as an input just type read <your_file_name>
like this:
PS: Quotes " " are optional. Ctrl+C to stop the application.
Be aware that any newline '\n'
sent as input directly from the terminal will be recognized as an Enter
resulting in sending the query to ChatGPT. If you want to use text blocks as input, I recommend putting them in a file and doing the step above.