Reference
Command reference
| Command | What it does |
|---|---|
serve |
opens the viewer for a Terraform directory, state or plan |
record |
saves a terraform … -json stream for the viewer while printing it |
export |
writes a self-contained HTML report, a Markdown summary or JSON |
check |
CI gate: writes reports and exits 3 when a --fail-on gate trips |
compare |
what differs between two saved states or plans |
demo |
the viewer on a built-in sample, no Terraform needed |
healthcheck |
checks that a running viewer answers, for containers |
version |
prints the version, commit and platform |
Every command prints its flags with -h, for example infraglass check -h. Flags take one dash
or two (-plan-file or --plan-file).
infraglass serve
Opens the viewer for a Terraform directory, state or plan.
| Flag | Default | |
|---|---|---|
--dir DIR |
. |
Terraform working directory (already initialized); runs terraform show -json there |
--plan-file FILE |
show a saved plan in --dir instead of the state |
|
--state FILE |
JSON from terraform show -json |
|
--plan FILE |
JSON from terraform show -json <planfile> |
|
--follow PATH |
<dir>/.infraglass/runs |
stream file or directory to watch for runs |
--no-live |
don't watch for runs | |
--terraform BIN |
on PATH |
terraform or tofu binary |
--port N |
7788 |
port (0 picks a free one) |
--no-open |
don't open a browser | |
--show-account-ids |
don't mask AWS account IDs | |
--addr IP |
127.0.0.1 |
address to listen on |
--allow-remote |
allow a non-loopback --addr |
|
--allow-host NAME |
extra Host header to accept, such as a proxy's name (repeatable) |
|
--quiet |
log only warnings and errors |
infraglass record [file]
Saves a terraform … -json stream from standard input while printing Terraform's messages.
Writes to file, or to a new file in --dir (default .infraglass/runs). Exits with status 1
when Terraform reports an error or the input isn't a JSON stream.
infraglass export
Writes a static copy of the viewer or a summary.
| Flag | Default | |
|---|---|---|
--dir, --plan-file, --state, --plan, --terraform, --show-account-ids |
as for serve |
|
--run PATH |
a recorded stream or runs directory to include (repeatable) | |
--include-run-output |
keep provisioner output and diagnostic messages from --run (left out by default) |
|
--format |
html |
html for a self-contained page, markdown for a summary, json for the infraglass.report/v1 contract |
-o FILE |
infraglass-report.html for HTML, standard output otherwise |
output file, - for standard output |
infraglass check
Reviews a plan or state for a pipeline: writes any reports asked for, prints a short summary, and exits 3 when a gate fails. See CI and pipelines.
| Flag | Default | |
|---|---|---|
--dir, --plan-file, --state, --plan, --terraform, --show-account-ids, --run, --include-run-output |
as for export |
|
--fail-on GATES |
none | comma-separated: high-risk, risk, stateful-change, delete, high-finding, finding, drift, failed-check, failed-run |
--json FILE |
write the infraglass.report/v1 JSON |
|
--markdown FILE |
write the Markdown summary | |
--html FILE |
write the self-contained HTML report |
infraglass compare BASE.json HEAD.json
Compares two snapshots from terraform show -json (two states, two plans, or one of each):
resources added, removed and changed, with the attribute paths that differ. Values are masked as
in the viewer.
| Flag | Default | |
|---|---|---|
--format |
text |
text, markdown, or json (infraglass.compare/v1) |
--show-account-ids |
don't mask AWS account IDs |
infraglass demo
Opens the viewer on a built-in sample and plays a recorded apply of it, the same page as the
hosted demo: it starts from the beginning
each time the page loads. Takes --speed N and the network flags of serve.
infraglass healthcheck
Exits 0 when a viewer answers on 127.0.0.1:--port (default 7788). Used by the container's
HEALTHCHECK.
infraglass version
Prints the version, commit and platform.
Environment variables
These fill a flag that wasn't given on the command line, for any of serve, demo, export,
check and healthcheck that has it:
| Variable | Flag |
|---|---|
INFRAGLASS_ADDR |
--addr |
INFRAGLASS_PORT |
--port |
INFRAGLASS_NO_OPEN |
--no-open |
INFRAGLASS_ALLOW_REMOTE |
--allow-remote |
INFRAGLASS_SHOW_ACCOUNT_IDS |
--show-account-ids |
INFRAGLASS_QUIET |
--quiet |
The container image sets INFRAGLASS_ADDR,
INFRAGLASS_ALLOW_REMOTE and INFRAGLASS_NO_OPEN.
Exit status
| Status | Meaning |
|---|---|
| 0 | success |
| 1 | an error, such as a failed apply in record or unreadable input |
| 2 | a usage error, such as an unknown flag or gate |
| 3 | check only: a gate in --fail-on failed (the reports are still written) |