Gemini API CLI: a command line for agents and CI

Google released a beta of the gemini-api client: stateless and dependency-free, for coding agents, scripts and CI pipelines.

About the tool
Gemini
Category
Coding
Format
Update

Читати українською

On October 27, Google released a beta of the Gemini API CLI. It’s a command-line client called gemini-api, built mainly for coding agents, scripts and CI pipelines rather than for hands-on terminal work. Don’t confuse it with Gemini CLI, which is a separate interactive agent.

What’s new

The client is stateless and has no dependencies. Each feature is a regular shell command that calls the Interactions API. You can use it to:

  • generate text and media;
  • analyze files;
  • run Gemini managed agents.

There are useful flags for agents: --usage shows the full command tree, --schema shows request JSON schemas, and --dry-run -o json lets you check a call offline. The docs also include a snippet for AGENTS.md or CLAUDE.md so a coding agent knows about the tool.

How to try it

You can install it with a script on macOS, Linux or Windows, through go install, or by downloading a prebuilt binary from GitHub Releases. For Docker and CI, the docs suggest binaries, since they let you pin a version. The key goes in the GEMINI_API_KEY variable.

Limitations

This is a beta, and the GitHub repository calls the client experimental, so commands may still change. Pin a version in any script that needs to keep working.

Prepared with AI from public sources.