cai icon indicating copy to clipboard operation
cai copied to clipboard

.env

Open ralyodio opened this issue 1 year ago • 6 comments

where do i put the OPENAI key?

ralyodio avatar Mar 29 '24 02:03 ralyodio

I just released a new version which has also support for a secrets.yaml file. Just install the latest version (cargo install cai) and run cai to get information on how to configure it.

If you still rather want to use env variables, here is a description of several ways to set them: https://askubuntu.com/a/58828

ad-si avatar Mar 29 '24 17:03 ad-si

I installed cai with brew. When I run cai I don't get much information. I added export openai_api_key="sdfsdf... to secrets.yaml but it didn't work?

bluedogtwo avatar Sep 01 '25 13:09 bluedogtwo

Cai is not available via brew. Do you mean cargo?

ad-si avatar Sep 01 '25 14:09 ad-si

https://formulae.brew.sh/formula/cai#default

bluedogtwo avatar Sep 01 '25 16:09 bluedogtwo

Ah, TIL =D

When I run cai I don't get much information

What exactly does that mean?

If nothing is set up it should show an error "An API key must be provided". But if you already have set $OPENAI_API_KEY or similar, then it will simply use that and answer your prompt.

ad-si avatar Sep 01 '25 17:09 ad-si

aha, yaml format openai_api_key: lksdjfl now it works, but a bit hard to read the answer with black background in the terminal

bluedogtwo avatar Sep 03 '25 15:09 bluedogtwo