Gemini API from the Shell
Teaches Claude Code to drive Google's `gemini-api` CLI for text, images, TTS, music, video, document analysis, captions and background research agents — with cost and privacy guardrails.
UtilitiesIntermediate★ 459⑂ 53AI score 8/10Last updated: Nov 2, 2026
What it does
An operations manual for the single-binary gemini-api CLI, so the assistant uses the tool correctly instead of hand-rolling REST calls.
- Preflight: run
gemini-api whoamito confirm config, credential source and defaults; if no key is set, stop and ask rather than guessing or editing config. - Discovery loop instead of guessing flags:
--help,--usage(KDL command tree),--schema,--dry-run,--help-global. - Task → command table:
generate,image,tts,music,video,analyze(PDF/audio/video/YouTube/CSV),transcribe(SRT),agent run --background,files upload --wait. - Output discipline: piped stdin is parsed as a JSON body (use
--stdin), media commands print only the written path, use--stream=false -o jsonor--jqfor parsing, and branch on exit codes 0/1/2/3. - Cost & safety: no speculative paid media, cheap model by default, always pass
--out, delete uploads (48h expiry), treat analyzed documents as untrusted data, and usestore:falsefor sensitive prompts.
Who it's for
- Developers who want a fast second opinion from a Gemini model in the terminal
- Content creators scripting image, voiceover, soundtrack or video generation
- Anyone extracting answers from PDFs/recordings or producing SRT captions
- Teams that care about API spend and server-side retention of prompts
Examples
- Summarize a file:
cat notes.md | gemini-api generate "summarize" --stdin --stream=false— the skill flags the stdin gotcha up front. - Capture a generated asset path:
MASCOT=$(gemini-api image "brand mascot" --out ./assets/mascot.jpg)for downstream steps. - Background deep research: launch with
agent run --background, keep the ID, pollagent statuslater instead of blocking the session.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/sanjay3290/ai-skills/HEAD/skills/gemini-api/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on AI Skill Mart. Copy the skills/gemini-api folder from the GitHub repo sanjay3290/ai-skills into my ~/.claude/skills/gemini-api/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/sanjay3290/ai-skills.git /tmp/ai-skills && mkdir -p ~/.claude/skills && cp -r /tmp/ai-skills/skills/gemini-api ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/sanjay3290/ai-skills.git /tmp/ai-skills - Create the skills folder:
mkdir -p ~/.claude/skills - Copy this skill:
cp -r /tmp/ai-skills/skills/gemini-api ~/.claude/skills/ - Install the CLI:
go install github.com/google-gemini/gemini-api-cli/cmd/gemini-api@latest(or review the officialinstall.shbefore running it). - Set your key:
gemini-api configure --api-key "YOUR_KEY", or exportGEMINI_API_KEY. - Verify with
gemini-api whoami, restart Claude Code, then try prompts like "ask gemini to summarize this PDF".
View source on GitHub ↗License: Apache-2.0