Terraflow is a real-time development solution for Terraform and OpenTofu, letting you explore and understand your infrastructure as you code.
While traditional Terraform debugging feels disconnected, Terraflow introduces a liquid approach, turning Terraform development into a continuously responsive experience.
You edit code, Terraflow reflects the changes.
Live Updates: The console automatically refreshes when you modify .tf or .tfvars files. Edit your Terraform configuration, and the console immediately reflects the changes.
Tab Autocompletion: Press Tab to cycle through available completions for variables, locals, resources, modules, and functions. Press Shift+Tab to cycle backward through suggestions.
Command History: All executed commands are persisted. Use the up and down arrow keys to navigate through your command history across sessions.
Multiline Expressions: Paste complex multiline Terraform expressions directly into the console. The console automatically handles formatting and evaluation.
Suggestions: As you type, the console displays inline suggestions based on your command history and available Terraform functions. Press the right arrow at the end of a line to accept a suggestion.
- Download the latest release from the Releases page.
- Unpack it
tar -zxvf terraflow_0.1.1_darwin_arm64.tar.gz - Move the binary from the unpacked directory to its desired destination
mv terraflow_0.1.1_darwin_arm64/bin/terraflow /usr/local/bin/terraflow
Run the following command in the Terraform project directory to start the interactive console.
$ terraflow console- Navigate to your Terraform project directory:
$ cd /path/to/your/terraform/project- Start the console:
$ terraflow console- Try evaluating some expressions:
>> var.some_var
"initial"
>> upper("hello world")
"HELLO WORLD"
>> local.environment
"production"
- Exit the console:
>> exit
Or press Ctrl+D.
$ terraflow console [options]| Option | Description |
|---|---|
-var-file=path |
Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded. |
-backend-config=path |
Configuration to be merged with what is in the configuration file's 'backend' block. This can be either a path to an HCL file with key/value assignments (same format as terraform.tfvars) or a 'key=value' format, and can be specified multiple times. The backend type must be in the configuration itself. |
-pull-remote-state |
Pull the remote state from its location. |
| Shortcut | Action |
|---|---|
Tab |
Cycle forward through completions |
Shift+Tab |
Cycle backward through completions |
Right Arrow |
Accept suggestion |
Up / Down Arrows |
Navigate command history |
Ctrl+C |
Clear current input and show fresh prompt |
Ctrl+D or exit |
Exit the console |
Evaluate variables:
$ terraflow console -var-file=production.tfvars>> var.instance_type
"t3.large"
>> var.region
"us-west-2"
Work with remote state:
$ terraflow console -backend-config=backend.hcl -pull-remote-stateThis pulls the current remote state so you can query real deployed resources and data sources.
Complex expressions:
The console supports multiline expressions, just paste them in:
>> [for x in ["hello", "world"]:
.. upper(x)
.. ]
[
"HELLO",
"WORLD",
]
See Contribution guide for workflow and guidelines.
See the LICENSE file.