The Google AI Studio team released an experimental preview of the Gemini API CLI (command name gemini-api). It is a stateless, zero-dependency Go binary for macOS, Linux and Windows, open source under Apache 2.0. Any coding agent with shell access and a GEMINI_API_KEY can call text reasoning, image, video, music and speech generation, file and YouTube analysis, audio and video transcription, and managed agents such as Deep Research with one command. Media is written straight to disk and only the file path goes to stdout, so base64 payloads never land in the context window. Google labels it experimental and not a supported Google product.
Key Takeaways
- ✓Default models (official README): gemini-3.8-flash for generate, analyze and transcribe; gemini-nano-banana-2.1 for image; gemini-omni-1.1-flash for video; lyria-3.5 for music; gemini-3.8-flash-tts for speech
- ✓Install with a one-line curl script on macOS/Linux, a PowerShell script on Windows, or go install; the latest GitHub release is v0.4.3 (published 2026-10-19)
- ✓Built for agents: --usage prints the command tree as KDL, --schema prints JSON Schema, --dry-run validates offline with credentials redacted, plus --output-format json/toon and inline --jq
- ✓Exit codes separate 4 cases: 0 success, 1 runtime/API failure, 2 usage or validation error, 3 auth failure; --agent-mode emits structured JSON errors
- ✓It also manages sandbox environments, server-side credentials, webhooks and cron triggers for managed agents; files uploaded via the Files API are kept for 48 hours

Key Decision Metrics at a Glance
Heavy Claude Code use: compare subscription limits and API bills
Compare 40 dev plans & simulate token costs vs $20/mo subscriptions
Project Links & Resources
Direct AccessIn-Depth Technical Analysis
Background and pain points
Coding agents increasingly need to do more than write code: make a hero image and voiceover for a landing page, read a PDF, turn a meeting recording into captions, or hand research to a background agent. Until now an agent calling Gemini usually guessed model IDs, wrote a throwaway SDK script or a long curl command, and often dumped base64 images into its context. Google now describes a three-layer stack: the Gemini API itself, the Gen AI SDKs (Python, TypeScript, Go, Java) for production backends, and this new gemini-api CLI for terminals and agents.
How it works
gemini-api is a stateless single Go binary; each invocation runs on its own while the host agent supplies context, picks the model and decides the next step. Commands fall into Create (generate, image, tts, music, video), Understand (analyze, transcribe), Manage (agent, files, models and more) and Advanced (environments, credentials, webhooks, triggers). The whole interface is discoverable from the binary: --usage prints the full command tree as KDL, --schema prints the JSON Schema of request bodies, and --dry-run validates flags and previews the HTTP request with credentials redacted, without network access or the OS keychain. Media commands write files to disk and print only the path; managed-agent runs return an interaction ID to collect results later.
Benchmarks
This is a developer tool release and Google has published no performance or accuracy benchmarks. Verifiable facts: the GitHub repo google-gemini/gemini-api-cli is Apache 2.0, the latest release v0.4.3 was published on 2026-10-19, and the official docs label it experimental and not a supported Google product. Output quality depends on the default models underneath (such as Gemini 3.8 Flash and Nano Banana 2.1); the CLI does not change model quality. It is also a different product from the existing Gemini CLI interactive coding agent, and some developers have already found the naming confusing.
Getting started
On macOS or Linux install with the official install.sh, or run go install github.com/google-gemini/gemini-api-cli/cmd/gemini-api@latest, then create an API key in AI Studio and export GEMINI_API_KEY. Check the setup offline with gemini-api generate "Hello" --dry-run, then drop --dry-run for a real call. Google suggests adding a short block to AGENTS.md, CLAUDE.md or .cursorrules telling the agent to read --help or --usage, preview with --dry-run, and keep the returned file paths and interaction IDs. For production backends the Gen AI SDKs remain the recommended path; the CLI fits shell pipelines, CI and coding agents.
Benchmark side-by-side against alternatives, or calculate monthly token cost vs subscription break-even.
Discussion & Comments
0Sign in to join the discussion
Connect with AI developers to exchange benchmark insights.