Gemini CLI is an open-source artificial intelligence agent developed by Google that provides access to Gemini models through a command-line interface. It combines conversational prompts with tools for reading and modifying files, executing shell commands, retrieving web content, and searching for information. Unlike a text-only chatbot, it can perform actions in a working environment, subject to execution policies and permissions. Google introduced it on June 25, 2025. (github.com)
Origins and scope
Gemini CLI was launched as a terminal-first utility for developers, with applications extending beyond programming to content generation, research, and task management. Its initial announcement featured access to Gemini 2.5 Pro and integration with Gemini Code Assist, Google’s coding assistant. Gemini CLI and Code Assist shared technology for prompt-driven development in terminals and editor environments. These launch details describe the original offering rather than a permanent specification of available models or service limits. (blog.google)
The client software is distributed under the Apache License 2.0. This licensing applies to the software, while access to Google’s model services is governed separately by the relevant service terms and privacy notices. An open-source client therefore does not make its connected model service an unrestricted or entirely local system. (geminicli.com)
Architecture and operation
The project is implemented primarily in TypeScript and uses Node.js as its runtime. Its repository separates the user-facing terminal interface from a core package responsible for model-service orchestration, prompt construction, and tool execution. The terminal interface uses React with Ink, a framework for rendering interactive terminal applications. (github.com)
Its operating pattern connects model-generated requests to executable tools:
- The user supplies a task and relevant context.
- The model requests a tool operation when additional information or an action is needed.
- Gemini CLI evaluates the request against its execution policies.
- An authorized tool runs and returns its result.
- The model uses that result to continue the task or produce an answer.
The distinction between generating a command and executing it is important: execution is mediated by the client’s tools and security controls, rather than being an inherent capability of the large language model. (google-gemini.github.io)
Tools and project context
Built-in capabilities include file operations, shell execution, web fetching, and Google Search grounding. In software engineering, these support tasks such as exploring an unfamiliar codebase, generating or modifying code, running tests, and investigating build errors. Search and web tools provide access to information beyond the supplied project files. (github.com)
Persistent instructions can be supplied through files named GEMINI.md. These may contain project conventions, architectural explanations, or coding-style requirements. Gemini CLI loads instructional context hierarchically, including user-level and workspace-level files, and includes the collected material in prompts sent to the model. This mechanism supplies context during use; it is not model training or fine-tuning. (geminicli.com)
Gemini CLI also supports the Model Context Protocol (MCP) for connecting external tools and services. Extensions package integrations that expand the agent’s available capabilities, including connections to databases, cloud environments, and other development services. Their functionality depends on the tools and services they expose. (github.com)
Interactive and automated use
Interactive operation provides a conversational terminal interface. Headless operation omits that interface and makes the client usable from scripts and automated workflows. A prompt supplied with -p or --prompt, or execution in a non-TTY environment, triggers headless mode. Supported outputs include text, a single JSON result, and streaming newline-delimited JSON events describing messages, tool requests, tool results, and the final outcome. (geminicli.com)
Authentication options include signing in with a Google account, using a Gemini API key, and accessing Vertex AI. Account type and authentication method affect project requirements, quotas, pricing, and applicable terms. The local terminal program and the remotely accessed service are consequently distinct parts of the deployment. (geminicli.com)
Permissions, isolation, and security
Gemini CLI’s policy engine can allow, deny, or require approval for tool calls. Under confirmation-based operation, proposed file changes or shell commands can be displayed before execution. Trusted-folder settings provide another control over access to local environments. The exact behavior depends on the active configuration and policies. (geminicli.com)
Sandboxing restricts the environment in which operations execute. Supported approaches include operating-system mechanisms and container-based isolation using Docker or Podman. A sandbox can still expose the project workspace and permitted network access: its boundary depends on the selected implementation, profile, and mounts. Isolation limits accessible resources but does not establish whether a generated change is correct. (geminicli.com)
External content introduces a separate security issue: prompt injection. In this attack class, untrusted input attempts to redirect a model away from higher-trust instructions. Indirect attacks may place malicious instructions in documents or retrieved content. For a tool-enabled agent, the relevant risk includes unintended actions as well as unwanted text output; permission policies and execution boundaries address different parts of that risk. (csrc.nist.gov)
Data handling
Data privacy is governed partly by the connected service, not solely by the client’s source-code license. Google-account access through Gemini Code Assist, unpaid or paid Gemini API access, and Vertex AI access have different applicable terms and privacy notices. Gemini CLI also has usage-statistics controls, including an opt-out mechanism. Disabling client usage statistics is distinct from changing the data-handling terms of the model service. (geminicli.com)
References
- Google announces Gemini CLI: your open-source AI agentblog.google
- GitHub - google-gemini/gemini-cli: An open-source AI agent that brings the power of Gemini directly into your terminal.github.com
- gemini-cli/GEMINI.md at main · google-gemini/gemini-cli · GitHubgithub.com
- gemini-cli/docs/reference/tools.md at main · google-gemini/gemini-cli · GitHubgithub.com
- Gemini CLI toolsgoogle-gemini.github.io
- Provide context with GEMINI.md filesgeminicli.com
- Gemini CLI extensions let you customize your command lineblog.google
- Headless mode referencegeminicli.com
- Gemini CLI authentication setupgeminicli.com
- Policy enginegeminicli.com
- Sandboxing in Gemini CLIgeminicli.com
- Gemini CLI: License, Terms of Service, and Privacy Noticesgeminicli.com