Skip to content

Global Flags

The Terragrunt CLI supports the following global flags:

--experimentoptional(string)

Enables a specific experiment.

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

Environment Variables:

  • TG_EXPERIMENT
--experiment-modeoptional(bool)

Enables experiment mode for Terragrunt.

For more information, see the experiments documentation.

Environment Variables:

  • TG_EXPERIMENT_MODE
--log-custom-formatoptional(string)

Set the custom log formatting.

For more information, see the log formatting documentation.

Environment Variables:

  • TG_LOG_CUSTOM_FORMAT
--log-disableoptional(bool)

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.

Environment Variables:

  • TG_LOG_DISABLE
--log-formatoptional(string)

Set the format for Terragrunt's log output.

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

Environment Variables:

  • TG_LOG_FORMAT
--log-leveloptional(string)

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.

Environment Variables:

  • TG_LOG_LEVEL
--log-show-abs-pathsoptional(bool)

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.

Environment Variables:

  • TG_LOG_SHOW_ABS_PATHS
--no-coloroptional(bool)

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.

Environment Variables:

  • TG_NO_COLOR
--no-tipoptional(string)

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.

Environment Variables:

  • TG_NO_TIP
--no-tipsoptional(bool)

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.

Environment Variables:

  • TG_NO_TIPS
--non-interactiveoptional(bool)

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.

Environment Variables:

  • TG_NON_INTERACTIVE
--profile-cpuoptional(string)

Write a CPU profile to the given path.

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.

Environment Variables:

  • TG_PROFILE_CPU
--profile-diroptional(string)

Directory to write profile files (cpu, mem, goroutine).

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 --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.

Environment Variables:

  • TG_PROFILE_DIR
--profile-goroutineoptional(string)

Write a goroutine profile to the given path.

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.

Environment Variables:

  • TG_PROFILE_GOROUTINE
--profile-memoptional(string)

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

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.

Environment Variables:

  • TG_PROFILE_MEM
--strict-controloptional(string)

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.

Environment Variables:

  • TG_STRICT_CONTROL
--strict-modeoptional(bool)

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.

Environment Variables:

  • TG_STRICT_MODE
--working-diroptional(string)

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

Environment Variables:

  • TG_WORKING_DIR
--helpoptional(bool)

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.

--versionoptional(bool)

Show terragrunt version.

Displays the current version of Terragrunt.