# 使用 Homebrew, MacPorts, Nix, scoop 安装 k2tf

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

## 安装

```sh
sudo av install brew:k2tf
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install k2tf
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install k2tf
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#k2tf
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/k2tf
```

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

## 软件包事实

- **软件包键:** brew:k2tf
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/k2tf>
- **版本:** 0.8.0
- **来源摘要:** Kubernetes YAML to Terraform HCL converter
- **主页:** <https://github.com/sl1pm4t/k2tf>
- **仓库:** <https://github.com/sl1pm4t/k2tf>
- **许可证:** MPL-2.0
- **源码归档:** <https://github.com/sl1pm4t/k2tf/archive/refs/tags/v0.8.0.tar.gz>
- **最后更新:** 2026-07-27T21:58:34+02:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- k2tf (cli)
- k2tf (别名)

## 构建依赖

- go

## 安装行为

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

## 版本和新鲜度

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

k2tf is a focused converter that turns Kubernetes API objects written as YAML into Terraform HCL suitable for the Terraform Kubernetes provider.

### 项目历史

The project started publishing releases in February 2019. Its README defines a narrow purpose: convert Kubernetes YAML into Terraform configuration rather than manage clusters or replace Terraform itself.

### 采用历史

k2tf fits teams that already have Kubernetes manifests but want Terraform-managed resources. Its adoption is niche because the need is specific, but package-manager presence in Homebrew, MacPorts, Nix, and Scoop shows enough CLI demand to keep it distributed.

### 使用方式

Users feed Kubernetes YAML files or directories to `k2tf` and receive `.tf` output compatible with the Terraform Kubernetes provider. It is most useful during migrations from manifest-based workflows to Terraform-managed Kubernetes resources.

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

k2tf is a small but very package-nerdy bridge tool: it exists because two declarative ecosystems, Kubernetes YAML and Terraform HCL, overlap without sharing a native file format.

### 时间线

- 2019: k2tf v0.1.0 was released in February.
- 2021: v0.6.0 updated the Terraform Kubernetes provider dependency and noted Homebrew core migration documentation.
- 2024: v0.8.0 was published.

### Related projects

- k2tf is related to the Terraform Kubernetes provider, Kubernetes manifests, and sibling conversion tools such as tfk8s.

### 来源

- <https://github.com/jrhouston/tfk8s>
- <https://github.com/sl1pm4t/k2tf>
- <https://github.com/sl1pm4t/k2tf/releases/tag/v0.1.0>
- <https://github.com/sl1pm4t/k2tf/releases/tag/v0.6.0>
- <https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs>


## 安全说明

infrastructure mutation or orchestration signal.

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

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** k2tf
- **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 - k2tf: normalized package name match | nixpkgs package indexes: pkgs/by-name/k2/k2tf/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - k2tf: normalized package name match | MacPorts ports tree: sysutils/k2tf/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/k2tf: normalized package name match | Scoop official bucket manifest trees: bucket/k2tf.json from https://api.github.com/repos/ScoopInstaller/Main/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.
- [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.
- [go](https://pkg.so/zh-hans/brew/go/) - Build dependency declared by Homebrew.
- [tfk8s](https://pkg.so/zh-hans/brew/tfk8s/) - Shares pkgdb curated category or tags: cli, converter, developer-tools, hcl, kubernetes.
- [yj](https://pkg.so/zh-hans/brew/yj/) - Shares pkgdb curated category or tags: cli, developer-tools, hcl, yaml.
- [kube-linter](https://pkg.so/zh-hans/brew/kube-linter/) - Shares pkgdb curated category or tags: cli, developer-tools, kubernetes, yaml.
- [hcl2json](https://pkg.so/zh-hans/brew/hcl2json/) - Shares pkgdb curated category or tags: cli, developer-tools, hcl, terraform.
- [ytt](https://pkg.so/zh-hans/brew/ytt/) - Shares pkgdb curated category or tags: cli, developer-tools, kubernetes, yaml.
- [hcledit](https://pkg.so/zh-hans/brew/hcledit/) - Shares pkgdb curated category or tags: cli, developer-tools, hcl, terraform.
- [kubergrunt](https://pkg.so/zh-hans/brew/kubergrunt/) - Shares pkgdb curated category or tags: cli, developer-tools, kubernetes, terraform.
- [iam-policy-json-to-terraform](https://pkg.so/zh-hans/brew/iam-policy-json-to-terraform/) - Shares pkgdb curated category or tags: cli, converter, developer-tools, infrastructure-as-code, terraform.
- [tf-profile](https://pkg.so/zh-hans/brew/tf-profile/) - Local package facts share a topical domain. Shared terms: cli, code, developer, developer-tools, infrastructure.
- [tf-summarize](https://pkg.so/zh-hans/brew/tf-summarize/) - Local package facts share a topical domain. Shared terms: cli, code, developer, developer-tools, infrastructure.

## Combined YAML source

View the package source record on GitHub. [combined/k2tf.yml](https://github.com/mxcl/pkgdb/blob/main/combined/k2tf.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
