Skip to main content

Apply OpenAI gpt changes to an entire Terraform project directory

Project description

Terrafai: Supercharge Your Terraform Projects with GPT-4

Terrafai is an open-source CLI tool that allows you to edit an entire Terraform project directory with GPT-4, the LLM behind ChatGPT. Make sweeping changes at once:

  • Refactor an entire project
  • Change resource naming conventions
  • Apply your company's latest resource tagging standards
  • Anything ChatGPT can do, but at the project level

Features

🤖 GPT-4 Integration: Utilize the power of OpenAI's GPT-4 to manipulate your Terraform configurations.
⚙️ Automated Checks: Pre- and post-checks with 'terraform validate' to ensure quality.
🔄 Diff Output: Visualize changes before they're made.
🛠️ Flexible Operations: Specify any bulk operations. Will be passed into prompt template.

All changes will be placed into a timestamped subdirectory of your current project.

Many improvements to come!

Prerequisites

Installation

pip install terrafai

Finally, add your OpenAI API Key to your environment variables:

export OPENAI_API_KEY='your-api-key-here'

Usage

Basic usage:

terrafai -op "Append '-demo' to all resource names."

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terrafai-0.1.6.tar.gz (18.5 kB view hashes)

Uploaded Source

Built Distribution

terrafai-0.1.6-py3-none-any.whl (18.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page