Skip to content
🎉 Terragrunt v1.0 is here! Read the announcement to learn more.

Global Flags

The Terragrunt CLI supports the following global flags:

--experiment

Enables a specific experiment.

For a list of available experiments, see the experiments documentation.

Type: string

Environment Variables:

  • TG_EXPERIMENT

--experiment-mode

Enables experiment mode for Terragrunt.

For more information, see the experiments documentation.

Type: boolean

Environment Variables:

  • TG_EXPERIMENT_MODE

--log-custom-format

Set the custom log formatting.

For more information, see the log formatting documentation.

Type: string

Environment Variables:

  • TG_LOG_CUSTOM_FORMAT

--log-disable

Disable logging.

When enabled, Terragrunt will disable all logging output. This is useful when you want to see only the OpenTofu/Terraform output or when using Terragrunt in scripts where logging isn’t needed.

Note that this automatically enables the --tf-forward-stdout flag to ensure OpenTofu/Terraform output is still visible.

Type: bool

Environment Variables:

  • TG_LOG_DISABLE

--log-format

Set the format for Terragrunt's log output.

For a list of available formats and their descriptions, see the log formatting documentation.

Type: string

Environment Variables:

  • TG_LOG_FORMAT

--log-level

Sets the logging level for Terragrunt.

Controls the verbosity of Terragrunt’s logging output. For more information about available log levels and their meanings, see the log levels documentation.

Type: string

Environment Variables:

  • TG_LOG_LEVEL

--log-show-abs-paths

Show absolute paths in logs.

When enabled, Terragrunt will show absolute paths in log messages instead of relative paths.

For more information, see the log formatting documentation.

Type: bool

Environment Variables:

  • TG_LOG_SHOW_ABS_PATHS

--no-color

Disable color output for both Terragrunt and OpenTofu/Terraform.

When enabled, Terragrunt will disable colored output in both its own logs and in OpenTofu/Terraform output. This is useful when running in environments where color codes might cause issues, such as CI/CD pipelines or when redirecting output to files.

Type: bool

Environment Variables:

  • TG_NO_COLOR

--no-tip

Disable specific tips from being displayed.

Disables specific tips from being displayed. This flag can be used multiple times to disable multiple tips. To disable all tips at once, use --no-tips instead.

Type: string

Environment Variables:

  • TG_NO_TIP

--no-tips

Disable all tips from being displayed.

When enabled, Terragrunt will not display any tips in the output. To disable only specific tips, use --no-tip instead.

Type: bool

Environment Variables:

  • TG_NO_TIPS

--non-interactive

Assume "yes" for all prompts.

When enabled, Terragrunt will automatically answer “yes” to any prompts that would normally require user input. This is particularly useful in automated environments or CI/CD pipelines where user interaction isn’t possible.

Type: bool

Environment Variables:

  • TG_NON_INTERACTIVE

--profile-cpu

Write a CPU profile to the given path. Requires the profiling experiment.

Write a CPU profile of the Terragrunt process.

The profile can be analyzed with go tool pprof:

Terminal window
go tool pprof terragrunt_cpu.prof

This flag profiles the Terragrunt process only. To also collect CPU profiles from downstream OpenTofu processes, use --profile-dir, or set TOFU_CPU_PROFILE explicitly in your environment (supported by OpenTofu 1.11 or later).

When used together with --profile-dir, this exact path is used as-is for the Terragrunt CPU profile; it is not placed inside the directory.

Type: string

Environment Variables:

  • TG_PROFILE_CPU

--profile-dir

Directory to write profile files (cpu, mem, goroutine). Requires the profiling experiment.

Collect CPU, memory, and goroutine profiles into the given directory using conventional names:

  • terragrunt_cpu.prof
  • terragrunt_mem.prof
  • terragrunt_goroutine.prof

In addition, each unit’s downstream OpenTofu process writes its own CPU profile to tofu_cpu_<command>.prof (for example tofu_cpu_plan.prof) inside a unit-specific subdirectory (supported by OpenTofu 1.11 or later; Terraform ignores it). A unit at the working directory root writes directly into the profile directory, and units outside the working directory are placed under an external/ subdirectory so they never collide.

Example:

Terminal window
terragrunt --experiment=profiling --profile-dir /tmp/profiles run --all -- plan

This is the recommended way to collect profiles when using run --all, because unit-specific subdirectories prevent parallel OpenTofu processes from writing to the same file.

Individual paths (--profile-cpu, --profile-mem, etc.) are used as-is for the corresponding Terragrunt profile; they are not placed inside the directory.

Type: string

Environment Variables:

  • TG_PROFILE_DIR

--profile-goroutine

Write a goroutine profile to the given path. Requires the profiling experiment.

Write a goroutine profile of the Terragrunt process at the end of the run. It contains stack traces of all goroutines, which is useful to inspect what goroutines are blocked or running.

Analyze with:

Terminal window
go tool pprof terragrunt_goroutine.prof

When using --profile-dir, the file is written as terragrunt_goroutine.prof inside the directory. An explicit --profile-goroutine path is used as-is and is not placed inside the directory.

Type: string

Environment Variables:

  • TG_PROFILE_GOROUTINE

--profile-mem

Write a memory (heap) profile to the given path. Requires the profiling experiment.

Write a memory (heap) profile of the Terragrunt process at the end of the run (after forcing garbage collection). Forcing garbage collection pauses Terragrunt briefly, so enabling memory profiling can degrade performance at the end of the run.

This profiles the Terragrunt process only. There is no equivalent for downstream OpenTofu/Terraform.

Analyze with:

Terminal window
go tool pprof terragrunt_mem.prof

When using --profile-dir, the file is written as terragrunt_mem.prof inside the directory. An explicit --profile-mem path is used as-is and is not placed inside the directory.

Type: string

Environment Variables:

  • TG_PROFILE_MEM

--strict-control

Enables specific strict controls.

Enables specific strict controls in Terragrunt. For a list of available controls and their descriptions, run terragrunt info strict.

This flag provides finer-grained control compared to --strict-mode, allowing you to enable specific controls rather than all of them.

For more information, see the strict controls documentation.

Type: string

Environment Variables:

  • TG_STRICT_CONTROL

--strict-mode

Enables strict mode for Terragrunt.

When enabled, Terragrunt will operate in strict mode, which opts in the user to all future breaking changes. For more information about what strict mode enables, run terragrunt info strict.

For more information about strict mode, see the strict controls documentation.

Type: bool

Environment Variables:

  • TG_STRICT_MODE

--working-dir

The path where all commands should be run. Default is current directory.

Specifies the working directory where Terragrunt should execute its commands. By default, Terragrunt uses the current directory.

Example:

Terminal window
terragrunt run plan --working-dir /path/to/infrastructure/prod
Type: string

Environment Variables:

  • TG_WORKING_DIR

--help

Show help information.

Displays help information about Terragrunt commands and their usage. Can be used with specific commands to get detailed help about that command.

Type: bool

--version

Show terragrunt version.

Displays the current version of Terragrunt.

Type: bool