Skip to content

CLI Usage

Huzefaaa2 edited this page Jan 24, 2026 · 13 revisions

CLI Usage

Install

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Install from PyPI

pip install terraform-guardrail

PyPI: https://pypi.org/project/terraform-guardrail/ (latest: 0.2.9)

Scan

terraform-guardrail scan ./examples
terraform-guardrail scan ./examples --state ./examples/sample.tfstate
terraform-guardrail scan ./examples --schema

Generate snippets

terraform-guardrail generate aws aws_s3_bucket --name demo
terraform-guardrail generate azure azurerm_storage_account --name demo

Policy registry (OPA bundles)

terraform-guardrail policy list
terraform-guardrail policy fetch baseline --destination ./policies

Clone this wiki locally