Giter VIP home page Giter VIP logo

tfgpt's Introduction

Terraform GPT Helper

This Golang program is a CLI tool that integrates Terraform with OpenAI's GPT-3.5 Turbo to provide explanations for Terraform commands and concepts.

Overview

The tool offers support for the following Terraform commands:

  • plan
  • validate
  • destroy
  • init
  • show

Additionally, it includes functions to interact with OpenAI's GPT-3.5 Turbo API to request explanations for Terraform commands and concepts. As adoption will grow for GPT-4, this will change to use GPT-4 instead.

tfgpt.mp4

Prerequisites

To use this tool, you need to have the following:

  • Golang installed on your system

  • Terraform installed on your system

  • OpenAI API key

To generate the OpenAI API key you have to go to https://platform.openai.com/account/api-keys and create an api key, similar to:

Generate.OpenAI.API.Key.mp4

Setup

  • Clone the repository

  • Build the program using go build.

go build -o bin/tfgpt cmd/tfgpt/main.go
  • Add tfgpt to your path

  • Make sure you have your OpenAI API key stored as an environment variable or in a credentials file within the user's home directory (e.g., ~/.tfgpt/credentials).

  • Run the compiled program with the desired Terraform command or concept. If you want to use it in conjunction with a Terraform command, you must be in the directory containing the terraform configuration.

This will not run destroy on your behalf, it will just show you a plan based on your configuration

Usage

To use the tool, simply run the program with the desired Terraform command or concept:

tfgpt [command] 

Or

tfgpt concept terraform_concept

Examples

tfgpt plan
tfgpt destroy
tfgpt init
tfgpt validate

tfgpt concept resource
tfgpt concept datasource

tfgpt's People

Contributors

flaviuscdinu avatar flavius-dinu avatar

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.