[Late catch] Gemini API CLI beta: coding agents can call Gemini with one shell command
What is it?
gemini-api is a stateless, zero-dependency command-line client. From inside a coding agent such as Claude Code, Codex or Cursor, or from a CI job, you can generate images, analyze files and run Gemini managed agents as plain shell commands. It's a different tool from @google/gemini-cli, which is an interactive coding agent.
curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bash
export GEMINI_API_KEY="YOUR_API_KEY"
gemini-api analyze -i ./report.pdf "Summarize the three key points."Why does it matter?
When agents call REST directly, base64 media floods the context window and interactive prompts stall subprocesses. This CLI writes output files to disk and prints only the path, and --dry-run, -o json and --agent-mode give machine-readable output and errors. It's a handy way to give an agent Gemini's image and research features without adding an SDK to your project.
Maturity
BetaIt's an open-source beta. The docs warn that breaking changes can land between minor versions and recommend pinning a version in automated environments.
How to track it
- Versions: follow google-gemini/gemini-api-cli releases on GitHub for 1.0 and breaking changes.
- Integration: check whether Gemini's coding-agent setup guide adds usage rules for the CLI.