Run ChatGPT in CLI using command gpt [prompt]. here are the follow instructions to get this working ok.
- Update the script:
nano ~/gpt
1b: Replace the content with the updated script (see the script file)
- Make sure the script is executable:
chmod +x ~/gpt
- Move the script to a directory in your PATH if not already done.
sudo mv ~/gpt /usr/local/bin/
- Install jq if not already installed:
sudo apt-get update sudo apt-get install jq
- You can now run the script from any directory:
gpt Tell me about Git Commands [example command]
an OpenAI api key.
linux.
whatever else.
a. Locate script if you need to:
which gpt
b. edit script if you want to
ctrl+6 then ctrl+k to delete lines in the file to replace it.
sudo nano /usr/local/bin/gpt
more later maybe...