{"id":16251171,"url":"https://github.com/alexnabokikh/tfsort","last_synced_at":"2025-04-04T18:08:15.788Z","repository":{"id":79217157,"uuid":"603065557","full_name":"AlexNabokikh/tfsort","owner":"AlexNabokikh","description":"A CLI utility to sort Terraform variables and outputs","archived":false,"fork":false,"pushed_at":"2025-02-17T17:38:47.000Z","size":3188,"stargazers_count":184,"open_issues_count":10,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T17:09:15.719Z","etag":null,"topics":["cli","go","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexNabokikh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-02-17T14:48:17.000Z","updated_at":"2025-03-19T13:15:25.000Z","dependencies_parsed_at":"2025-02-16T15:10:10.810Z","dependency_job_id":"2e2488cd-eee3-48a7-b3c5-1e767941074b","html_url":"https://github.com/AlexNabokikh/tfsort","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNabokikh%2Ftfsort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNabokikh%2Ftfsort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNabokikh%2Ftfsort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNabokikh%2Ftfsort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexNabokikh","download_url":"https://codeload.github.com/AlexNabokikh/tfsort/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"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":["cli","go","golang","terraform"],"created_at":"2024-10-10T15:09:11.682Z","updated_at":"2025-04-04T18:08:15.766Z","avatar_url":"https://github.com/AlexNabokikh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfsort\n\n[![badge-gh-ci](https://github.com/AlexNabokikh/tfsort/actions/workflows/ci.yml/badge.svg)](https://github.com/AlexNabokikh/tfsort/actions/workflows/ci.yml/badge.svg)\n[![badge-gh-release](https://github.com/AlexNabokikh/tfsort/actions/workflows/release.yml/badge.svg)](https://github.com/AlexNabokikh/tfsort/actions/workflows/release.yml/badge.svg)\n[![go-report-card](https://goreportcard.com/badge/github.com/AlexNabokikh/tfsort)](https://goreportcard.com/report/github.com/AlexNabokikh/tfsort)\n[![maintainability](https://api.codeclimate.com/v1/badges/7d6a9fee7a8775dea0d8/maintainability)](https://codeclimate.com/github/AlexNabokikh/tfsort/maintainability)\n[![test-coverage](https://api.codeclimate.com/v1/badges/7d6a9fee7a8775dea0d8/test_coverage)](https://codeclimate.com/github/AlexNabokikh/tfsort/test_coverage)\n\n![Logo](files/logo.png)\n\n`tfsort` is a command-line utility designed for meticulous engineers who prefer to keep their Terraform variables and outputs sorted in alphabetical order.\n\n`tfsort` also corrects any spacing issues between the blocks and removes any leading or trailing new lines in the file.\n\n## Contents\n\n- [demo](#demo)\n- [installation](#installation)\n  - [homebrew](#homebrew)\n  - [chocolatey (windows)](#chocolatey-windows)\n  - [binary release](#binary-release)\n  - [from source](#from-source)\n- [usage](#usage)\n- [examples](#examples)\n\n## Demo\n\n![Demo](files/demo.gif)\n\n## Installation\n\n### Homebrew\n\nTo install `tfsort` using Homebrew, run the following command:\n\n- Add the tap\n\n```bash\nbrew tap alexnabokikh/tfsort\n```\n\n- Install `tfsort`\n\n```bash\nbrew install tfsort\n```\n\n### Chocolatey (Windows)\n\nTo install `tfsort` using Chocolatey, run the following command:\n\n```bash\nchoco install tfsort\n```\n\n### Binary release\n\nTo install `tfsort`, you can download the latest binary release from the [releases page](https://github.com/AlexNabokikh/tfsort/releases).\n\n### From source\n\nAlternatively, you can build `tfsort` from the source by cloning the repository and running `go build`.\n\n## Usage\n\nThe basic usage of `tfsort` is as follows:\n\n```bash\ntfsort \u003cpath-to-tf-file\u003e [--out \u003cpath-to-output-file\u003e] [--dry-run]\n```\n\nAvailable flags:\n\n- `--out`: the path to the output file. If not provided, tfsort will overwrite the input file.\n- `--dry-run`: preview the changes without altering the original file.\n\n## Examples\n\nHere's an example of using `tfsort` to sort a Terraform file called `main.tf`:\n\n```bash\ntfsort variables.tf\n```\n\nThis will sort the resources in `variables.tf` in place.\nYou can also use the `--out` flag to specify an output file:\n\n```bash\ntfsort --file variables.tf --out sorted.tf\n```\n\nThis will create a new file called `sorted.tf` with the sorted resources.\n\n```bash\ntfsort variables.tf --dry-run\n```\n\nThis will print the sorted resources to the console without altering the original file.\n\n## Author\n\nThis project was created by [Alexander Nabokikh](https://www.linkedin.com/in/nabokih/).\n\n## License\n\nThis software is available under the following licenses:\n\n- **[Apache 2.0](https://github.com/AlexNabokikh/tfsort/blob/master/LICENSE)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexnabokikh%2Ftfsort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexnabokikh%2Ftfsort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexnabokikh%2Ftfsort/lists"}