v0.2.0 — AI Features Now Live

Terraform,
in the terminal.

TerraLens is a fully interactive TUI dashboard for Terraform — browse state, plan, apply, detect drift, estimate costs, scaffold new resources with AI, and fix errors without leaving your CLI.

Get Started → View on GitHub
terralens — ~/my-terraform-project
terralens
Loading terraform.tfstate...
✓ Found 24 resources across 3 providers
┌─────────────────────────────────────────┐
│ TerraLens v0.2.0 [1] Overview [2] Manage │
└─────────────────────────────────────────┘
✦ AI Scaffold ✦ Explain Error ✦ BYO Model
Connecting to AI engine (OpenRouter / Ollama)...
✓ Dashboard ready
334 AWS Resources
20 Categories
3 Install Methods
MIT License

Everything you need,
nothing you don't.

All the power of the Terraform CLI wrapped in a keyboard-driven terminal interface.

📊
Overview Dashboard
Terraform version, state serial, total resource count, provider count, and a full resource summary table — all at a glance.
🌲
Resource Tree
Resources grouped by type. Click any leaf to load its full attribute map including nested maps and lists.
🔍
Live Plan
Streams real terraform plan output line-by-line into the terminal panel as it runs.
Apply Now
Runs terraform apply -auto-approve and automatically reloads the resource tree on success.
💰
Cost Estimate
Infracost-powered breakdown with per-resource monthly costs and total estimates, rendered right in the terminal.
🔄
Drift Detection
Detects infrastructure drift using terraform plan -refresh-only and reports exactly which resources changed.
Add Resource Wizard
3-step wizard: pick provider → browse 334 AWS resources → configure fields and preview HCL before writing or applying.
🗑️
Targeted Destroy
Select any resource in the tree, click Destroy. A confirmation modal shows the full address before execution.
🔁
State Reload
Press r at any time to reload state from disk without restarting the application.
✦ New in v0.2.0

Write less HCL.
Fix errors faster.

Three AI-powered features built directly into the TUI. No context-switching, no copy-pasting into ChatGPT.

AI HCL Scaffolding
Click AI Scaffold, type a plain-English prompt — "Create an S3 bucket with versioning" — and get valid, ready-to-edit Terraform code dropped straight into an in-TUI text area. No browser, no copy-paste.
Natural Language → HCL
🩺
Context-Aware Error Explanations
When a terraform plan or apply fails, TerraLens captures the raw terminal logs automatically. Click Explain Error and an AI explains exactly what broke and shows you the HCL fix in a dedicated markdown panel.
Log Capture → Fix
🔌
Bring Your Own Model
Plug in an OpenRouter API key (including free models like Gemma 2) or point the base URL at a local Ollama instance. Local inference means your state files never leave your machine.
OpenRouter · Ollama

Three ways to install.

Pick whichever method works best for your setup.

# Install globally with pipx (recommended on Arch / modern Linux)
pipx install TerraLens

# Or with pip in a virtual environment
python -m venv .venv
source .venv/bin/activate
pip install TerraLens

# Run from your Terraform project directory
cd ~/my-terraform-project
terralens
ⓘ Run python installer.py once after installing to configure Infracost for cost estimation.
# Linux — download and run
curl -L https://github.com/bhuvan-raj/TerraLens/releases/download/v0.2.0/insight-tf-linux -o terralens
chmod +x terralens
mv terralens ~/my-terraform-project
cd ~/my-terraform-project
./terralens

# Windows — download from Releases page, then:
.\insight-tf-windows.exe
ⓘ No Python, no pip, no dependencies — everything is bundled inside the binary.
# Clone the repository
git clone https://github.com/bhuvan-raj/TerraLens.git
cd TerraLens

# Create a virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the app
cd src/insight_tf
python cli.py
ⓘ No state file? TerraLens loads built-in sample AWS data so you can explore the UI immediately.

Grab the latest release.

Pre-built binaries for Linux and Windows. No Python installation required.

// linux
🐧
Linux Binary
Works on Ubuntu, Arch, Fedora, and all glibc-based distributions. Built on Ubuntu runners.
↓ Download for Linux
// windows
🪟
Windows Binary
Self-contained .exe for Windows. Download, move to your project folder, and run.
↓ Download for Windows
// pypi
🐍
Python Package
Install via pip or pipx. Available on PyPI for Python 3.10+ on any platform.
↗ View on PyPI
// all releases
📦
All Releases
Browse all versions, read release notes, and download previous builds on GitHub.
↗ GitHub Releases

Keyboard first.

TerraLens is designed for keyboard-driven workflows.

1 Switch to Overview tab
2 Switch to Manage tab
r Reload state from disk
q Quit the application
Esc Close any open modal or wizard

What's new.

Every release, documented. Click a version to expand the full notes.

v0.2.0 2026-06-18 AI latest

AI Features

  • AI HCL Scaffolding — type a natural-language prompt (e.g. "Create an S3 bucket with versioning") and receive valid Terraform code in an editable in-TUI text area
  • Context-Aware Error Explanations — captures raw terminal logs from failed plan/apply runs; click "Explain Error" for a full AI diagnosis and HCL fix in a dedicated markdown panel
  • Bring Your Own Model — async Python AI engine supports an OpenRouter API key (including free models like Gemma 2) or a local Ollama base URL for complete state-file privacy
v0.1.4 2026-03-14 Added

Added

  • Infrastructure Blueprints — 8 pre-built multi-resource configurations (VPC+EC2, Three-Tier, EKS, Serverless API and more)
  • New Add Resource mode selection screen — choose Blueprint or Single Resource
  • All blueprint HCL uses Terraform resource references with no hardcoded IDs
  • 3-step blueprint wizard: pick → configure → preview & save

Refactored

  • Split monolithic cli.py into state.py, catalog.py, blueprints.py, and cli.py
  • Simplified installer.py — Infracost setup only
v0.1.3 2026-02-28 Fixed

Fixed

  • Removed duplicate main() function that caused NameError crash on startup
  • Eliminated stale InsightTFApp import referencing a non-existent module
  • CLI and binary now correctly launch the full InsightTF app
v0.1.2 2026-02-27 Fixed

Fixed

  • Fixed PowerShell line continuation error breaking Windows builds
  • Added shell: bash to GitHub Actions workflow for cross-platform consistency
  • Windows binary now builds and runs correctly
v0.1.1 2026-02-27 Fixed

Fixed

  • Fixed ModuleNotFoundError for rich._unicode_data on startup
  • Added --collect-submodules flags to PyInstaller for complete bundling
  • Resolves crashes on Arch Linux and non-Ubuntu distributions
v0.1.0 2026-02-26 Added

Added

  • Initial public release of TerraLens
  • Overview tab — Terraform version, state serial, resource count, provider count
  • Manage tab — interactive resource tree with full attribute inspector
  • Plan — streams real terraform plan output line-by-line
  • Apply Now — runs terraform apply -auto-approve with state reload
  • Cost Estimate — Infracost-powered monthly cost breakdown
  • Drift Detection — terraform plan -refresh-only with parsed summary
  • Add Resource wizard — 334 AWS resources across 20 categories
  • Destroy — targeted destroy with confirmation modal
  • State Reload — press r to reload state from disk