Calling Google Gemini AI from the terminal with Go
3 min readMay 4, 2024
Let’s see how to call Google Gemini AI from the terminal using a Go script. I usually spend quite some time in the terminal, having a script to call and have Google AI response there would be really convenient.
Prerequisites
- Get an API Key
You will need an API Key to call Gemini, you can get it here: https://ai.google.dev/gemini-api/docs/api-key
2. Store it in an environmental variable. I have it in my ˜/.bashrc:
export…