# 使用 Homebrew, Nix 安装 kubectl-ai

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

## 安装

```sh
sudo av install brew:kubectl-ai
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install kubectl-ai
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#kubectl-ai
```

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

## 软件包事实

- **软件包键:** brew:kubectl-ai
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/kubectl-ai>
- **版本:** 0.0.31
- **来源摘要:** AI powered Kubernetes Assistant
- **主页:** <https://github.com/GoogleCloudPlatform/kubectl-ai>
- **仓库:** <https://github.com/GoogleCloudPlatform/kubectl-ai>
- **许可证:** Apache-2.0
- **源码归档:** <https://github.com/GoogleCloudPlatform/kubectl-ai/archive/refs/tags/v0.0.31.tar.gz>
- **最后更新:** 2026-07-27T21:58:44+02:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- kubectl-ai (cli)
- kubectl-ai (别名)

## 构建依赖

- go

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.0.31
- 管理器更新时间: 2026-07-27
- 本地数据: OK
- 上游仓库: https://github.com/GoogleCloudPlatform/kubectl-ai
- 检测到的最新版本: v0.0.31 (当前)
## 项目历史与用法

kubectl-ai is Google's AI-assisted Kubernetes command-line assistant. It translates natural-language intent into Kubernetes operations and can run as an interactive shell, stdin-driven command, kubectl plugin via Krew, MCP client, or MCP server.

### 项目历史

The GitHub repository was created on 2025-01-20 under the GoogleCloudPlatform organization. Its README framed the tool around making Kubernetes management more accessible by turning user intent into precise operations, while still requiring kubectl to be installed and configured.

The project evolved quickly through many 0.0.x releases during 2025 and early 2026, adding provider breadth and integration modes rather than presenting itself as a stable, long-lived Kubernetes subcommand.

### 采用历史

kubectl-ai sits at the intersection of two high-adoption operator habits: kubectl-centric cluster work and AI-assisted terminal workflows. The README documents Gemini, Vertex AI, Azure OpenAI, OpenAI, Grok, Bedrock, Ollama, and llama.cpp support, which made the tool usable across hosted and local model setups.

The repository metadata observed on 2026-07-01 showed more than 7000 GitHub stars, a strong early signal for a project created in 2025.

### 使用方式

Users run `kubectl-ai` interactively, pass a task as an argument with quiet mode, pipe prompt text through stdin, or install it as the `kubectl ai` plugin via Krew. The README also describes environment-variable API keys for hosted providers and local model options for Ollama and llama.cpp.

Its package-manager role is to put an AI command generator and executor beside kubectl rather than inside the cluster, so installation is a developer-workstation concern.

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

For package nerds, kubectl-ai is a marker of the 2025 shift from Kubernetes CLIs that only wrap APIs to CLIs that broker human intent through LLM providers. The package is interesting because it carries both classic kubectl-plugin distribution and newer MCP integration in one small binary workflow.

### 时间线

- 2025-01-20: GitHub repository created.
- 2025: README documented Krew installation as `kubectl krew install ai` and invocation as `kubectl ai`.
- 2025-11-03: Release v0.0.27 published.
- 2026-01-21: Release v0.0.29 published.
- 2026-03-27: Release v0.0.31 published.

### Related projects

- kubectl, Krew, MCP, Gemini, Vertex AI, OpenAI-compatible APIs, Bedrock, Ollama, and llama.cpp form the surrounding ecosystem. Unlike kubectl plugins that expose one Kubernetes resource domain, kubectl-ai is a general assistant layered over Kubernetes operations.

### 来源

- <https://api.github.com/repos/GoogleCloudPlatform/kubectl-ai>
- <https://github.com/GoogleCloudPlatform/kubectl-ai>
- <https://github.com/GoogleCloudPlatform/kubectl-ai#readme>
- <https://github.com/GoogleCloudPlatform/kubectl-ai/tree/main/docs>
- <https://krew.sigs.k8s.io/docs/user-guide/setup/install/>
- <https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/>


## 安全说明

infrastructure mutation or orchestration signal.

- **Geiger 风险:** orange / 中
- infrastructure mutation or orchestration signal


## 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

- Unix: ~/.config/kubectl-ai/config.yaml, ~/.config/kubectl-ai/tools.yaml, ~/.config/kubectl-ai/mcp.yaml, ~/.kube/config
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** kubectl-ai
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Nix - kubectl-ai: normalized package name match | nixpkgs package indexes: pkgs/by-name/ku/kubectl-ai/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 相关链接

- [Cloud CLI packages](https://pkg.so/zh-hans/cloud-clis/) - Belongs to a cloud or infrastructure command family.
- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [MCP tool packages](https://pkg.so/zh-hans/mcp-tools/) - Mentions MCP or Model Context Protocol.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [go](https://pkg.so/zh-hans/brew/go/) - Build dependency declared by Homebrew.
- [ollama](https://pkg.so/zh-hans/brew/ollama/) - Shares pkgdb curated category or tags: ai, cli, llm, model-tools.
- [llmfit](https://pkg.so/zh-hans/brew/llmfit/) - Shares pkgdb curated category or tags: ai, cli, llm, model-tools.
- [ramalama](https://pkg.so/zh-hans/brew/ramalama/) - Shares pkgdb curated category or tags: ai, cli, llm, model-tools.
- [promptfoo](https://pkg.so/zh-hans/brew/promptfoo/) - Shares pkgdb curated category or tags: ai, cli, llm, model-tools.
- [localai](https://pkg.so/zh-hans/brew/localai/) - Shares pkgdb curated category or tags: ai, cli, llm, model-tools.
- [k8sgpt](https://pkg.so/zh-hans/brew/k8sgpt/) - Shares pkgdb curated category or tags: ai, cli, kubernetes, model-tools.
- [oterm](https://pkg.so/zh-hans/brew/oterm/) - Shares pkgdb curated category or tags: ai, cli, llm, model-tools.
- [gollama](https://pkg.so/zh-hans/brew/gollama/) - Shares pkgdb curated category or tags: ai, cli, llm, model-tools.
- [sysaidmin](https://pkg.so/zh-hans/brew/sysaidmin/) - Local package facts share a topical domain. Shared terms: ai, cli, llm, model, model-tools.
- [cai](https://pkg.so/zh-hans/brew/cai/) - Local package facts share a topical domain. Shared terms: ai, cli, llm, model, model-tools.

## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
