How idoavrah/terraform-tui works
Main Components
a) Core Application Components:
• User Interface Layer (TUI)
• State Management System
• Plan Management System
• API Integration Layer
• Resource Operations Handler
b) External Dependencies:
• Terraform CLI
• PostHog Analytics (optional)
• Terraform State Files
• Terraform Plan Files
┌─────────────────────────────────────────────┐
• TFTUI │
• ┘
• ↓
┌─────────────────────────────────────────────┐
• User Interface │
• ┌──────────┐ ┌──────────┐ ┌──────────┐ │
• Tree │ │ Resource │ │ Modal │ │
• View │ │ View │ │ Dialogs │ │
• ┘ └──────────┘ └──────────┘ │
• ┘
• ↕
┌─────────────────────────────────────────────┐
• Core Logic Layer │
• ┌──────────┐ ┌──────────┐ ┌──────────┐ │
• State │ │ Plan │ │ Resource │ │
• Manager │ │ Manager │ │Operations│ │
• ┘ └──────────┘ └──────────┘ │
• ┘
• ↕
┌─────────────────────────────────────────────┐
• External Interfaces │
• ┌──────────┐ ┌──────────┐ ┌──────────┐ │
• Terraform │ │ PostHog │ │ File │ │
• CLI │ │ API │ │ System │ │
• ┘ └──────────┘ └──────────┘ │
• ┘
Component Details
User Interface Layer:
• Tree View: Shows Terraform state hierarchy
• Resource View: Displays individual resource details
• Modal Dialogs: For confirmations and operations
Core Logic Layer:
• State Manager: Handles Terraform state operations
• Plan Manager: Manages plan creation and application
• Resource Operations: Handles taint/untaint/delete operations
External Interfaces:
• Terraform CLI Integration
• PostHog Analytics Integration (optional)
• File System Interface
Important Flows to Highlight
a) State Management Flow:
User Input → UI Layer → State Manager → Terraform CLI → State Files
b) Plan Creation Flow:
User Input → UI Layer → Plan Manager → Terraform CLI → Plan Files
c) Resource Operation Flow:
User Selection → Resource Operations → Terraform CLI → State Update
Key Technical Details to Note
• Python-based implementation
• Terminal-based UI using Textual framework
• File system interactions for state management
• CLI wrapper functionality
• Workspace management capabilities