Skip to content

CLI reference ​

text
planlens <plan>                    Open the plan in your browser
planlens export <plan> [-o file]   Write a shareable HTML report, with secrets removed
planlens demo                      Open a demo plan

The plan argument ​

You passplanlens does
A saved plan file (terraform plan -out=tfplan)Runs terraform show -json on it, falling back to tofu if terraform isn't installed
Plan JSON (terraform show -json tfplan > plan.json)Reads it directly; Terraform isn't needed
-Reads plan JSON from stdin

Saved plan files can only be read in the Terraform working directory that created them, after terraform init. Run planlens there, or pass --chdir.

Commands ​

planlens <plan> ​

Prints a summary, serves the viewer on 127.0.0.1 and opens your browser. It runs until you press Ctrl+C. planlens view <plan> is the same command, spelled out.

planlens export <plan> ​

Writes a self-contained HTML report with sensitive and secret-looking values removed. See Shareable reports.

planlens demo ​

Opens an illustrative AWS plan, so you can try planlens without a plan of your own.

Options ​

OptionDescription
-o, --out <file>Report file for export. Default: planlens-report.html
--include-sensitiveKeep sensitive values in the report. The file is written with mode 600.
--chdir <dir>Directory to run terraform show in. Default: the current directory
--tofuUse OpenTofu (tofu) to read saved plan files
--bin <path>The terraform or tofu binary to use
--port <n>Port for the viewer. Default: any free port
--no-openPrint the viewer address instead of opening a browser
-h, --helpShow help
-v, --versionShow the version

Exit codes ​

CodeMeaning
0Success
1The plan couldn't be read or the report couldn't be written; the message says why
2Invalid arguments

Environment ​

VariableEffect
NO_COLORTurns off colors in terminal output

When planlens runs terraform show, it sets TF_IN_AUTOMATION=1 so Terraform skips interactive hints.

Released under the MIT License.