# 使用 Homebrew, MacPorts, Nix, pacman, zypper 安装 gemini-cli

查看 gemini-cli 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:gemini-cli
```

## 代理安全回答

gemini-cli is an AI CLI that can combine model access with local files and tool calls.

- **凭据访问:** Reads model API credentials, environment variables, and files included in prompts.
- **远程变更:** Can drive local commands or API calls if granted tool access.
- **发布/制品风险:** Can generate code and release commands that become artifacts.
- **推荐控制:** Run in containment and gate all secret-backed or mutating commands.
- **代理使用指南:** Limit file scope and require approval before exposing secrets or running deployment tools.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install gemini-cli
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install gemini-cli
```

  证据: MacPorts ports tree: llm/gemini-cli/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#gemini-cli
```

  证据: nixpkgs package indexes: pkgs/by-name/ge/gemini-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S gemini-cli
```

  证据: Arch Linux sync databases: gemini-cli from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install gemini-cli
```

  证据: openSUSE Tumbleweed package metadata: gemini-cli from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:gemini-cli
- **软件包管理器:** Homebrew
- **版本:** 0.46.0
- **来源摘要:** Interact with Google Gemini AI models from the command-line
- **主页:** <https://geminicli.com>
- **最后更新:** 2026-06-15T10:20:17-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- gemini (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.46.0
## 项目历史与用法

Gemini CLI is Google's open-source terminal agent for interacting with Gemini models from the command line. It became significant quickly because Google launched it as an Apache-2.0 project with free individual access, Code Assist integration, built-in tools, and package-manager distribution through npm and Homebrew.

### 项目历史

Google announced Gemini CLI on June 25, 2025 as an open-source AI agent that brings Gemini into developers' terminals. The launch positioned the CLI as a local utility for coding, content generation, research, problem solving, and task management rather than only as a chat wrapper.

The public repository developed around a terminal-first workflow: installation through npm or Homebrew, documented release channels, configuration through settings files and `GEMINI.md`, support for non-interactive invocation, and integration points such as MCP servers and extensions.

### 采用历史

Gemini CLI's adoption path was tied to Google's Gemini Code Assist product line. The launch article stated that the tool shared technology with Gemini Code Assist, giving developers prompt-driven AI help in both VS Code and the terminal.

Package-manager adoption followed the developer-tool pattern: the README documents global npm installation, `npx` execution, Homebrew installation, and MacPorts packaging. That made the CLI visible both to JavaScript users and to developers who expect AI tools to install like ordinary command-line utilities.

### 使用方式

Practitioners use Gemini CLI inside source trees to ask questions about code, edit files, run shell commands, debug failures, generate applications from multimodal inputs, and automate tasks from scripts. The tool also supports Google Search grounding, file operations, web fetching, conversation checkpointing, and project-specific context files.

Teams use the CLI alongside Gemini Code Assist and GitHub workflows, while individual users often treat it as a terminal-native coding assistant that can operate without leaving the shell.

### 为什么软件包爱好者会关心

For package nerds, Gemini CLI is a marker of AI coding tools becoming ordinary CLI packages. It is distributed through language-package tooling and system package managers, has documented stable, preview, and nightly release channels, and exposes configuration paths that matter for reproducible developer environments.

### 时间线

- 2025-06-25: Google announces Gemini CLI as an open-source AI agent for the terminal.
- 2025: The repository publishes early preview, stable, and nightly release-channel tags.
- 2025: Homebrew, MacPorts, npm, and other package-manager entries make the tool installable through common developer workflows.

### Related projects

- Gemini CLI is related to Gemini Code Assist, Google AI Studio, Vertex AI, MCP servers, and the broader family of terminal AI agents used for code navigation and automation.

### 来源

- <https://blog.google/innovation-and-ai/technology/developers-tools/introducing-gemini-cli-open-source-ai-agent/>
- <https://formulae.brew.sh/formula/gemini-cli>
- <https://github.com/google-gemini/gemini-cli>
- <https://github.com/google-gemini/gemini-cli/blob/main/README.md>
- <https://github.com/google-gemini/gemini-cli/tree/main/docs>


## 安全说明

没有找到 gemini-cli 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。

- **审批门规则:** 5


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Linux: ~/.gemini/settings.json, .gemini/settings.json, /etc/gemini-cli/settings.json, /etc/gemini-cli/system-defaults.json
- macOS: ~/.gemini/settings.json, .gemini/settings.json, /Library/Application Support/GeminiCli/settings.json, /Library/Application Support/GeminiCli/system-defaults.json
- Windows: ~/.gemini/settings.json, .gemini/settings.json, C:\ProgramData\gemini-cli\settings.json, C:\ProgramData\gemini-cli\system-defaults.json
## 其他软件包管理器记录

- Nix - gemini-cli: normalized package name match | nixpkgs package indexes: pkgs/by-name/ge/gemini-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - gemini-cli - 1:0.50.0-1: normalized package name match | Arch Linux sync databases: gemini-cli from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Open-source AI agent that brings the power of Gemini directly into your terminal | https://github.com/google-gemini/gemini-cli
- zypper - gemini-cli - 0.53.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: gemini-cli from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | An AI agent that brings the power of Gemini directly into your terminal | https://github.com/google-gemini/gemini-cli
- MacPorts - gemini-cli: normalized package name match | MacPorts ports tree: llm/gemini-cli/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/gemini-cli.yml](https://github.com/mxcl/pkgdb/blob/main/combined/gemini-cli.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- approval-gate seed metadata
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
