An interactive Terminal User Interface (TUI) for exploring Terraform provider schemas
Provider Explorer is a Go-based CLI tool that helps developers navigate, understand, and work with complex Terraform provider resource schemas. It provides an intuitive interface with fuzzy search, interactive navigation, and built-in transformations to streamline Terraform development workflows.
For Terraform Developers:
- ๐ Schema Discovery: Quickly explore provider resources, data sources, and functions
- ๐ Documentation: Understand resource arguments, attributes, and nested blocks
- ๐ Code Generation: Transform schemas into Terraform variable/output blocks
- โก Rapid Development: Find the right resources without context switching to documentation
For DevOps Engineers:
- ๐๏ธ Infrastructure Planning: Discover available resources before writing Terraform
- ๐ Template Creation: Generate boilerplate Terraform code from schemas
- ๐ง Troubleshooting: Understand resource structures when debugging configurations
- ๐ Standards Creation: Build consistent variable/output patterns across teams
- Fuzzy Search: Type to filter providers, resources, and attributes in real-time
- Multi-Level Browsing: Navigate from providers โ resource types โ detailed schemas
- Responsive Layout: Adapts to different terminal sizes and preferences
- Keyboard Navigation: Efficient navigation with intuitive key bindings
- Four Resource Categories: Data Sources, Resources, Ephemeral Resources, Provider Functions
- Detailed Schema Views: Browse arguments (inputs) and attributes (outputs) separately
- Nested Block Support: Navigate complex nested resource structures
- Type Information: See data types, requirements (required/optional), and descriptions
- Arguments โ Variables: Convert resource arguments to Terraform variable blocks
- Attributes โ Outputs: Generate output blocks from resource attributes
- HCL Generation: Ready-to-use Terraform code with proper syntax and formatting
- Provider Caching: Intelligent schema caching to avoid repeated API calls
- Auto-Detection: Automatically detects Terraform vs OpenTofu installations
- Configuration Validation: Ensures valid Terraform configurations before starting
- Fast Startup: Quick initialization with cached provider schemas
- Language: Go 1.24.4
- TUI Framework: Bubble Tea - Event-driven TUI framework
- Styling: Lipgloss - Terminal styling library
- CLI Framework: Cobra - Command-line interface framework
-
Terraform Integration:
github.com/hashicorp/terraform-json- Schema parsing and data structuresgithub.com/hashicorp/terraform-config-inspect- Configuration analysisgithub.com/zclconf/go-cty- Terraform type system support
-
UI Components:
github.com/charmbracelet/bubbles- Pre-built UI componentsgithub.com/sahilm/fuzzy- Fuzzy string matching for searchgithub.com/atotto/clipboard- Cross-platform clipboard support
-
Testing & Quality:
github.com/charmbracelet/x/exp/teatest- TUI integration testinggithub.com/gkampitakis/go-snaps- Snapshot testing for UI consistencygithub.com/stretchr/testify- Testing utilities and assertions
โโโ cmd/ # CLI command definitions and entry points
โโโ internal/
โ โโโ config/ # Configuration detection and management
โ โโโ schema/ # Provider schema types and processing
โ โโโ terraform/ # Terraform/OpenTofu integration and caching
โ โโโ ui/ # TUI components and application logic
โโโ ui_test/ # Integration tests for UI workflows
โโโ testdata/ # Test fixtures and schema samples
- Go 1.24.4 or later
- Terraform or OpenTofu installed and accessible in PATH
- A Terraform configuration directory to explore
# Clone the repository
git clone https://github.com/terraconstructs/provider-explorer.git
cd provider-explorer
# Build using GoReleaser (recommended)
make build
# Or build with Go directly
go build -o provider-explorer .
# Install to $GOPATH/bin
make installDownload the latest release for your platform from the releases page.
# Apple Silicon (M1/M2/M3)
curl -L -o provider-explorer.tar.gz https://github.com/TerraConstructs/provider-explorer/releases/latest/download/provider-explorer_Darwin_arm64.tar.gz
tar -xzf provider-explorer.tar.gz
sudo mv provider-explorer /usr/local/bin/
# Intel-based Mac
curl -L -o provider-explorer.tar.gz https://github.com/TerraConstructs/provider-explorer/releases/latest/download/provider-explorer_Darwin_x86_64.tar.gz
tar -xzf provider-explorer.tar.gz
sudo mv provider-explorer /usr/local/bin/# ARM64 (aarch64)
curl -L -o provider-explorer.tar.gz https://github.com/TerraConstructs/provider-explorer/releases/latest/download/provider-explorer_Linux_arm64.tar.gz
tar -xzf provider-explorer.tar.gz
sudo mv provider-explorer /usr/local/bin/
# x86_64 (Intel/AMD)
curl -L -o provider-explorer.tar.gz https://github.com/TerraConstructs/provider-explorer/releases/latest/download/provider-explorer_Linux_x86_64.tar.gz
tar -xzf provider-explorer.tar.gz
sudo mv provider-explorer /usr/local/bin/Download the appropriate .zip file for your architecture:
Extract the .zip file and add the provider-explorer.exe to your PATH.
# Download for your current platform automatically
gh release download --repo TerraConstructs/provider-explorer --pattern '*$(uname -s)_$(uname -m)*'
# Or download a specific version
gh release download v1.0.0 --repo TerraConstructs/provider-explorer# Verify the binary works
provider-explorer version
# Verify checksum (optional)
curl -L -o checksums.txt https://github.com/TerraConstructs/provider-explorer/releases/latest/download/checksums.txt
shasum -a 256 --check checksums.txt --ignore-missing# Explore current directory's Terraform configuration
./provider-explorer
# Explore specific directory
./provider-explorer ./path/to/terraform/config
# Get help
./provider-explorer --help- Start the Application: Launch with a Terraform configuration directory
- Provider Selection: Browse or search available providers
- Resource Category: Choose from Data Sources, Resources, Ephemeral Resources, or Provider Functions
- Resource Selection: Select specific resource types with fuzzy search
- Schema Exploration: Navigate between Arguments and Attributes views
- Transformation: Generate HCL code with built-in transformers
- Copy to Clipboard: Copy generated code for immediate use
- Navigation: Arrow keys, Tab, Enter
- Search:
/to start filtering, Escape to clear - Views:
ato toggle between Arguments/Attributes - Actions: Space to select/deselect items
- Exit:
qor Ctrl+C
- Define Changes: Specify what UI behavior changes are needed
- Review Tests: Identify affected teatest integration tests in
ui_test/ - Update Tests: Modify test workflows to match new behavior
- Review Snapshots: Examine snapshot changes for visual regressions
- Build: Run
make buildto ensure compilation - Format: Run
make fmtfor code formatting - Never Run Manually: Do not execute
./provider-explorerduring development
Comprehensive Testing Coverage:
- 31 Integration Tests: Full UI workflow coverage using teatest
- Snapshot Testing: Visual regression detection for multiple screen sizes
- Component Tests: Individual UI component validation
- Export Tests: HCL transformation functionality validation
# All tests (unit + integration)
make test
# Unit tests only (fast)
make test-unit
# Integration tests only (teatest)
make test-integration
# Tests with coverage report
make test-coverage
# Quick development tests
make test-short// โ
CORRECT: Always wait for UI state
teatest.WaitFor(t, tm.Output(), func(b []byte) bool {
return bytes.Contains(b, []byte("expected content"))
}, teatest.WithDuration(5*time.Second))
// โ WRONG: Direct output reading
output := tm.Output() // Unreliable for async UI# Format Go code
make fmt
# Clean build artifacts
make clean
# View all available commands
make helpcmd/: CLI command definitions and application entry pointsinternal/config/: Terraform configuration detection and validationinternal/terraform/: Provider schema loading, caching, and binary detectioninternal/ui/: TUI application logic, components, and transformationsui_test/: Comprehensive integration tests for all UI workflowstestdata/: Test fixtures and minimal provider schemasfixtures/: Example Terraform configurations for testing
- Component Tests:
internal/ui/tree/model_test.go- Individual component snapshots - Integration Tests:
ui_test/*.go- Full application workflow testing - Snapshot Files:
__snapshots__/- Visual regression detection data - Test Utilities:
internal/ui/tree/testutil/- Testing helper functions
- Fork and Clone: Fork the repository and clone your fork
- Install Dependencies: Run
go mod download - Understand Testing: Read the testing strategy in
CLAUDE.md - Make Changes: Follow the test-driven development workflow
- Run Tests: Ensure all tests pass before submitting
- Create Feature Branch: Branch from
mainwith descriptive name - Update Tests: Modify relevant teatest workflows for changes
- Review Snapshots: Ensure UI changes are intentional
- Format Code: Run
make fmtbefore committing - Submit PR: Include clear description of changes and test coverage
- Go Formatting: Use
gofmtandgoimportsfor consistent formatting - Testing Required: All UI changes must include corresponding test updates
- Documentation: Update README and CLAUDE.md for significant changes
- Commit Messages: Use clear, descriptive commit messages
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Charm Bracelet: For the excellent Bubble Tea TUI framework and ecosystem
- HashiCorp: For Terraform and the provider schema APIs
- Go Community: For the robust standard library and development tools
Questions or Issues? Please open an issue on GitHub or contribute to the project!
