Google Open-Sources Single-File CLI: One Command Lets Claude Code Call Gemini to Generate Images and Chew Through PDFs
The official Gemini API CLI has arrived: pure Go, zero dependencies, single file. Terminal agents like Claude Code and Codex can now generate images, analyze PDFs, and launch background research with a single command—without switching windows or re-feeding context. Note: it uses an API key, not subscription quota.
Google has open-sourced gemini-api-cli. Pure Go, zero dependencies, single file.
It does something simple: it lets the Claude Code or Codex you already use call Gemini's models and tools directly through the shell. Image generation, PDF analysis, audio/video transcription, and background research are all one-line commands.
Let's start with the pain point. Coding agents like Claude Code and Codex—AI programs that run in the terminal and can read code and modify files on their own—are very good at writing code and editing files. But when you need to generate an illustration, analyze a PDF dozens of pages long, or do some research, you have to switch to a web page, open another client, and explain the project background all over again. The context breaks, and so does your train of thought. gemini-api-cli removes that step: the agent calls Gemini directly in the shell, gets a file path or result, and keeps working.
Concretely, it looks like this:
gemini-api image 'A friendly robot mascot for a developer tool' --out ./assets/
A prompt goes in, an image lands in the project directory, and the agent gets the path and continues building. The same binary can also return analysis results, voiceovers, transcripts, or the interaction ID of a background task.
Why is it worth paying attention to?
- Single file, zero dependencies; it runs on macOS, Linux, and Windows. Installation is just one curl command or one go install.
- Its interface is self-describing. Agents can first run
--helpor--usageto view the command tree, use--schemato see the request body structure, and use--dry-runto validate calls offline—without consuming quota or touching keys. - Its capabilities go beyond image generation. It can call text generation, image editing, speech synthesis, music, video, file analysis, and transcription, and it can also launch background agents such as deep research, returning an ID for asynchronous polling.
- It is designed for agents. Output supports JSON and
--jqfield filtering; error codes distinguish parameter errors from permission errors. Machine-friendly. - It is currently in beta, so commands and interfaces may still change. In CI or automated workflows, it is advisable to pin a release version.
There are a few noteworthy points in the comments.
Someone immediately pointed out that it is billed through an API key, not Google AI subscription quota. Those who want to use subscription quota can wait a bit longer; a commenter mentioned that after December 2, Gemini subscriptions might support calls from other agents, but there is no official confirmation yet.
Others corrected the original post: gemini-api-cli is not a coding agent; it is more like an API channel. The original poster said goodbye to Antigravity, but Antigravity is Google's own coding agent, and this CLI extends existing agents' capabilities; the two are not replacements for each other. In a reply, the original poster added that Antigravity is hard to use, and seeing this CLI made them feel they could switch approaches.
Some commenters worry whether calling Gemini from Codex this way could get their accounts banned. There is no definitive answer yet; being cautious is never wrong.
This move by Google makes Gemini a backend capability provider for other agents. Tools are starting to adapt to workflows rather than the other way around; this direction looks promising.
Repository: github.com/google-gemini/gemini-api-cli
发布时间: 2026-11-24 19:54