{"id":40136415,"url":"https://github.com/ivasik-k7/tfkit","last_synced_at":"2026-01-19T14:00:59.637Z","repository":{"id":320778448,"uuid":"1083206173","full_name":"ivasik-k7/tfkit","owner":"ivasik-k7","description":"A toolkit for analyzing, visualizing, and validating Terraform infrastructure code","archived":false,"fork":false,"pushed_at":"2025-12-19T11:15:51.000Z","size":1922,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-22T04:12:25.286Z","etag":null,"topics":["terrafrom","tool"],"latest_commit_sha":null,"homepage":"https://tfkit.netlify.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivasik-k7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T14:57:16.000Z","updated_at":"2025-12-15T18:31:11.000Z","dependencies_parsed_at":"2025-10-25T21:21:52.560Z","dependency_job_id":"a765faa7-70ec-432f-80c5-041a73372b78","html_url":"https://github.com/ivasik-k7/tfkit","commit_stats":null,"previous_names":["ivasik-k7/tfkit"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/ivasik-k7/tfkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivasik-k7%2Ftfkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivasik-k7%2Ftfkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivasik-k7%2Ftfkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivasik-k7%2Ftfkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivasik-k7","download_url":"https://codeload.github.com/ivasik-k7/tfkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivasik-k7%2Ftfkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28571556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["terrafrom","tool"],"created_at":"2026-01-19T14:00:58.601Z","updated_at":"2026-01-19T14:00:59.629Z","avatar_url":"https://github.com/ivasik-k7.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TFKit - Terraform Intelligence \u0026 Analysis Suite\n\n[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![Latest Release](https://img.shields.io/github/v/release/ivasik-k7/tfkit)](https://github.com/ivasik-k7/tfkit/releases)\n[![Pipeline Status](https://img.shields.io/github/actions/workflow/status/ivasik-k7/tfkit/main.yml?branch=main)](https://github.com/ivasik-k7/tfkit/actions)\n[![Code Coverage](https://img.shields.io/codecov/c/github/ivasik-k7/tfkit)](https://codecov.io/gh/ivasik-k7/tfkit)\n\nA comprehensive toolkit for analyzing, visualizing, and validating Terraform infrastructure code. TFKit provides deep insights into your Terraform projects with advanced dependency tracking, security scanning, and interactive visualizations.\n\n## Overview\n\nTFKit helps infrastructure teams understand, validate, and optimize their Terraform configurations through:\n\n- **Quick Scanning**: Rapid project analysis with comprehensive metrics\n- **Validation Suite**: Built-in validation with security and compliance checks\n- **Multi-Format Export**: Flexible output formats for integration with other tools\n- **Interactive Visualizations**: Rich graphical representations with multiple themes and layouts\n- **CI/CD Ready**: SARIF output and automation-friendly interfaces\n\n## Quick Start\n\n### Installation\n\n```bash\npip install tfkit-py\n```\n\n### Basic Usage\n\nGet started with these essential commands:\n\n```bash\n# Quick project scan\ntfkit scan\n\n# Scan with visualization\ntfkit scan --open --theme dark --layout graph\n\n# Validate configurations\ntfkit validate --all --strict\n\n# Export analysis results\ntfkit export --format json --format yaml\n```\n\n## Visualization Layouts\n\n|                                        Graph Layout                                        |                                        Dashboard Layout                                        |                                        Classic Layout                                        |\n| :----------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: |\n| [![Graph Visualization](https://iili.io/KL7utRI.md.png)](https://freeimage.host/i/KL7utRI) | [![Dashboard Visualization](https://iili.io/KPV3mPa.md.png)](https://freeimage.host/i/KPV3mPa) | [![Classic Visualization](https://iili.io/KL7aYPe.md.png)](https://freeimage.host/i/KL7aYPe) |\n|          Force-directed graph showing resource relationships (Github-Dark Theme)           |                              Dashboard with metrics and insights                               |                   Traditional hierarchical layout (Solirized-Light Theme)                    |\n\n\u003c/div\u003e\n\n### Available Themes\n\n- **Dark** (default) - Dark theme for extended viewing sessions\n- **Light** - Light theme for printed reports\n- **Cyber** - High-contrast theme for presentations\n- **GitHub Dark** - GitHub's dark color scheme\n- **Monokai** - Popular code editor theme\n- **Solarized Light** - Eye-friendly light theme\n- **Dracula** - Popular dark theme\n- **Atom One Dark** - Atom editor's dark theme\n- **Gruvbox Dark** - Retro groove color scheme\n- **Night Owl** - Night-optimized theme\n\n### Layout Options\n\n- **Classic** - Traditional hierarchical tree layout\n- **Graph** - Force-directed graph for complex relationships (default)\n- **Dashboard** - Metrics-focused layout with key insights\n\n## Command Reference\n\n### Scan Command\n\nQuick analysis for rapid insights into your Terraform project with comprehensive statistics and health assessment.\n\n```bash\ntfkit scan [PATH] [OPTIONS]\n```\n\n**Options:**\n\n- `--output, -o DIR` - Output directory for reports\n- `--format, -f FORMAT` - Output format: `table` (default), `json`, `yaml`, `simple`\n- `--open, -O` - Open results in browser\n- `--quiet, -q` - Minimal output\n- `--save, -s FILE` - Save scan results to file\n- `--theme THEME` - Visualization theme (default: dark)\n- `--layout LAYOUT` - Visualization layout (default: graph)\n\n**Examples:**\n\n```bash\n# Scan current directory\ntfkit scan\n\n# Scan specific path\ntfkit scan /path/to/terraform\n\n# Scan with JSON output\ntfkit scan --format json\n\n# Scan and open visualization\ntfkit scan --open --theme cyber --layout dashboard\n\n# Save results and open browser\ntfkit scan --save scan.json --open\n\n# Quiet mode with simple output\ntfkit scan --quiet --format simple\n```\n\n**Output:**\n\nThe scan command provides:\n\n- **Project Summary**: Total objects, resources, data sources, variables, outputs, providers\n- **Health Assessment**: Overall health score, unused objects, orphaned outputs, incomplete resources\n- **Resource Types**: Breakdown of resource types with counts\n- **Potential Issues**: Unused objects, orphaned outputs, incomplete configurations\n- **State Distribution**: Classification of all Terraform components\n\n### Validate Command\n\nComprehensive validation of Terraform configurations with multiple check types and flexible output formats.\n\n```bash\ntfkit validate [PATH] [OPTIONS]\n```\n\n**Validation Options:**\n\n- `--strict, -s` - Enable strict validation mode\n- `--check-syntax` - Check HCL syntax\n- `--check-references` - Validate references\n- `--check-best-practices` - Check against best practices\n- `--check-security` - Security validation\n- `--all, -a` - Run all validation checks (recommended)\n- `--fail-on-warning` - Treat warnings as errors (CI/CD mode)\n- `--ignore RULE` - Ignore specific validation rules (can use multiple times)\n\n**Output Options:**\n\n- `--format, -f FORMAT` - Output format: `table` (default), `json`, `sarif`\n\n**Examples:**\n\n```bash\n# Basic validation (syntax + references)\ntfkit validate\n\n# Full validation suite\ntfkit validate --all\n\n# Strict validation with all checks\ntfkit validate --all --strict\n\n# Security-focused validation\ntfkit validate --check-security --strict\n\n# CI/CD integration with SARIF output\ntfkit validate --all --strict --fail-on-warning --format sarif \u003e results.sarif\n\n# Validation with ignored rules\ntfkit validate --all --ignore TF020 --ignore TF021\n\n# JSON output for programmatic use\ntfkit validate --all --format json\n```\n\n**Validation Output:**\n\nResults include:\n\n- **Summary**: Count of errors, warnings, info messages, and passed checks\n- **Issues Table**: Detailed list with severity, category, rule ID, location, resource name, and message\n- **Suggestions**: Actionable recommendations for fixing issues\n- **Passed Checks**: List of successfully validated rules\n\n**Severity Levels:**\n\n- ❌ **ERROR** - Critical issues that must be fixed\n- ⚠️ **WARNING** - Issues that should be addressed\n- ℹ️ **INFO** - Informational messages and suggestions\n\n### Export Command\n\nExport analysis data in multiple structured formats for integration with other tools and workflows.\n\n```bash\ntfkit export [PATH] [OPTIONS]\n```\n\n**Options:**\n\n- `--format, -f FORMAT` - Export formats: `json`, `yaml`, `csv`, `xml`, `toml` (can specify multiple)\n- `--output-dir, -o DIR` - Output directory (default: current directory)\n- `--prefix, -p PREFIX` - Output filename prefix (default: \"tfkit-export\")\n- `--split-by TYPE` - Split exports by category: `type`, `provider`, `module`\n- `--include PATTERN` - Include specific components (can use multiple times)\n- `--exclude PATTERN` - Exclude specific components (can use multiple times)\n- `--compress, -c` - Compress output files into ZIP archive\n\n**Examples:**\n\n```bash\n# Export as JSON (default)\ntfkit export\n\n# Export multiple formats\ntfkit export --format json --format yaml --format csv\n\n# Export to specific directory\ntfkit export --format json --output-dir ./exports\n\n# Split exports by provider\ntfkit export --format csv --split-by provider\n\n# Export with compression\ntfkit export --format json --format yaml --compress\n\n# Custom filename prefix\ntfkit export --format json --prefix infrastructure-2024\n```\n\n**Exported Data:**\n\nThe export includes:\n\n- **Summary**: Resource counts and project metadata\n- **Health Metrics**: Health score and issue counts\n- **Resource Types**: Detailed breakdown of all resource types\n- **State Distribution**: Classification of components\n- **Issues**: Unused objects, orphaned outputs, incomplete configurations\n- **Providers**: List of used providers\n\n### Examples Command\n\nDisplay practical usage examples and common patterns for all TFKit commands.\n\n```bash\ntfkit examples\n```\n\nShows real-world examples including:\n\n- Quick scanning workflows\n- Validation patterns\n- Export strategies\n- Complete analysis pipelines\n\n## Advanced Usage\n\n### Complete Analysis Pipeline\n\n```bash\n# 1. Quick project scan with health assessment\ntfkit scan --save initial-scan.json\n\n# 2. Full validation with all checks\ntfkit validate --all --strict\n\n# 3. Generate interactive visualization\ntfkit scan --open --theme dark --layout graph\n\n# 4. Export data for external tools\ntfkit export --format json --format yaml --compress\n```\n\n### Security-Focused Workflow\n\n```bash\n# Security validation\ntfkit validate --check-security --strict --fail-on-warning\n\n# Scan with security assessment\ntfkit scan --format json --save security-scan.json\n\n# Generate security report\ntfkit scan --open --theme cyber\n```\n\n### CI/CD Integration\n\n```bash\n# Pre-commit validation\ntfkit validate --check-syntax --check-references --fail-on-warning\n\n# Full CI validation with SARIF\ntfkit validate --all --strict --fail-on-warning --format sarif \u003e results.sarif\n\n# Automated scanning with JSON output\ntfkit scan --quiet --format json --save scan-results.json\n```\n\n### Multi-Format Export Workflow\n\n```bash\n# Export all formats with compression\ntfkit export --format json --format yaml --format csv --compress\n\n# Split by provider for large projects\ntfkit export --format json --split-by provider --output-dir exports/\n\n# Custom export with filtering\ntfkit export --format yaml --prefix prod-infra --exclude \"*.test.tf\"\n```\n\n## Output Examples\n\n### Scan Results (Table Format)\n\n```\n████████╗███████╗██╗  ██╗██╗████████╗\n╚══██╔══╝██╔════╝██║ ██╔╝██║╚══██╔══╝\n   ██║   █████╗  █████╔╝ ██║   ██║\n   ██║   ██╔══╝  ██╔═██╗ ██║   ██║\n   ██║   ██║     ██║  ██╗██║   ██║\n   ╚═╝   ╚═╝     ╚═╝  ╚═╝╚═╝   ╚═╝\n\n📊 TERRAFORM PROJECT SUMMARY\n┏━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ Metric       ┃ Count ┃ Details                ┃\n┡━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩\n│ Total Objects│   24  │ All Terraform components│\n│ Resources    │   15  │ 8 unique types         │\n│ Data Sources │    3  │ External data references│\n│ Variables    │   12  │ 10 used                │\n│ Outputs      │    8  │ 2 orphaned             │\n│ Providers    │    3  │ aws, null, template    │\n└──────────────┴───────┴────────────────────────┘\n\n🏥 HEALTH ASSESSMENT\n┏━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━┓\n┃ Category       ┃ Count ┃ Status           ┃\n┡━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━┩\n│ Overall Score  │ 85.0% │ Excellent        │\n│ Unused Objects │   2   │ Potential cleanup│\n│ Orphaned Outputs│  2   │ Unused outputs   │\n│ Incomplete     │   1   │ Missing values   │\n└────────────────┴───────┴──────────────────┘\n```\n\n### Validation Results (Table Format)\n\n```\n✓ Validating Configuration\n   Path: /path/to/terraform\n   Mode: STRICT\n\n   🔍 Checking syntax...\n   🔗 Validating references...\n   📋 Checking best practices...\n   🔒 Security validation...\n\n┏━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ Severity ┃ Category   ┃ Rule   ┃ Location       ┃ Resource      ┃ Message                ┃\n┡━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩\n│ ❌ ERROR │ Security   │ TF101  │ main.tf:15     │               │ Missing security group │\n│ ⚠️ WARNING│ References│ TF020  │ variables.tf:8 │ var.region    │ Unused variable       │\n└──────────┴────────────┴────────┴────────────────┴───────────────┴────────────────────────┘\n\nValidation Summary\nErrors: 1  Warnings: 1  Info: 0  Passed: 45\n\n✗ Validation failed\n```\n\n### Scan Results (Simple Format)\n\n```\nTERRAFORM SCAN RESULTS\n📦 Total Objects: 24\n🔧 Resources: 15 (8 types)\n📊 Data Sources: 3\n⚙️  Providers: aws, null, template\n🏥 Health: 🟢 85.0%\n⚠️  Unused: 2 objects\n📤 Orphaned: 2 outputs\n```\n\n## Global Options\n\nAvailable for all commands:\n\n- `--version, -v` - Show version and exit\n- `--welcome, -w` - Show welcome message with quick start guide\n- `--debug` - Enable debug output for troubleshooting\n- `--help, -h` - Show command help\n\n## Development\n\n### Installation from Source\n\n```bash\ngit clone https://github.com/ivasik-k7/tfkit.git\ncd tfkit\npip install -e .\n```\n\n### Running Tests\n\n```bash\npytest tests/ -v\n```\n\n## Requirements\n\n- Python 3.8+\n- Click 8.0+\n- Rich 13.0+\n- python-hcl2 (for validation features)\n- PyYAML (optional, for YAML export)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Built with [Rich](https://github.com/Textualize/rich) for beautiful terminal output\n- Uses [Click](https://click.palletsprojects.com/) for CLI framework\n- Inspired by Terraform best practices and community tools\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivasik-k7%2Ftfkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivasik-k7%2Ftfkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivasik-k7%2Ftfkit/lists"}