{"id":19264628,"url":"https://github.com/cappyzawa/tfswitch","last_synced_at":"2025-06-27T06:39:26.873Z","repository":{"id":39290582,"uuid":"329553857","full_name":"cappyzawa/tfswitch","owner":"cappyzawa","description":"Command for switching the terraform version, which can run the terraform binary.","archived":false,"fork":false,"pushed_at":"2024-06-05T02:28:43.000Z","size":154,"stargazers_count":12,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T18:43:55.566Z","etag":null,"topics":["cli","go","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cappyzawa.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":"2021-01-14T08:33:13.000Z","updated_at":"2024-04-29T15:30:59.000Z","dependencies_parsed_at":"2024-06-19T05:29:58.954Z","dependency_job_id":"94b57799-d9a7-4335-9a8c-b5a849718f3a","html_url":"https://github.com/cappyzawa/tfswitch","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/cappyzawa/tfswitch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cappyzawa%2Ftfswitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cappyzawa%2Ftfswitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cappyzawa%2Ftfswitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cappyzawa%2Ftfswitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cappyzawa","download_url":"https://codeload.github.com/cappyzawa/tfswitch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cappyzawa%2Ftfswitch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262209660,"owners_count":23275471,"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","terraform"],"created_at":"2024-11-09T19:41:52.918Z","updated_at":"2025-06-27T06:39:26.831Z","avatar_url":"https://github.com/cappyzawa.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfswitch\n\n[![BuildStatus](https://github.com/cappyzawa/tfswitch/actions/workflows/ci.yml/badge.svg)](https://github.com/cappyzawa/tfswitch/actions?query=workflow%3ACI)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cappyzawa/tfswitch)](https://goreportcard.com/report/github.com/cappyzawa/tfswitch)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/cappyzawa/tfswitch)](https://pkg.go.dev/github.com/cappyzawa/tfswitch)\n\n## Motivation\n\n[tfutils/tfenv: Terraform version manager](https://github.com/tfutils/tfenv) is great tool for switching the terraform version used in local.\n\nHowever, There is an issue that it takes extra time to execute the command. (This is referred by [terraform executions delayed by ~ 1 second · Issue \\#196 · tfutils/tfenv](https://github.com/tfutils/tfenv/issues/196)). If you want to display the terraform version in the prompt, you will have to wait almost a second every time the it is updated.\n\nThis tool can also switch the terraform version. This installs binary from https://releases.hashicorp.com/terraform/ if specified version does not found in your machine. \n`tfenv` runs own script instead of binary, but this tool runs binary directly.\n\n## How to use\n\n### Install\n\n```bash\n$ go install github.com/cappyzawa/tfswitch/v2/cmd/tfswitch@latest\n```\n\nor download from [Releases · cappyzawa/tfswitch](https://github.com/cappyzawa/tfswitch/releases).\n\n### Use\n```bash\n$ tfswitch -h\nUsage: tfswitch [--version] [--help] \u003ccommand\u003e [\u003cargs\u003e]\n\nAvailable commands are:\n    local-list     display available terraform versions in local.\n    remote-list    display available terraform versions in remote. (https://releases.hashicorp.com/terraform/)\n    use            use specified terraform version.\n```\n\n```bash\n$ tfswitch use [version]\n# e.g., If you want to use 0.14.4\n$ tfswitch use 0.14.4\nSwitched terraform version to 0.14.4\n\n# This tool creates or replaces symbolic links.\n$ ls -l `which terraform`\nlrwxr-xr-x  1 cappyzawa  admin  54 Jan 14 20:14 /usr/local/bin/terraform@ -\u003e /Users/cappyzawa/.local/share/tfswitch/terraform_0.14.4\n$ tfswitch 0.14.3\n$ ls -l `which terraform`\nlrwxr-xr-x  1 cappyzawa  admin  54 Jan 14 20:18 /usr/local/bin/terraform@ -\u003e /Users/cappyzawa/.local/share/tfswitch/terraform_0.14.3\n```\n\n#### Available Environments\n\n* `XDG_DATA_HOME` (Default: `~/.local/share`): The specified version of `terraform` will be saved as `$XDG_DATA_HOME/tfswitch/terraform_[version]`\n\n#### Interactive switch\n\n```bash\n# from remote-list\n$ tfswitch remote-list | fzf --reverse | xargs tfswitch use\n\n# from local-list\n$ tfswitch local-list | fzf --reverse | xargs tfswitch use\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcappyzawa%2Ftfswitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcappyzawa%2Ftfswitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcappyzawa%2Ftfswitch/lists"}