0xacx / chatGPT-shell-cli

Simple shell script to use OpenAI's ChatGPT and DALL-E from the terminal. No Python or JS required.
https://gptshell.cc
MIT License
1.07k stars 152 forks source link

jq: error (at <stdin>:8): Cannot iterate over null (null) #9

Closed nhasian closed 1 year ago

nhasian commented 1 year ago

I cloned the repo, ran the install.sh, and added my api key.

When I try to enter anything after the prompt, I receive this error message:

"jq: error (at :8): Cannot iterate over null (null)"

I am running Ubuntu 22.10 and I have curl and jq already installed.

0xacx commented 1 year ago

I am assuming that the error you get is because the Open AI key is added to your profile but is not sourced to the terminal session you are running. So if you just restart your terminal it should work.

I just pushed some changes that fix this and should make the install script more robust. Also just added error handling that will inform the user on the error type. You can install it again with curl -sS https://raw.githubusercontent.com/0xacx/chatGPT-shell-cli/main/install.sh | sudo -E bash to get the latest version. LMK if that works for you.

jordantrizz commented 1 year ago

I was getting the same error, hence the pull request for error handling. @0xacx improved this so you'll get the real error from Openai's API now.

0xacx commented 1 year ago

I am closing this issue, as it has been properly addressed. If you run into it again, please lmk.