MCPcopy Index your code
hub / github.com/ElementTech/terracove

github.com/ElementTech/terracove @v0.0.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.7 ↗ · + Follow
38 symbols 124 edges 12 files 3 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

terracove

A recursive terraform repository tester powered by Terratest.

drawing drawing drawing drawing drawing drawing

Key FeaturesInstallUsageQuickstartCreditsSupportLicense

screenshot


Key Features

  • Test in parallel multiple directory paths
  • Export Results:
  • junit with --junit
  • json summary with --json
  • html report with --html
  • Generate % coverage for each module and root directory
  • Ignore Errors and Empty Modules
  • Supports terraform and terragrunt in the same directory tree

Install

The recommended way to install on MacOS is via brew:

brew tap elementtech/elementtech
brew install terracove

If you'd like to use Docker, you can use the official image:

docker run --rm -v $(pwd):/data ghcr.io/elementtech/terracove /data --json --junit --html

Or, you can install directly from release:

curl -sS https://raw.githubusercontent.com/elementtech/terracove/main/install.sh | bash

Usage

Usage:
  terracove [paths]... [flags]

Flags:
  -e, --exclude strings         Exclude directories while parsing tree
  -h, --help                    help for terracove
  -w, --html                    Output HTML Report
      --ignore-empty            Ignore Modules with 0 Resources
      --ignore-errors           Ignore Planning Errors
  -j, --json                    Output JSON
  -x, --junit                   Output Junit XML
      --minimal                 Don't Append Raw/JSON Plan to the Exported Output
      --o-html string           Output HTML Report File (default "terracove.html")
      --o-json string           Output JSON File (default "terracove.json")
      --o-junit string          Output Junit XML File (default "terracove.xml")
  -t, --validate-tf-by string   validate terraform by the existence of [filename] in a directory (default "main.tf")
  -g, --validate-tg-by string   validate terragrunt by the existence of [filename] in a directory (default "terragrunt.hcl")
  -v, --version                 version for terracove

Quickstart

Note that you must have terraform/terragrunt binaries installed on your machine

The examples directory contains 4 modules. 2 of them are terraform and 2 are terragrunt.

Oh no! It appears some of them have some problems. Let's see exactly what is going on. Clone this repository and give it a try.

git clone https://github.com/elementtech/terracove.git
cd terracove
terracove --minimal --junit --json --html . 
# . == examples == examples/terraform examples/terragrunt

Open the terracove.xml, terracove.json or terracove.html and observe the results. You should see the following:

[
 {
  "Timestamp": "1984-01-01T19:32:58+05:00",
  "Path": ".",
  "Results": [
   {
    "Path": "examples/terragrunt/no-resources",
    "ResourceCount": 0,
    "Coverage": 100,
    ...
   },
   {
    "Path": "examples/terragrunt/error",
    "Coverage": 0,
    ...
   },
   {
    "Path": "examples/terraform/tfstate-diff",
    "ResourceCount": 2,
    "ResourceCountDiff": 1,
    "Coverage": 50,
    ...
   },
   {
    "Path": "examples/terraform/success",
    "ResourceCount": 2,
    "ResourceCountExists": 2,
    "Coverage": 100,
    ...
   }
  ],
  "Coverage": 62.5
 }
]

Credits

This project uses or is inspired by the following open source projects:

Support

Buy Me A Coffee

License

MIT

Core symbols most depended-on inside this repo

checkModuleType
called by 5
pkg/scan/scan.go
percentage
called by 5
pkg/scan/scan.go
averagePercentage
called by 3
pkg/scan/scan.go
newRootCmd
called by 3
cmd/root.go
getAllDirectories
called by 2
pkg/scan/scan.go
Flatten
called by 2
pkg/scan/scan.go
TerraformModulesTerratest
called by 2
pkg/scan/scan.go
CreateCoverageXML
called by 2
pkg/report/report.go

Shape

Function 31
Struct 7

Languages

Go100%

Modules by API surface

pkg/scan/scan_test.go7 symbols
internal/types/types.go7 symbols
pkg/scan/scan.go6 symbols
pkg/report/report.go5 symbols
pkg/report/report_test.go4 symbols
cmd/root_test.go3 symbols
cmd/root.go3 symbols
pkg/html/html.go1 symbols
main.go1 symbols
internal/types/types_test.go1 symbols

For agents

$ claude mcp add terracove \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page