← Back to Leaderboard
Ggoogle-gemini

google-gemini/gemini-api-cli

A stateless Go CLI for Gemini models, media, and managed agents via the shell

AI FrameworkQuickstart ↓
Engineering Health (Methodology)
A+ · 91/100
Maintenance Activity
● Updated today
Latest Release
v0.5.1
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption16/25
Release Cadence20/20
License Clarity20/20
CLIAPI
Total Stars
★ 4,861
24h Growth
+44
7d Growth
+613
Forks
341

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

google-gemini/gemini-api-cli Star History (2026-05-18 - 2026-12-04) ALL-TIME STAR HISTORY (2026-05 – 2026-12) +4.9k in 200d · avg +24/day 5.1k 2.6k 0 2026-05-18: ★ 12026-06-06: ★ 212026-06-20: ★ 272026-07-04: ★ 332026-07-18: ★ 332026-08-01: ★ 372026-08-15: ★ 402026-08-29: ★ 402026-09-12: ★ 422026-09-26: ★ 442026-10-10: ★ 492026-10-24: ★ 2732026-11-06: ★ 4572026-11-19: ★ 5102026-12-04: ★ 4,861 ★ 4.9k 2026-05 2026-08 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

gemini-api is a stateless Go client, not an agent orchestrator. A host agent or script starts a subprocess, supplies the context and model choice, and decides what to do with the result. For supported operations, the CLI turns flags or a --body payload into an HTTP request to the Gemini Interactions API. It can stream responses, write media to disk, or return an interaction ID that the caller keeps for a later invocation.

The installable command lives at cmd/gemini-api, with implementation under internal/. The manifest includes Cobra and pflag for command handling, Bubble Tea and Bubbles for terminal UI, gojq for filtering, and go-keyring for credential storage. The extension surface is the shell and the underlying request schema, not a documented MCP server or in-process plugin API. Managed-agent progress can stream over SSE; the caller still owns orchestration across invocations.

Key Capabilities & Differentiators

In v0.5.1, generate and analyze default to gemini-4-neon. Analysis accepts PDFs, images, audio, video, CSV or text files, and YouTube URLs. The media commands cover image generation and editing, single- or multi-speaker TTS, music, and video. transcribe exports Markdown, plain text, JSON, or SRT captions. The curated models catalog works offline, while models list --all queries and paginates the live catalog available to the configured key.

For automation, --usage exposes the CLI contract in KDL, and --schema describes bodies accepted through --body. --dry-run validates locally and previews the resolved request without network or keychain access. Use --stream=false --output-format json when a downstream step needs one complete response rather than streamed events. For media above roughly 14 MB raw or 20 MB base64-encoded, upload once with files upload --wait and reuse the returned URI within the Files API's 48-hour retention window.

Trade-offs & Limitations

Compared with a direct Gemini API integration, the CLI saves glue code for one-off requests, artifact output, and shell pipelines. The trade-off is a subprocess boundary: the host must manage process lifecycle, parse output, retain interaction IDs, and handle retries where appropriate. A direct client is a better fit when a long-lived service needs in-process request control or typed interfaces. This CLI complements a coding agent rather than replacing its planner or repository tooling.

Dry-run validation catches local request problems but cannot establish that a model is available to the key or that the service will accept the request. Live calls remain subject to network reliability, model availability, quotas, and API charges. Stateless execution also says nothing about server-side retention: review interaction storage settings and the Files API lifecycle separately. The Apache-2.0 license covers the client, not the hosted service, and the project accepts issue reports but not pull requests.

Hardware & Deployment Guide

Deploy a single binary on macOS, Linux, or Windows. Put a prebuilt release on PATH or install from cmd/gemini-api with go install; building current main requires Go 1.26.10 or later. Pass GEMINI_API_KEY through the subprocess environment for headless use, or configure a workstation via the OS keychain or YAML. Use --no-interactive in CI to prevent prompts. Request previews and the curated catalog work offline, but live model calls require network access and API credentials.

No local GPU, CUDA stack, or model weights are needed. Budget local resources for file handling, disk space, network transfers, and concurrent processes. The v0.5.1 release makes gemini-4-neon the default and introduces a common StreamClient interface in envruntime; v0.5.0 adds text_normalization to SpeechConfig. For reproducible automation, pin the CLI release and select models explicitly rather than depending on moving defaults.

Command discovery: --usage emits KDL with the command tree, defaults, environment variables, and config keys; --schema emits bundled JSON Schema draft 2020-12.
Offline preflight: --dry-run validates flags and bodies and previews the resolved HTTP request with credentials redacted, without network or OS keychain access.
Automation contract: JSON or TOON on stdout, inline --jq filtering, and agent-mode JSON errors on stderr; exit codes distinguish usage, auth, and runtime/API failures.
Artifact handoff: Media commands write files to disk and return their paths by default; directory outputs receive MIME-based extensions.
Long-running work: agent run --background returns an interaction ID for later polling, SSE progress streaming, or cancellation.
Reusable media: files upload --wait returns a files/ reference that can be reused across compatible commands; Files API uploads have a 48-hour retention window.
Best For

Teams extending an existing shell-capable agent or CI job with document analysis, media generation, transcription, or background Gemini tasks.

Skip If

Inference must stay offline or on-premises, you require a native MCP server, or the application needs a long-lived, typed API integration rather than subprocess calls.

Reviewed on 2026-12-02 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

CLIAPI
curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bash

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
gemini-api-cli ★4.9k+613GoApache-2.0A stateless Go CLI for Gemini models, media, and managed agents via the shell
headroom81.5k+455PythonApache-2.0Local context compression for LLMs via a Python library, proxy, and MCP server
gemini-cli109.6k+376TypeScriptApache-2.0A Node.js terminal agent for enterprise Gemini coding workflows and MCP tools

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/google-gemini/gemini-api-cli.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

google-gemini/gemini-api-cli Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about gemini-api-cli

How should a coding agent integrate with the CLI?

Have the agent invoke gemini-api as a subprocess. It can discover commands with --usage, inspect request bodies with --schema, and validate a call locally with --dry-run. For a single JSON response from a streaming command, use --stream=false --output-format json; for background managed-agent runs, persist the interaction ID and query agent status later. No MCP server is required for this integration.

Does it need a GPU, and what drives local resource usage?

No local GPU or model VRAM is required: Gemini runs inference remotely. Size the host for input handling, local artifact storage, network transfers, and the number of concurrent CLI processes. Large media and parallel jobs matter more to local resource use than the selected model's parameter count.

Can we use it commercially or self-host it for compliance?

Apache-2.0 permits commercial use and redistribution of the CLI under its license conditions. You can run or build the client on your own infrastructure, but that does not self-host Gemini models or managed agents. Review Gemini API terms, data handling, and retention separately before sending customer or regulated data.

When is a direct API client or a coding agent a better choice?

Use the CLI when shell portability, request previews, and local media output matter more than in-process control. Prefer a direct API client for a long-lived service that needs typed application interfaces or centralized request lifecycle management. If you need a tool that plans and executes repository work, keep your coding agent and give it the CLI as a callable capability rather than replacing it.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining google-gemini/gemini-api-cli? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature google-gemini/gemini-api-cli on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare