# 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.

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.

## 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

## Integrations
Gemini API, Google AI Studio, Codex, Claude Code, Antigravity, OpenClaw, Hermes

## Platforms
WINDOWS, MACOS, LINUX, ANDROID, WEB, API, VSC_EXTENSION, JETBRAINS_PLUGIN, CLI

## Pricing
Open Source

## Version
v0.4.3

## Links
- Website: https://ai.google.dev/gemini-api/docs
- Documentation: https://ai.google.dev/gemini-api/docs
- Repository: https://github.com/google-gemini/gemini-api-cli
- EveryDev.ai: https://www.everydev.ai/tools/gemini-api-cli
