Code Monkey home page Code Monkey logo

tfswitcher's Introduction

tfswitcher

Terraform and OpenTofu version switcher written in Rust.

Installation

To install, simply run cargo install tfswitcher. There are also prebuilt binaries available with each release for Linux, macOS and Windows.

Usage

To see available flags and arguments, run tfswitcher -h or tfswitcher --help.

You can also use a configuration file to automatically set certain flags or arguments. Simply place a file called .tfswitch.toml either in your current working directory or in your $HOME directory.

bin = "/location/of/terraform/binary"
list_all = false
opentofu = false
version = "1.0.0"

Shell Completions

tfswitcher can generate tab-completion scripts for your desired shell. To see which shells are supported, see the --help text.

For example, for Bash:

tfswitcher -c bash >> ~/.local/share/bash-completion/completions/tfswitcher

Alternatively, you can source the tab-completion script inside your shell's start up script:

echo "source <(tfswitcher -c bash)" >> ~/.bashrc

Caveats

This has not been tested on Windows or macOS, so YMMV.

Where's v0.1.0?

v0.1.0 used FFI with Cgo in order to use HashiCorp's terraform-config-inspect library. This was inadvertently published as the Windows and macOS builds were broken and is yanked.

v0.2.0 replaced the Go library with a partially-reimplemented Rust library to eliminate FFI and makes building for Windows and macOS a lot less painful.

tfswitcher's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.