reugn/gemini-cli

GEMINI_API_KEY not being picked up from env

adsouza opened this issue · 1 comments

Even though running echo $GEMINI_API_KEY prints out the key, when I try to use the binary, I get this error message:

Error: You need an API key to use this client.
Visit https://ai.google.dev to get one, put it in an environment variable like GEMINI_API_KEY,
then pass it as an option:
genai.NewClient(ctx, option.WithAPIKey(os.Getenv("GEMINI_API_KEY")))
(If you're doing that already, then maybe the environment variable is empty or unset.)
Import the option package as "google.golang.org/api/option".

N/n, the issue was that I hadn't exported the var.