# Install tfclean with Homebrew

Remove applied moved block, import block, etc. Version 0.0.18 via Homebrew; verified 2026-06-14.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install tfclean
```

  Evidence: local Homebrew formula metadata

## Package facts

- **Package key:** brew:tfclean
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/tfclean>
- **Version:** 0.0.18
- **Source summary:** Remove applied moved block, import block, etc
- **Homepage:** <https://github.com/takaishi/tfclean>
- **Repository:** <https://github.com/takaishi/tfclean>
- **Upstream docs:** <https://github.com/takaishi/tfclean#readme>
- **License:** MIT
- **Source archive:** <https://github.com/takaishi/tfclean/archive/refs/tags/v0.0.18.tar.gz>
- **Last updated:** 2026-06-14T15:13:52+02:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- tfclean (cli)
- tfclean (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.0.18
- Package-manager updated: 2026-06-14
- Local data: ok
- Upstream repository: https://github.com/takaishi/tfclean
- Upstream latest detected: v0.0.18 (current)
## Project history and usage

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.

### Project history

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.

### Adoption history

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.

### How it is used

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.

### Why package nerds care

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.

### Timeline

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

### Sources

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


## Security Notes

No matching local secret-handling manifest was found for tfclean. Nucleus package metadata is still published here so future coverage has a stable package URL.


## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** tfclean
- **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


## Related links

- [Cloud CLI packages](https://www.automicvault.com/pkg/cloud-clis/) - Belongs to a cloud or infrastructure command family.
- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [tfautomv](https://www.automicvault.com/pkg/brew/tfautomv/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, moved-blocks, terraform.
- [iam-policy-json-to-terraform](https://www.automicvault.com/pkg/brew/iam-policy-json-to-terraform/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [terraform-docs](https://www.automicvault.com/pkg/brew/terraform-docs/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tf-profile](https://www.automicvault.com/pkg/brew/tf-profile/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tf-summarize](https://www.automicvault.com/pkg/brew/tf-summarize/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [docker-clean](https://www.automicvault.com/pkg/brew/docker-clean/) - Shares av.db curated category or tags: cleanup, cli, developer-tools, maintenance.
- [tfcmt](https://www.automicvault.com/pkg/brew/tfcmt/) - Shares av.db curated category or tags: cli, developer-tools, terraform.
- [tfmv](https://www.automicvault.com/pkg/brew/tfmv/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, moved-blocks, terraform.

## Combined YAML source

View the package source record on GitHub. [combined/tfclean.yml](https://github.com/automic-vault/db/blob/main/combined/tfclean.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- cross-ecosystem install command graph
