Here we will be using the chatgpt api to send prompts and receive answer which will be displayed on the terminal.
Go to openai's website and login to your account (create an account if you don't have one) and then go to this website
Generate an API key by clicking on the Create new secret key button. Copy the key and store it in a text file say api.txt
Run the following command: echo "api-key=$(cat api.txt) >> .bashrc
git clone this repo with the command: git clone https://github.com/n1haldev/gpt_on_cli
enter the directory using: cd gpt_on_cli
and then run the command: chmod +x gpt
copy the file to /usr/bin by running the command: sudo cp gpt /usr/bin
That's it. Run the 'gpt' command to enter active query mode and type exit as query to exit the query mode.
Hope you had fun setting this up :)