{"name":"gemini-api-cli: Give Shell Agents Access to the Gemini API","description":"Google’s Gemini API CLI lets shell-based coding agents and scripts use Gemini models and managed agents for generation, media, and file analysis. It is a stateless Go binary for macOS, Linux, and Windows, with machine-readable commands and dry-run validation.","github":"https://github.com/google-gemini/gemini-api-cli","url":"https://osrepos.com/repo/google-gemini-gemini-api-cli","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/google-gemini-gemini-api-cli","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/google-gemini-gemini-api-cli.md","json":"https://osrepos.com/repo/google-gemini-gemini-api-cli.json","topics":["go","cli","ai-agents","generative-ai","gemini-api","media-generation","managed-agents"],"keywords":["go","cli","ai-agents","generative-ai","gemini-api","media-generation","managed-agents"],"stars":null,"summary":"Google’s Gemini API CLI lets shell-based coding agents and scripts use Gemini models and managed agents for generation, media, and file analysis. It is a stateless Go binary for macOS, Linux, and Windows, with machine-readable commands and dry-run validation.","content":"## Overview\n\n`gemini-api` is a Go CLI built around Google’s Gemini API. It gives shell-based coding agents, assistants, scripts, and CI jobs access to Gemini models and managed agents, so they can generate text and media, analyze files, or delegate longer-running tasks without embedding API calls in the host application. It runs as a single binary on macOS, Linux, and Windows.\n\nThe CLI is stateless: the calling agent supplies context and keeps any interaction IDs it wants to reuse. Its built-in command discovery, request schemas, structured output, and dry-run mode are intended to make it usable by agents as well as people at a terminal.\n\n## Key Features\n\n- Generate text and reasoning responses, images, speech, music, and video through Gemini API commands.\n- Analyze documents and media, including PDFs, images, audio, video, CSV and text files, and YouTube URLs.\n- Start, check, and cancel managed-agent interactions, including background runs that return an interaction ID.\n- Inspect commands, flags, and request schemas from the binary with `--usage`, `--help`, and `--schema`.\n- Validate requests offline with `--dry-run`, which previews the request without a network call and redacts credentials.\n- Emit JSON or TOON output and filter results inline with `--jq` for shell and agent workflows.\n- Configure credentials through environment variables, an OS keychain, or a config file, and install the bundled agent skill for supported coding agents.\n\n## Use Cases\n\n- A coding agent can create images or voiceovers for an application and use the returned file paths in its project.\n- An assistant can extract answers from a PDF or compare images while helping a user complete a research or design task.\n- A team can transcribe recordings into text, JSON, or SRT captions from a shell workflow.\n- An agent can delegate research to a Gemini managed agent, save the interaction ID, and retrieve the result later.\n- A developer can validate CLI requests locally before enabling API calls in a script or CI job.\n\n## Our Take\n\nThis is a capable, actively maintained bridge from shell-based agents to Google’s Gemini API, best suited to teams comfortable adopting a beta CLI and managing Gemini API credentials.\n\n**Good fit if:**\n- Your coding agent or script can run shell commands and needs Gemini model, media-generation, file-analysis, or managed-agent capabilities.\n- You want a single Go binary with machine-readable discovery, structured output, and offline request previews.\n- You can work with the Gemini API and its credential setup, and accept the project’s Apache-2.0 licensing.\n\n**Look elsewhere if:**\n- You need a provider-neutral CLI rather than one centered on Google’s Gemini API.\n- Your environment cannot use Go 1.26.10 or later for development builds, or cannot run a prebuilt binary.\n- Your workflow depends on contributing code upstream, since the project says it does not accept pull requests.\n\n## Project Health\n\n| Signal | Value |\n|---|---|\n| Status | **Active**: regular commits and releases |\n| Last commit | 2026-12-02 (today) |\n| Commits, last 90 days | 100+ |\n| Releases, last 12 months | 13 (latest v0.5.1, 2026-12-02) |\n| Contributors | 10 (top contributor: 40% of commits) |\n| Issues closed, last 90 days | 8+ (typically closed in 4 days) |\n| Pull requests merged, last 90 days | 92 (typically merged in 1 day) |\n| Project age | 7 months |\n\nChecked on 2026-12-03 with the GitHub API.\n\n## Project Facts\n\n- Language: Go\n- License: Apache-2.0\n- Stars: 4.8k\n- Forks: 339\n- Topics: gemini, gemini-api\n- Website: https://ai.google.dev/gemini-api/docs\n- Archived: no\n\n## What You Need\n\nDetected in the repository:\n\n- Go 1.26.10 or newer (from go.mod)\n- A test suite and automated checks on GitHub Actions\n\n## Getting Started\n\nInstall on macOS or Linux:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bash\n```\n\nSet `GEMINI_API_KEY`, then check a request without making a network call:\n\n```bash\ngemini-api generate \"Hello from my agent\" --dry-run\n```\n\nSee the [README](https://github.com/google-gemini/gemini-api-cli#readme) for Windows and Go installation, configuration, and command examples.\n\n## License in Plain Words\n\n**Apache-2.0** (permissive).\n\n- Commercial use: yes\n- Modify and redistribute: yes\n- You must keep: the license, the NOTICE file and a note of your changes\n- Share your changes: no\n- Includes an explicit patent grant from the contributors\n\nA summary, not legal advice: the LICENSE file is what applies.\n\n## Considerations\n\n- The README describes the CLI as experimental and in beta, with possible breaking changes between releases. Pin a release for automated workflows.\n- Recent commits and releases indicate active development. The project has multiple contributors, and contributions are not concentrated in one person; however, its stated policy is to close external pull requests without review.\n- Development builds require Go 1.26.10 or later. The README does not require Docker or a database.\n- API use requires a Gemini API key, and available capabilities depend on the Gemini API and the models accessible to that key.","metrics":{"detailViews":2,"githubClicks":0},"dates":{"published":null,"modified":"2026-12-03T04:11:27.000Z"}}