Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flavius-dinu/tfgpt
https://github.com/flavius-dinu/tfgpt
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/flavius-dinu/tfgpt
- Owner: flavius-dinu
- Created: 2023-04-01T10:50:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-01T18:48:30.000Z (over 1 year ago)
- Last Synced: 2024-11-01T03:33:00.668Z (about 1 month ago)
- Language: Go
- Size: 4.88 KB
- Stars: 72
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-tf - tfgpt - A CLI tool that integrates Terraform with OpenAI's GPT-3.5 Turbo to provide explanations for Terraform commands and concepts. (Tools / Community providers)
README
# 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
* showAdditionally, 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.
https://user-images.githubusercontent.com/57911064/229308688-0082f72a-ddb6-47cf-bab4-7f891c869f84.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:
https://user-images.githubusercontent.com/57911064/229308740-cdbf8574-992e-40e2-9ef6-f617c46fe657.mp4
### Setup
* Clone the repository
* Build the program using go build.
```bash
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:
```bash
tfgpt [command]
```Or
```bash
tfgpt concept terraform_concept
```## Examples
```bash
tfgpt plan
tfgpt destroy
tfgpt init
tfgpt validatetfgpt concept resource
tfgpt concept datasource
```