Skip to content

Quick Start

Get started with TerraTidy in under 5 minutes.

Initialize Configuration

Create a .terratidy.yaml configuration file in your project:

terratidy init

This creates a default configuration:

version: 1

engines:
  fmt:
    enabled: true
  style:
    enabled: true
  lint:
    enabled: true
  policy:
    enabled: false

severity_threshold: warning

Run Checks

Check All Files

terratidy check

Check Specific Files or Directories

terratidy check --paths ./modules/
terratidy check --paths main.tf,variables.tf

Check Only Changed Files (Git)

terratidy check --changed

Run Individual Engines

# Format only
terratidy fmt

# Style checks only
terratidy style

# Lint only
terratidy lint

# Policy checks only
terratidy policy

Fix Issues

Auto-fix All Fixable Issues

terratidy fix

Fix Formatting Only

terratidy fmt

Fix Style Issues

terratidy style --fix

Output Formats

# Default text output
terratidy check

# JSON output
terratidy check --format json

# SARIF for GitHub Code Scanning
terratidy check --format sarif

# HTML report
terratidy check --format html > report.html

Common Workflows

CI/CD Check

terratidy check --format sarif --severity-threshold error

Pre-commit Hook

terratidy check --changed

Development Workflow

# Format and fix issues
terratidy fix

# Verify all checks pass
terratidy check

Next Steps