Gemini API CLI
A stateless command-line interface that lets coding agents and scripts call Gemini models, media generation, and managed agents through shell commands.
At a Glance
The gemini-api CLI is licensed under Apache 2.0 and free to use. Gemini API usage requires an API key and is billed separately by Google.
Engagement
Available On
Alternatives
Listed Oct 2026
About Gemini API CLI
Gemini API CLI (gemini-api) is a command-line tool from the google-gemini organization that connects agents with shell access, such as Codex, Claude Code, Antigravity, OpenClaw, and Hermes, to the Gemini API. The README describes it as beta software, and the latest listed release is v0.4.3. It is distributed as a single Go binary for macOS, Linux, and Windows.
What It Is
The CLI wraps the Gemini API in standard shell commands. A host agent or script configures an API key, then calls commands to generate text, images, speech, music, and video, analyze files, transcribe recordings, or launch managed agents. Each invocation is stateless: the calling agent supplies context, chooses the model, and decides the next step. Media commands write files to disk and print the resulting path, while agent runs return interaction IDs that can be polled later.
Agent-friendly interface
The binary describes itself so agents can inspect it without external documentation. --usage emits the command tree as KDL, --schema prints JSON Schema for request bodies, and --dry-run previews the resolved HTTP request with credentials redacted and no network call. Output can be streamed text, JSON, TOON, or filtered inline with --jq. An agent mode produces structured JSON error envelopes, and distinct exit codes separate runtime, usage, and authentication failures.
Workflows covered
Commands span creation (generate, image, tts, music, video), understanding (analyze for PDFs, images, audio, video, CSV/text, and YouTube URLs; transcribe to Markdown, text, JSON, or SRT), and management of agents, files, models, environments, credentials, webhooks, and cron triggers. Long-running work can be delegated to a managed agent such as Deep Research in the background and checked later by interaction ID. For full control, --body accepts the underlying Interactions API request schema.
Current Status
The README states the CLI is in beta and evolving alongside the Gemini Interactions API, so breaking changes may occur between releases and pinning a release version is recommended. The project is Apache 2.0 licensed and is not accepting pull requests at this time.
Community Discussions
Be the first to start a conversation about Gemini API CLI
Share your experience with Gemini API CLI, ask questions, or help others learn from your insights.
Pricing
Open Source CLI
The gemini-api CLI is licensed under Apache 2.0 and free to use. Gemini API usage requires an API key and is billed separately by Google.
- Apache License 2.0 for all software
- Single Go binary for macOS, Linux, Windows
- Gemini API usage is billed separately (external cost)
- Non-software materials are licensed under CC BY 4.0
Capabilities
Key Features
- Text and multimodal generation
- Image generation and editing
- Text-to-speech with single and multi-speaker voices
- Music and video generation
- File analysis for PDFs, images, audio, video, CSV/text, and YouTube URLs
- Transcription to Markdown, text, JSON, or SRT
- Background managed agent runs with status polling and cancel
- Files API upload, list, and delete
- Self-describing --usage and --schema output
- -dry-run request preview with redacted credentials
- JSON, TOON, and --jq output filtering
- Webhook, trigger, environment, and credential management
- OS keychain credential storage
