infra-guide is a production-grade, interactive terminal UI (TUI) tool for Terraform and OpenTofu that combines beginner-friendly guidance with enterprise-level features. Learn infrastructure-as-code while using professional tools like drift detection, policy validation, and CI/CD integration.
π infra-guide - Interactive Infrastructure Guide
π¦ Using: terraform (v1.6.0)
βββββββββββββββββββββ Main Menu - Enhanced Edition ββββββββββββββββββββ
β Option Command Description β
β 1 init π§ Initialize a working directory β
β 2 plan π Show changes required β
β 3 apply β
Create or update infrastructure β
β 4 destroy π₯ Destroy infrastructure β
β 5 validate β Run pre-flight validations β
β 6 drift π Detect infrastructure drift β
β 7 state π¦ Explore state file β
β 8 workspace π Manage workspaces β
β 9 cicd π CI/CD pipeline mode β
β 0 exit πͺ Exit infra-guide β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Select an option [1/2/3/4/5] (5):Before installing infra-guide, ensure you have:
python3 --versionNote: No cloud credentials, API keys, or additional setup needed!
pipx installs Python applications in isolated environments, preventing dependency conflicts.
Install pipx if you don't have it:
sudo apt update
sudo apt install pipxInstall infra-guide:
pipx install infra-guideRun the tool:
infra-guideFor development or to contribute to the project.
# Clone the repository
git clone https://github.com/cloudgrains/infra-guide.git
cd infra-guide
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install the package
pip install .# Install directly from GitHub using pipx
pipx install git+https://github.com/cloudgrains/infra-guide.git
# Or from source directory
git clone https://github.com/cloudgrains/infra-guide.git
cd infra-guide
pip install -e .Simply run the command from any directory containing Terraform/OpenTofu configuration files:
infra-guide| Command | Description | Risk Level | New in v0.2.0 |
|---|---|---|---|
init | Initialize working directory | π’ Low | - |
plan | Preview infrastructure changes | π’ Low | - |
apply | Create/update infrastructure | π‘ Medium | - |
destroy | Delete all infrastructure | π΄ High | - |
validate | Run pre-flight checks | π’ Low | β |
drift | Detect infrastructure drift | π’ Low | β |
state | Explore state file | π’ Low | β |
workspace | Manage workspaces | π‘ Medium | β |
cicd | Run CI/CD pipeline | π‘ Medium | β |
Automatically detects when your actual infrastructure has diverged from the state file. This happens when changes are made outside of Terraform/OpenTofu (manual changes, other tools, etc.).
# In infra-guide, select option 6
# Shows which resources have drifted and what changedRuns comprehensive checks before you execute commands:
Interactive browser for your state file:
Easily manage multiple environments:
Non-interactive mode perfect for automation:
We don't collect any data about your usage
Works completely offline
Only wraps Terraform/OpenTofu CLI
Fully transparent, auditable code
All commands run locally on your machine
# Clone the repository
git clone https://github.com/cloudgrains/infra-guide.git
cd infra-guide
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode with dev dependencies
pip install -e ".[dev]"pytestblack infra_guide/mypy infra_guide/infra-guide/
βββ infra_guide/
β βββ __init__.py # Package initialization
β βββ cli.py # Main CLI entry point
β βββ detector.py # Tool detection logic
β βββ ui.py # UI components using rich
β βββ runner.py # Command execution
β βββ guides/
β βββ __init__.py
β βββ init.py # Init command guide
β βββ plan.py # Plan command guide
β βββ apply.py # Apply command guide
β βββ destroy.py # Destroy command guide
βββ pyproject.toml # Project configuration
βββ README.md # Documentation
βββ LICENSE # MIT LicenseContributions are welcome! Here's how you can help:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by CloudGrains for the Infrastructure as Code community