mattvr/ShellGPT

API key not detected using Fish shell

Closed this issue · 2 comments

Could the key be provided in the config as an alternative? Also, should the check only occur when making a request? As it stands, if the key isn't found, all commands produce an error, including the 'help' and configuration commands.

@kiosion Make sure OPENAI_API_KEY is set which you can verify by echo $OPENAI_API_KEY before running the script, and set via export OPENAI_API_KEY=sk-yourkeyhere-abcxyz123 (in your fish profile)

I can't see why this would be any different for fish shell. Seemed to work for me – may be user error or some local configuration.

However, to help, I've just pushed an update which lets you configure the API key in the event this environment variable isn't found.

Install the latest version and let me know if it fixed!

Gotcha - it was quite confusing since the variable was set (both in bashrc & my fish config) and I was able to echo it without issue... I'll give it another test later!