Google Open-Sources gemini-api, a Command-Line Tool for AI Agents
Google recently open-sourced gemini-api on GitHub, providing a stateless, dependency-free Gemini API command-line client for AI Agents with shell access, scripts, and CI. It writes media results to files and provides offline usage lookup, input validation, and JSON error reporting through --usage, --schema, --dry-run, and --agent-mode, reducing the context consumed by binary data and tool definitions. The project remains in beta, and its repository currently has 97 Stars; backward-incompatible changes may follow.
Why read this
AI score 68
gemini-api’s design trade-offs demonstrate how software is shifting from human-oriented interaction toward reliable Agent invocation and controlled context costs.
Topics
Body · AI translation
Recently, Google open-sourced a command-line tool called gemini-api on GitHub.
According to Google, gemini-api is a stateless, zero-dependency command-line client designed for AI agents with shell access, and it can also be invoked by scripts and CI systems. In addition to its own Antigravity, Google lists Claude Code, Codex, Cursor, OpenClaw, and Hermes among the supported tools.
gemini-api’s capabilities are not new. The Gemini API could already handle text and multimodal generation, file analysis, audio and video transcription, image, speech, music, and video generation, as well as managed agents that run in the background, such as Deep Research. What has changed is the design.
In its documentation, Google identifies three problems that coding agents often encounter when calling native REST APIs and interactive CLIs: Base64-encoded media files fill up the context window, interactive prompts block subprocesses, and outdated training data causes agents to invent parameters that do not exist.
gemini-api’s four design principles address these problems one by one. Media and transcription results are saved as files, with commands returning only their paths, so binary data never enters the context. --usage and --schema output the command tree and JSON Schema offline, allowing agents to look up usage without internet access. --dry-run validates inputs and previews requests first, while --agent-mode converts errors into JSON as well. By default, no command retains local state, and multi-step tasks are linked through interaction IDs.
Colored output, progress bars, confirmation pop-ups, and sessions preserved across commands—features designed for people—are all disabled by default in gemini-api.
People look at interfaces; agents read text.
In June 2025, Google released Gemini CLI, a terminal-based agent that developers could converse with, positioned against Anthropic’s Claude Code and OpenAI’s Codex CLI.
In 2025, Google built an agent in the terminal for people. In 2026, Google built a tool in the terminal for agents.
02 The Battle for the Gateway: Protocols, Skills, and the Command Line
gemini-api itself is very small. Its repository currently has only 97 stars, it remains in beta, and Google warns that future changes may be backward-incompatible.
Over the past two years, AI vendors and software companies have been competing for the same position: the gateway through which agents invoke services.
The first layer is the connection protocol.
Anthropic open-sourced MCP (Model Context Protocol) in November 2024. By March 2026, the official MCP Python and TypeScript SDKs had reached 97 million monthly downloads, up from about 2 million at launch. As of August 2026, the four major registries hosted approximately 15,930 public MCP services, including 9,652 in the official registry alone. OpenAI, Google, Microsoft, and AWS have all integrated MCP into their agent products.
The second layer is skill packages.
Anthropic launched Agent Skills in October 2025 and opened it as a standard that December. A skill is simply a folder containing a SKILL.md instruction file and accompanying scripts. When Anthropic announced that it would donate the standard to the Agentic AI Foundation under the Linux Foundation, it disclosed that more than 70 agent platforms—including ChatGPT, Cursor, GitHub Copilot, and VS Code—had adopted it. A total of 1 million skills had been published, with nearly 280 million installations.
The third layer is the command line, which has seen the fastest growth in 2026.
In early March 2026, Google released Google Workspace CLI on GitHub, providing command-line access to services including Drive, Gmail, Calendar, Sheets, and Docs. It includes more than 100 agent skills and has already surpassed 26,500 GitHub stars. On March 28, Feishu open-sourced Feishu CLI, gaining more than 1,000 stars on its first day. Its officially listed target users include AI coding tools such as Trae, Claude Code, Codex, and Cursor.
Chinese vendors moved earlier on MCP. In April 2025, Alibaba Cloud Model Studio launched full-lifecycle MCP services, initially integrating more than 50 services, including Amap and Wuying. That same month, Alipay and the ModelScope community jointly introduced China’s first payment MCP Server, allowing agents to connect directly to payment capabilities.
One reason for the command line’s growing popularity is the cost of MCP. Tool definitions must be included in the context for every conversational turn, and the more services are connected, the less room remains for reasoning. In its launch announcement, Google Workspace CLI specifically mentioned avoiding MCP’s “context tax.” Its approach is to have the agent first read a lightweight skill file, then execute a command and receive clean JSON in return.
However, Google Workspace CLI also includes a built-in MCP service, so the two approaches currently coexist.
03 The Users Have Changed, and the Software Business Is Changing With Them
The shift is already visible in some companies’ backend data.
In May 2025, Databricks announced its acquisition of serverless Postgres database company Neon. Multiple media outlets reported that the transaction was worth approximately $1 billion. Databricks disclosed that when Neon officially became commercially available, about 30% of its databases were created by AI agents. Internal data from before the acquisition showed that the figure had already exceeded 80%.
Databricks co-founder and CEO Ali Ghodsi said: “The era of AI-native, agent-driven applications is reshaping what databases need to do.”
Neon’s product was built around this idea. Databases created in bulk by agents and shut down immediately after use need instances to start in under 500 milliseconds and billing based on actual usage. Agents do not care whether the console is well designed.
The focus of software competition is shifting from interfaces to APIs.
In the past, software companies competed over how easy their interfaces were to use and whether they could retain users’ attention. Now there is another set of questions: Will agents choose you? Are your calls reliable? When something goes wrong, can agents understand the error messages?
This also explains why Google is willing to name its competitors in gemini-api’s documentation.
Model providers charge by the token, and regardless of which agent initiates a call, the revenue is credited to Gemini. Every time users of Claude Code, Codex, or Cursor generate an image, transcribe audio, or launch Deep Research through gemini-api, they consume Gemini API quota.
The command line is one of the earliest forms of human-computer interaction. After four decades of widespread graphical interfaces, it had retreated to programmers’ computers. Less than two years after agents emerged, it has once again become one of the main ways software exposes its capabilities to the outside world.
This article is from the WeChat public account “Hard AI,” written by Zhuanzhu Keji Chanyan De and published by 36Kr with authorization.
AI Trends