Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,25 +208,25 @@ terragrunt run -- workspace ls
Similarly, commands like `graph` won't be supported as a shortcut, as `graph` is a now deprecated command in the Terragrunt CLI. Supporting it as a shortcut would be misleading, so you can use the `run` command to run it explicitly:

```bash
terragrunt run graph
terragrunt run --graph plan
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, this is wrong. The point of the command above is that the OpenTofu/Terraform command can't be run without using the run command.

Copy link
Author

@pedromtsilva pedromtsilva Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much knowledge on this flag. CodeRabbit, when i changed it to terragrunt run --graph only, suggested the changes above.

I followed this run --graph command usage description, in the documentation. Also, here, in the new CLI redesign section, it says to use terragrunt run graph. Please indicate the right usage to correctly apply the changes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's confusing, but there are two different graph commands, which drove some of the adjustments in the CLI Redesign project.

For some OpenTofu/Terraform commands, if there's no ambiguity, we directly forward the command from Terragrunt to OpenTofu/Terraform.

e.g.

terragrunt plan

Under the hood, calls either tofu plan or terraform plan, depending on the user's configurations.

This is just a shortcut, though, and it's the same as running the following:

terragrunt run plan

For other commands like graph, we don't want users who were using the old Terragrunt graph command to get confused when they see OpenTofu running the graph command, so we instead require that they explicitly use the run form if they want Terragrunt to run the OpenTofu command.

terragrunt run graph

You can see in the line above where you're proposing changes that we're explaining this:

Similarly, commands like graph won't be supported as a shortcut, as graph is a now deprecated command in the Terragrunt CLI. Supporting it as a shortcut would be misleading, so you can use the run command to run it explicitly:

If you think we can be clearer about the explanation, please consider updating that line to make it clearer.

```

You might want to explicitly indicate that the flag you are using is one for OpenTofu/Terraform, and not a Terragrunt flag. To do this, you can use the `--` argument to explicitly separate the Terragrunt flags from the OpenTofu/Terraform flags:

```bash
terragrunt run -- apply -auto-approve
terragrunt run -- apply -auto-approve
```

This usually isn't necessary, except when combining a complicated series of flags and arguments, which can be difficult to parse for the CLI.

In addition to allowing for explicit invocation of OpenTofu/Terraform instead of using shortcuts, the `run` command also takes on the responsibilities of the now deprecated `run-all` and `graph` commands using flags.

For example, if you are currently using the `terragrunt run --all` command, you can switch to the `run` command with the `--all` flag instead.
For example, if you are currently using the `terragrunt run-all` command, you can switch to the `run` command with the `--all` flag instead.

Before:

```bash
terragrunt run --all plan
terragrunt run-all plan
```

After:
Expand Down