# 使用 Homebrew, MacPorts, Nix, pacman, scoop, winget, apk 安装 krew

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

## 安装

```sh
sudo av install brew:krew
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install krew
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install krew
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#krew
```

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

- pacman (92%):

```sh
sudo pacman -S krew
```

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

- apk (92%):

```sh
sudo apk add kubectl-krew
```

  证据: Alpine Linux edge package indexes: kubectl-krew from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

### Windows

- Scoop (92%):

```sh
scoop install main/krew
```

  证据: Scoop official bucket manifest trees: bucket/krew.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Kubernetes.krew -e
```

  证据: Windows Package Manager source index: Kubernetes.krew from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:krew
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/krew>
- **版本:** 0.5.0
- **来源摘要:** Package manager for kubectl plugins
- **主页:** <https://sigs.k8s.io/krew/>
- **仓库:** <https://github.com/kubernetes-sigs/krew>
- **上游文档:** <https://sigs.k8s.io/krew/>
- **许可证:** Apache-2.0
- **源码归档:** <https://github.com/kubernetes-sigs/krew.git>
- **最后更新:** 2026-06-22T14:03:53-07:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- kubectl-krew (cli)
- kubectl-krew (别名)

## 依赖

- kubernetes-cli

## 构建依赖

- go

## 安装行为

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

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.5.0
- 管理器更新时间: 2026-06-22
- 本地数据: OK
- 上游仓库: https://github.com/kubernetes-sigs/krew
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

Krew is the Kubernetes SIG CLI package manager for kubectl plugins. It is package-nerd significant because it brings a Homebrew-like install, search, update, and index model inside the kubectl plugin ecosystem.

### 项目历史

The krew repository was created on 2018-07-12, and the first v0.1.0-alpha.1 release was published on 2018-07-30. The project README describes Krew as a package manager for kubectl plugins that helps users discover, install, and manage plugins, and helps plugin developers package and distribute plugins across platforms.

Krew exists because kubectl plugins are ordinary executables named with the kubectl- prefix and found on PATH. Kubernetes documentation describes that plugin mechanism and identifies Krew as a SIG CLI-maintained way to discover and install community plugins.

### 采用历史

Krew became the de facto index-driven distribution channel for kubectl plugins because it solved discovery and update management for a plugin system that otherwise only specifies executable naming. The Kubernetes blog recommended Krew in 2020 for plugin installation experience and discoverability.

The Krew README says that more than 200 kubectl plugins were available through Krew in the documentation state used for this 2026-07-01 batch, showing a mature plugin catalog rather than a single-tool installer.

### 使用方式

Users install Krew as the kubectl-krew plugin, add its bin directory to PATH, and then run commands such as kubectl krew search, kubectl krew install, kubectl krew list, kubectl krew update, and kubectl krew upgrade.

Plugin authors package manifests in the krew-index repository so their kubectl plugins can be discovered and installed consistently on Linux, macOS, and Windows.

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

Krew is a package manager distributed as a plugin for the tool whose plugins it manages, which makes it a neat recursive packaging artifact. It also codifies an index and lifecycle around kubectl plugins without changing kubectl's intentionally simple PATH-based plugin contract.

### 时间线

- 2018-07-12: The kubernetes-sigs/krew repository was created.
- 2018-07-30: Krew v0.1.0-alpha.1 was released.
- 2020-02-28: The Kubernetes blog recommended Krew for kubectl plugin distribution and discoverability.
- 2026-02-26: Krew v0.5.0 was released.

### Related projects

- kubectl is the host CLI whose plugin convention Krew uses. krew-index is the companion plugin index. Kubernetes SIG CLI is the community home for the project.

### 来源

- <https://github.com/kubernetes-sigs/krew>
- <https://github.com/kubernetes-sigs/krew-index>
- <https://github.com/kubernetes-sigs/krew/releases/tag/v0.1.0-alpha.1>
- <https://github.com/kubernetes-sigs/krew/releases/tag/v0.5.0>
- <https://krew.sigs.k8s.io/>
- <https://krew.sigs.k8s.io/docs>
- <https://kubernetes.io/blog/2020/02/28/bring-your-ideas-to-the-world-with-kubectl-plugins/>
- <https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/>


## 安全说明

infrastructure mutation or orchestration signal.

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

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** krew
- **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 - krew: normalized package name match | nixpkgs package indexes: pkgs/by-name/kr/krew/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - krew - 0.5.0-1: normalized package name match | Arch Linux sync databases: krew from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Find and install kubectl plugins | https://github.com/kubernetes-sigs/krew
- MacPorts - krew: normalized package name match | MacPorts ports tree: sysutils/krew/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/krew: normalized package name match | Scoop official bucket manifest trees: bucket/krew.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Kubernetes.krew: normalized package name match | Windows Package Manager source index: Kubernetes.krew from https://cdn.winget.microsoft.com/cache/source.msix
- apk - kubectl-krew - 0.5.0-r3: installed executable or alias match | Alpine Linux edge package indexes: kubectl-krew from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Find and install kubectl plugins | https://krew.sigs.k8s.io/


## 相关链接

- [Cloud CLI packages](https://pkg.so/zh-hans/cloud-clis/) - Belongs to a cloud or infrastructure command family.
- [Package publisher tools](https://pkg.so/zh-hans/package-publishers/) - Belongs to a package publishing or registry command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [kubernetes-cli](https://pkg.so/zh-hans/brew/kubernetes-cli/) - Runtime dependency declared by Homebrew.
- [go](https://pkg.so/zh-hans/brew/go/) - Build dependency declared by Homebrew.
- [kubectx](https://pkg.so/zh-hans/brew/kubectx/) - Shares pkgdb curated category or tags: cli, developer-tools, kubectl, kubernetes.
- [kubelogin](https://pkg.so/zh-hans/brew/kubelogin/) - Shares pkgdb curated category or tags: cli, developer-tools, kubectl, kubernetes.
- [kubecolor](https://pkg.so/zh-hans/brew/kubecolor/) - Shares pkgdb curated category or tags: cli, developer-tools, kubectl, kubernetes.
- [kubecm](https://pkg.so/zh-hans/brew/kubecm/) - Shares pkgdb curated category or tags: cli, developer-tools, kubectl, kubernetes.
- [kubergrunt](https://pkg.so/zh-hans/brew/kubergrunt/) - Shares pkgdb curated category or tags: cli, developer-tools, kubectl, kubernetes.
- [kubectl-tree](https://pkg.so/zh-hans/brew/kubectl-tree/) - Shares pkgdb curated category or tags: cli, developer-tools, kubectl, kubernetes.
- [kubeconform](https://pkg.so/zh-hans/brew/kubeconform/) - Shares pkgdb curated category or tags: cli, developer-tools, kubernetes.
- [minikube](https://pkg.so/zh-hans/brew/minikube/) - Shares pkgdb curated category or tags: cli, developer-tools, kubernetes.

## Combined YAML source

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


## 来源

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