# 使用 Homebrew 安装 tfclean

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

## 安装

```sh
sudo av install brew:tfclean
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install tfclean
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:tfclean
- **软件包管理器:** Homebrew
- **版本:** 0.0.19
- **来源摘要:** Remove applied moved block, import block, etc
- **主页:** <https://github.com/takaishi/tfclean>
- **仓库:** <https://github.com/takaishi/tfclean>
- **最后更新:** 2026-07-26T00:50:38+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- tfclean (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

tfclean is a Terraform cleanup CLI that removes applied `moved`, `import`, and `removed` blocks from configuration files. It targets the maintenance phase after refactors or imports have already been applied.

### 项目历史

The repository began in June 2024 with an initial implementation, README, and import-block support. v0.0.1 was tagged on 2024-07-01, and the changelog shows rapid iteration through parsing fixes and support for more Terraform block types.

By v0.0.4 the project had support for `removed` blocks and forced removal of all block types. Later releases added flags, pre-commit support, GitHub Action installation, aqua installation docs, S3 backend auto-detection, and parser refactoring.

### 采用历史

The README documents installation through the author's Homebrew tap, `go install`, aqua, GitHub Actions, and release binaries. It also includes a GitHub Actions workflow that runs tfclean and opens a pull request when cleanup changes are detected.

### 使用方式

Users point `tfclean` at a directory of Terraform files to remove all relevant blocks, or pass `--tfstate` so it removes only blocks that have already been applied. With S3 backends, the tool can detect state location from Terraform backend configuration in `.tf` files.

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

tfclean is a package-nerd maintenance tool: it exists because modern Terraform/OpenTofu workflows produce temporary declarative migration blocks that should eventually disappear. Installing it as a CLI or GitHub Action lets teams automate that cleanup without hand-editing HCL.

### 时间线

- 2024-06-24: Repository initialized
- 2024-06-27: Import-block support commit
- 2024-07-01: v0.0.1 release
- 2024-08-31: v0.0.4 added removed-block and force-removal work
- 2025-07-19: v0.0.10 added GitHub Action support
- 2025-11-30: v0.0.15 added S3 backend auto-detection
- 2026-05-14: v0.0.18 release

### Related projects

- Terraform supplies the configuration files and state model tfclean inspects.
- GitHub Actions integration is documented for automated cleanup pull requests.
- aqua is documented as a declarative CLI version-manager installation path.

### 来源

- Official git tags and commit history from https://github.com/takaishi/tfclean
- <https://github.com/takaishi/tfclean/blob/main/CHANGELOG.md>
- <https://github.com/takaishi/tfclean/blob/main/README.md>


## 安全说明

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



## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- cross-ecosystem install command graph
