Last active
January 5, 2026 12:56
-
-
Save shaoyanji/1530d9ba7b07dc0938d064f83c942db5 to your computer and use it in GitHub Desktop.
minimalistic unixy way to run Google Gemini AI - dependency: curl, gum, yq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| #age -d -i ~/.ssh/id_ed25519 ~/.env.age | grep GEMINI | awk -F'=' '{print $2}' | |
| export $(age -d -i ~/.ssh/id_ed25519 ~/.env.age) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| curl -sS https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent -H "x-goog-api-key: $GEMINI_API_KEY" -H "Content-Type: application/json" -X POST -d '{"contents":[{"parts":[{"text": "'"$(gum input)"'"}]}]}' | yq .candidates.[].content.parts.[].text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment