{"id":13515452,"url":"https://github.com/dex4er/tf","last_synced_at":"2025-04-09T15:05:51.843Z","repository":{"id":137438478,"uuid":"527537343","full_name":"dex4er/tf","owner":"dex4er","description":"Less verbose and more shell friendly Terraform","archived":false,"fork":false,"pushed_at":"2025-04-09T05:01:51.000Z","size":28378,"stargazers_count":78,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T15:05:42.476Z","etag":null,"topics":["cloud","devops","golang","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dex4er.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-22T11:37:28.000Z","updated_at":"2025-03-24T01:49:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7981a84-4d6e-469d-9a2c-5feaa9bbae43","html_url":"https://github.com/dex4er/tf","commit_stats":{"total_commits":200,"total_committers":2,"mean_commits":100.0,"dds":0.08499999999999996,"last_synced_commit":"3c7048c6fd0a5164e3ab6d8b9c244f881258f236"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dex4er%2Ftf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dex4er%2Ftf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dex4er%2Ftf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dex4er%2Ftf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dex4er","download_url":"https://codeload.github.com/dex4er/tf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","devops","golang","terraform"],"created_at":"2024-08-01T05:01:11.508Z","updated_at":"2025-04-09T15:05:51.821Z","avatar_url":"https://github.com/dex4er.png","language":"Go","readme":"# tf\n\n[![GitHub](https://img.shields.io/github/v/release/dex4er/tf?display_name=tag\u0026sort=semver)](https://github.com/dex4er/tf)\n[![Test](https://github.com/dex4er/tf/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/dex4er/tf/actions/workflows/test.yaml)\n[![Trunk Check](https://github.com/dex4er/tf/actions/workflows/trunk-check.yaml/badge.svg?branch=main)](https://github.com/dex4er/tf/actions/workflows/trunk-check.yaml)\n[![OSV Scanner](https://github.com/dex4er/tf/actions/workflows/osv-scanner.yaml/badge.svg?branch=main)](https://github.com/dex4er/tf/actions/workflows/osv-scanner.yaml)\n\nLess verbose and more shell-friendly Terraform.\n\n| Better this:                                               | Than this:                                                             |\n| ---------------------------------------------------------- | ---------------------------------------------------------------------- |\n| [![tf apply -compact](assets/tf-small.gif)](assets/tf.gif) | [![terraform apply](assets/terraform-small.gif)](assets/terraform.gif) |\n\nThe original Terraform is abusively oververbosed. The `tf` wrapper makes\nTerraform more CLI-friendly:\n\n- removes unnecessary output\n- adds own colored progress indicator\n- provides an extra compact mode\n- allows to use of multiple arguments when original command doesn't support it\n- adds automatically quotes for indexed resources (`xargs` friendly)\n- generates a log file when `TF_OUTPUT_PATH` environment variable is used\n\n## Install\n\nDownload from [releases](https://github.com/dex4er/tf/releases). Put anywhere\nin the `$PATH`.\n\n### asdf\n\nInstall with [asdf](https://asdf-vm.com/):\n\n```sh\nasdf plugin-add tf https://github.com/dex4er/asdf-tf.git\nasdf install tf latest\nasdf global tf latest\n```\n\n### mise\n\nInstall with [mise-en-place](https://mise.jdx.dev/):\n\n```sh\nmise plugins install tf https://github.com/dex4er/asdf-tf.git\nmise use -g tf@latest\n```\n\n### Homebrew\n\nInstall with [homebrew](https://brew.sh/):\n\n```sh\nbrew tap dex4er/tap\nbrew install tf\n```\n\n### Zsh\n\nWith Zsh `noglob` should be used to prevent errors when indexed parameters\nare arguments for `tf` command.\n\nAdd to `~/.zshenv`:\n\n```sh\nalias tf='noglob tf'\n```\n\nYou can use re-use Oh My Zsh plugin dedicated to the original Terraform:\n\n```sh\ncompdef _terraform tf\n```\n\n## Usage\n\n```sh\ntf init\ntf plan\ntf apply\ntf list\ntf show\n```\n\netc...\n\nYou can combine commands, ie.:\n\n```sh\ntf apply $(tf list | grep aws_vpc)\ntf list | grep data.aws_region.current | xargs tf refresh\ntf list | grep random_password | xargs tf rm\ntf list | grep aws_subnet | xargs tf show\ntf list | grep module.one | while read r; do echo tf mv $r ${r/module.one./module.two.}; done | bash -x\ntf list | fzf | xargs tf show | highlight -O xterm256 --syntax terraform\n```\n\nIt is recommended to use `$()` rather than `xargs` for `tf apply` or `tf destroy` because these commands are interactive.\n\nFor not recognized commands `tf` passes all arguments to `terraform` command.\n\n`terraform` command might be replaced with another using `TERRAFORM_PATH`\nenvironment variable, ie.:\n\n```sh\nexport TERRAFORM_PATH=tofu\n```\n\n`terraform` command is replaced if `.opentofu-version` file exists in the\ncurrent directory or in one of the parents directories and there was no\n`.terraform-version` file in the directory earlier.\n\n### `tf apply`\n\nThe same as `terraform apply` with less verbose output.\n\nInstead of Reading/Creating/Destroying... messages it will show a short progress\nindicator.\n\nIt will skip `(known after apply)` lines from the `-short` mode output. Also\nit will hide a plan for data sources (`data.xxx will be read during apply`\nblocks) from the `-short` and `-compact` mode output.\n\nAdditional options can be used: `-counters` shows counters with processed\nresources, `-compact` skips the content of the resources, `-short` removes\nunecessary lines (default), `-full` keeps original manifest, `-fan` hides\nmessages about progress and shows short indicator (default), `-dots` hides\nmessages about progress and shows single dot or character for each line,\n`-verbatim` keeps original messages about progress, `-verbose` adds counters\nto original messages (default if `TF_IN_AUTOMATION=1`), `-no-outputs` hides\noutputs (default, `-no-outputs=false` shows it again).\n\nThe command accepts the resource name as an argument without `-target=`\noption. If the argument misses quotes inside square brackets then they will\nbe added.\n\nThe command will log to the file named in `TF_OUTPUT_PATH` environment\nvariable. The file name is resolved with `strftime`'s `%` sequences.\n\nThe variable `TF_PLAN_FORMAT` switches the default format for the plan\n(compact, short, full). The variable `TF_PROGRESS_FORMAT` switches the\ndefault format for the progress indicator (counters, fan, dots, verbose,\nverbatim).\n\n### `tf destroy`\n\nThe same as `terraform destroy` with less verbose output.\n\nInstead of Reading/Creating/Destroying... messages it will show a short progress\nindicator.\n\nIt will skip `(known after apply)` lines from the `-short` mode output. Also\nit will hide a plan for data sources (`data.xxx will be read during apply`\nblocks) from the `-short` and `-compact` mode output.\n\nAdditional options can be used: `-counters` shows counters with processed\nresources, `-compact` skips the content of the resources, `-`short`removes\nunnecessary lines (default),`-full`keeps original manifest,`-fan`hides\nmessages about progress and shows short indicator (default),`-dots`hides\nmessages about progress and shows single dot or character for each line,`-verbatim`keeps original messages about progress,`-verbose`adds counters\nto original messages (default if`TF_IN_AUTOMATION=1`), `-no-outputs`hides\noutputs (default,`-no-outputs=false` shows it again).\n\nThe command accepts the resource name as an argument without `-target=`\noption. If the argument misses quotes inside square brackets then they will\nbe added.\n\nThe command will log to the file named in `TF_OUTPUT_PATH` environment\nvariable. The file name is resolved with `strftime`'s `%` sequences.\n\nThe variable `TF_PLAN_FORMAT` switches the default format for the plan\n(compact, short, full). The variable `TF_PROGRESS_FORMAT` switches the\ndefault format for the progress indicator (counters, fan, dots, verbose,\nverbatim).\n\n### `tf import`\n\nThe same as `terraform import` with better handling of arguments.\n\nIf the first argument misses quotes inside square brackets then they will be\nadded.\n\nThe command appends the third argument and more to the second with a space as\nthe separator.\n\nThe `tf show` for this resource is run after import unless additional option\n`-no-show` has been used.\n\n### `tf init`\n\nThe same as `terraform init` with less verbose output.\n\nThe command will log to the file named in `TF_OUTPUT_PATH` environment\nvariable. The file name is resolved with `strftime`'s `%` sequences.\n\nAdditional option `-codesign` causes that all providers will have replaced\nexisting signature and checksums will be removed from the lock file. It will\nallow to run providers by Terraform on MacOS when the system blocks\napplications with unrecognized signature.\n\n### `tf list`\n\nThe same as `terraform state list` with less verbose output and ANSI stripped.\n\nIf the argument misses quotes inside square brackets then they will be added.\n\n### `tf mv`\n\nThe same as `terraform state mv` with less verbose output.\n\nIf the argument misses quotes inside square brackets then they will be added.\n\n### `tf plan`\n\nThe same as `terraform plan` with less verbose output.\n\nInstead of Reading... messages it will show a short progress indicator.\n\nIt will skip `(known after apply)` lines from the `-short` mode output. Also,\nit will hide a plan for data sources (`data.xxx will be read during apply`\nblocks) from the `-short` and `-compact` mode output.\n\nAdditional options can be used: `-counters` shows counters with processed\nresources, `-compact` skips the content of the resources, `-short` removes\nunnecessary lines (default), `-full` keeps original manifest, `-fan` hides\nmessages about progress and shows short indicator (default), `-dots` hides\nmessages about progress and shows single dot or character for each line,\n`-verbatim` keeps original messages about progress, `-verbose` adds counters\nto original messages (default if `TF_IN_AUTOMATION=1`).\n\nThe command accepts the resource name as an argument without `-target=`\noption. If the argument misses quotes inside square brackets then they will\nbe added.\n\nThe command will log to the file named in `TF_OUTPUT_PATH` environment\nvariable. The file name is resolved with `strftime`'s `%` sequences.\n\nThe variable `TF_PLAN_FORMAT` switches the default format for the plan\n(compact, short, full). The variable `TF_PROGRESS_FORMAT` switches the\ndefault format for the progress indicator (counters, fan, dots, verbose,\nverbatim).\n\n### `tf refresh`\n\nThe same as `terraform refresh` with less verbose output.\n\nAdditional options can be used: `-counters` shows counters with processed\nresources, `-compact` skips the content of the resources, `-short` removes\nunnecessary lines (default), `-full` keeps original manifest, `-fan` hides\nmessages about progress and shows short indicator (default), `-dots` hides\nmessages about progress and shows single dot or character for each line,\n`-verbatim` keeps original messages about progress, `-verbose` adds counters\nto original messages (default if `TF_IN_AUTOMATION=1`), `-no-outputs` hides\noutputs (default, `-no-outputs=false` shows it again).\n\nThe command accepts resource name as an argument without `-target=` option.\nIf the argument misses quotes inside square brackets then they will be added.\n\nThe command will log to the file named in `TF_OUTPUT_PATH` environment\nvariable. The file name is resolved with `strftime`'s `%` sequences.\n\nThe variable `TF_PLAN_FORMAT` switches the default format for the plan\n(compact, short, full). The variable `TF_PROGRESS_FORMAT` switches the\ndefault format for the progress indicator (counters, fan, dots, verbose,\nverbatim).\n\n### `tf rm`\n\nThe same as `terraform state rm` with less verbose output.\n\nThe command accepts multiple arguments. If the argument misses quotes inside\nsquare brackets then they will be added.\n\n### `tf show`\n\nThe same as `terraform show` and `terraform state show` with less verbose output\nand ANSI stripped.\n\n`terraform show` is used when the command is run without arguments and\n`terraform state show` when arguments are used.\n\nThe command accepts multiple arguments. If the argument misses quotes inside\nsquare brackets then they will be added.\n\nAn additional option can be used: `-no-outputs` hides outputs (default,\n`-no-outputs=false` shows it again).\n\n### `tf taint`\n\nThe same as `terraform taint` and it accepts multiple arguments. If the\nargument misses quotes inside square brackets then they will be added.\n\n### `tf untaint`\n\nThe same as `terraform untaint` and it accepts multiple arguments. If the\nargument misses quotes inside square brackets then they will be added.\n\n### `tf upgrade`\n\nThe same as `terraform init -upgrade` with less verbose output.\n\nThe command will log to the file named in `TF_OUTPUT_PATH` environment\nvariable. The file name is resolved with `strftime`'s `%` sequences.\n\nAdditional option `-codesign` causes that all providers will have replaced\nexisting signature and checksums will be removed from the lock file. It will\nallow to run providers by Terraform on MacOS when the system blocks\napplications with unrecognized signature.\n\n## License\n\nCopyright (c) 2020-2025 Piotr Roszatycki \u003cpiotr.roszatycki@gmail.com\u003e\n\n[MIT](https://opensource.org/licenses/MIT)\n","funding_links":[],"categories":["Tools"],"sub_categories":["Wrappers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdex4er%2Ftf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdex4er%2Ftf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdex4er%2Ftf/lists"}