{"id":13515458,"url":"https://github.com/Ant0wan/tfexe","last_synced_at":"2025-03-31T04:37:04.458Z","repository":{"id":153744341,"uuid":"630520675","full_name":"Ant0wan/tfexe","owner":"Ant0wan","description":"Rust-powered wrapper for seamless execution of tfswitch and Terraform with version control. ","archived":false,"fork":false,"pushed_at":"2023-11-03T15:50:59.000Z","size":89,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-01T19:36:28.561Z","etag":null,"topics":["terraform","tfswitch","tofu"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ant0wan.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},"funding":{"github":["username"],"open_collective":["username"],"ko_fi":["username"],"tidelift":["package-name"],"community_bridge":["project-id"],"custom":[{"url":"https://example.com/donate","platform":"Custom Donation Platform"},{"url":"https://example.com/sponsor","platform":"Custom Sponsorship Platform"}]}},"created_at":"2023-04-20T14:57:46.000Z","updated_at":"2023-10-20T22:16:22.000Z","dependencies_parsed_at":"2023-09-03T08:04:43.518Z","dependency_job_id":"e56526d2-1a43-402e-afef-6261db908376","html_url":"https://github.com/Ant0wan/tfexe","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/Ant0wan%2Ftfexe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ant0wan%2Ftfexe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ant0wan%2Ftfexe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ant0wan%2Ftfexe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ant0wan","download_url":"https://codeload.github.com/Ant0wan/tfexe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418657,"owners_count":20773934,"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":["terraform","tfswitch","tofu"],"created_at":"2024-08-01T05:01:11.569Z","updated_at":"2025-03-31T04:37:03.539Z","avatar_url":"https://github.com/Ant0wan.png","language":"Shell","funding_links":["https://github.com/sponsors/username","https://opencollective.com/[\"username\"]","https://ko-fi.com/[\"username\"]","https://tidelift.com/funding/github/[\"package-name\"]","https://funding.communitybridge.org/projects/[\"project-id\"]",{"url":"https://example.com/donate","platform":"Custom Donation Platform"},{"url":"https://example.com/sponsor","platform":"Custom Sponsorship Platform"}],"categories":["Tools"],"sub_categories":["Wrappers"],"readme":"\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"\"\u003e\n    \u003cimg src=\".logo.png\" alt=\"Logo\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003cp align=\"center\"\u003e\u003ci\u003eRust-powered wrapper for seamless execution of tfswitch and Terraform with version control.\u003c/i\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n## Table of Contents\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [License](#license)\n\n## Prerequisites\nBefore installing and using tfexe, you will need to have the following tools installed on your system:\n- `wget`: A command-line utility used for downloading files.\n- `tfswitch`: A tool used for switching between different versions of TensorFlow.\n\n## Installation\nTo install tfexe, simply run the `install.sh` script provided in this repository. The script will automatically download and install the necessary dependencies, and set up tfexe on your system.\n\n```shell\nwget -q -O -  https://raw.githubusercontent.com/Ant0wan/tfexe/master/install.sh | sh\n```\n\n## Usage\n\n1. Install ***tfexe*** by following the installation instructions in the tfexe GitHub repository.\n2. Create a Terraform configuration file (e.g., main.tf, providers.tf...) with the following content:\n```hcl\nterraform {\n  required_version = \"~\u003e 1.3.0\"\n}\n\n# Define your Terraform resources and providers here\n```\n3. In the command line instead of using the classic Terraform binary, use **tfexe** to execute Terraform commands. **tfexe** will automatically detect the required version of Terraform specified in your Terraform configuration file (required_version in this case, which is set to \"~\u003e 1.3.0\") and download and execute the appropriate Terraform binary for you. For example:\n```shell\n# Run Terraform init with tfexe\n$ tfexe init\nReading required version from terraform file\nReading required version from constraint: ~\u003e 1.3.0\nMatched version: 1.3.9\nInstalling terraform at /home/antoine/bin\nSwitched terraform to version \"1.3.9\"\n\nInitializing the backend...\n\nInitializing provider plugins...\n\nTerraform has been successfully initialized!\n\nYou may now begin working with Terraform. Try running \"terraform plan\" to see\nany changes that are required for your infrastructure. All Terraform commands\nshould now work.\n\nIf you ever set or change modules or backend configuration for Terraform,\nrerun this command to reinitialize your working directory. If you forget, other\ncommands will detect it and remind you to do so if necessary.\n\n```\n\nNote: tfexe will automatically execute tfswitch internally to switch to the specified Terraform version before running the Terraform command, based on the content of the providers.tf file in your Terraform configuration directory.\n\nIf no version of Terraform is specified in tf files, it will display the same prompt as tfswitch:\n```shell\n$ tfexe\nUse the arrow keys to navigate: ↓ ↑ → ←\n? Select Terraform version:\n    1.4.5 *recent\n    1.3.9 *recent\n    1.2.9 *recent\n  ▸ 1.4.4\n↓   1.4.3\n```\n\nNote: You can set an alias in your shell, such as Bash or Zsh, to use **tfexe** as a replacement for the **terraform** command. This can be done by adding the line to your shell profile file (e.g., *.bashrc*, *.bash_profile*, or *.zshrc*). Once the alias is set, you can use terraform in any script or wrapper call, and it will automatically execute **tfexe** with the proper Terraform version based on your configuration.\n```shell\nalias terraform='tfexe'\n```\n\nThat's it! You can now use **tfexe** as a drop-in replacement for the classic Terraform binary to execute Terraform commands, and it will automatically manage the versioning for you based on the required_version specified in your Terraform configuration file and the content of your providers.tf file.\n\n## How it works\n\n```mermaid\ngraph TD\n    start(Start)\n    TFEXE_set{TFEXE env variable set?}\n    TFEXE_unset{TFEXE env variable unset?}\n\n    start --\u003e TFEXE_set\n    start --\u003e TFEXE_unset\n\n    TFEXE_set --\u003e|TFEXE value| tfexe_executes[tfexe executes TFEXE]\n    TFEXE_unset --\u003e|'tfswitch' is available| tfswitch_executes[tfexe executes tfswitch]\n    TFEXE_unset --\u003e|'tfswitch' is not available| terraform_executes[tfexe executes terraform]\n\n    tfexe_executes --\u003e|TFEXE set to 'tofu'| tofu_executes[tfexe executes tofu]\n    tfexe_executes --\u003e|TFEXE set to 'terraform'| terraform_executes[tfexe executes terraform]\n    tfexe_executes --\u003e|TFEXE set to 'tfswitch'| tfswitch_executes[tfexe executes tfswitch]\n\n    tfswitch_executes --\u003e|execute appropriate 'terraform' version| terraform_executes[tfexe executes terraform]\n\n```\n\n## License\n\nThis repository is protected by the GPL3 (GNU General Public License v3.0). You can find the full text of the license in the LICENSE file. Please review and comply with the terms and conditions of the GPL3 license before using or contributing to this project.\n\nFor any questions, bug reports, or contributions, please feel free to open an issue or submit a pull request. Thank you for using tfexe!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnt0wan%2Ftfexe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAnt0wan%2Ftfexe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnt0wan%2Ftfexe/lists"}