Skip to main content

Generate Terraform READMEs and inline comments using Claude

Project description

terraformreviewer: AI-Powered Terraform Documentation and Comment Generator

terraformreviewer is a command-line tool that uses Anthropic’s Claude AI to automatically generate production-ready documentation (README.md) and add clear, helpful inline comments to your Terraform (.tf) files. This makes your infrastructure-as-code projects easier to understand, maintain, and onboard new team members.


Features

  • Automatic README Generation: Produces a comprehensive, human-readable README.md for your Terraform project.
  • Inline Comments: Adds concise, informative comments to all .tf files, explaining resources, blocks, and configuration.
  • Powered by Claude AI: Leverages Anthropic’s Claude for high-quality, context-aware documentation and code explanations.

Installation

Install the tool directly from PyPI:

pip install terraformreviewer

Or, if you want the latest development version:

git clone https://github.com/Zayan-ahmed953/Terraform_Reviewer_AI_Tool.git
cd Terraform_AI_Reviewer
pip install -e .

Setup

Before using the tool, you must set your Anthropic API key as an environment variable:

export ANTHROPIC_API_KEY=<your valueapi key>

You can obtain an API key from Anthropic.


Usage

Run the tool from your terminal, pointing it to your Terraform project directory:

terraformreviewer /path/to/your/terraform/project

This will:

  • Generate a README.md describing your infrastructure.
  • Add helpful inline comments to all .tf files in the project.

Example:

terraformreviewer /home/zayan/Desktop/My-Projects/AI-Generated-sample-terraform/

Notes

  • If you rerun the tool without changing your Terraform files, it will skip regeneration for efficiency.
  • Ensure your API key is valid and you have internet access.

Troubleshooting

  • No .tf files found: Make sure you provide the path to a directory containing Terraform files.
  • API key error: Double-check that ANTHROPIC_API_KEY is set in your environment.
  • Other errors: Please open an issue with the error message and steps to reproduce.

License

MIT

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

terraformreviewer-0.1.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terraformreviewer-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file terraformreviewer-0.1.2.tar.gz.

File metadata

  • Download URL: terraformreviewer-0.1.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for terraformreviewer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 08026f41cd7660709923b29341b8490bbdc09933ebf14c446fcda3cd50232a46
MD5 2c8b35ff3851e4a1890601276459097a
BLAKE2b-256 ff2ff3a7ab8b35b9e48e24a2edf0d5d070e39d8376221296d062af3f71022b25

See more details on using hashes here.

File details

Details for the file terraformreviewer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for terraformreviewer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 12f67fb5b8e605874b32676e39baf8f38a6c84ce449b3e3f13faf462813cc873
MD5 424170c40d4583ef9203e0ae747d3278
BLAKE2b-256 c350f3f8c92fc8fcbd5ff87d0d2a254c55a3e08bd92aa81f3f71457032404c86

See more details on using hashes here.

Supported by

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