TfBrief
TfBrief turns terraform show -json plan output into readable CI logs: a summary panel, per-resource actions, and attribute-level diffs. Use it in Terraform, GitHub Actions, and other DevOps / IaC pipelines when raw JSON is too noisy for reviewers.
- Terraform plan review without scrolling megabytes of JSON
- CI/CD friendly — stdlib only,
pip install tfbrief, one pipe on stdout - Optional
--has-changesboolean for conditionalterraform apply
Install from PyPI: pypi.org/project/tfbrief
Example output (fixture minimal-plan.json)
Why TfBrief?
Hashicorp’s JSON plan is complete but awkward in pull request checks and pipeline logs. TfBrief is a small Python CLI focused on infrastructure-as-code workflows: operators see what will create, update, or delete before apply, without a JSON viewer or custom jq scripts.
Typical fit: Terraform modules in GitHub Actions, GitLab CI, or any job that already runs terraform plan -out=tfplan.
Install
pip install tfbrief
Requires Python 3.10+. The tfbrief command is on your PATH after install.
Contributors (editable install from a clone):
pip install -e .
Usage
After terraform plan -out=tfplan, pipe the JSON plan into TfBrief:
terraform show -json tfplan | tfbrief
That prints the summary panel, resource table, and attribute diffs (see example above).
Markdown (pull request summaries)
For PR comments or GITHUB_STEP_SUMMARY, emit Markdown instead of ANSI terminal output:
terraform show -json tfplan | tfbrief --format markdown
Short form: --format=markdown or --format md.
Saving Markdown to a file on Windows: In Windows PowerShell 5.1, > / >> use Unicode (often UTF-16 LE), not the process stdout encoding — PYTHONIOENCODING alone does not fix that. Prefer one of:
Get-Content plan.json | python -m tfbrief --format markdown | Out-File -Encoding utf8 plan-summary.md
# Git Bash or WSL
terraform show -json tfplan | tfbrief --format markdown > plan-summary.md
See about_Character_Encoding. Linux runners (GITHUB_STEP_SUMMARY, >>) use UTF-8 by default.
Try on GitHub before a PyPI release: copy docs/examples/pr-plan-summary.yml into another repo’s .github/workflows/, set TFBRIEF_GIT_REF to the TfBrief branch you pushed, open a PR or run workflow_dispatch, then check the job Summary and the PR comment.
Optional: --has-changes (apply gate)
Same JSON input, different output — no formatted report. Stdout is only true or false so scripts can skip apply when the plan is empty:
terraform show -json tfplan | tfbrief --has-changes
# true
Plans with only no-op / read actions (and no output changes) print false. Resource or output changes print true. Invalid JSON prints an error to stderr and exits 1.
Typical pattern — log for humans, gate for apply:
terraform plan -out=tfplan
terraform show -json tfplan | tfbrief
if [ "$(terraform show -json tfplan | tfbrief --has-changes)" = "true" ]; then
terraform apply tfplan
fi
You do not need --has-changes if you only want readable CI logs or apply manually.
GitHub Actions
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -q tfbrief && terraform show -json tfplan | tfbrief
Post a Markdown plan summary on pull requests: use docs/examples/pr-plan-summary.yml. It appends to GITHUB_STEP_SUMMARY, updates one PR comment (marker <!-- tfbrief-plan-summary:v1 -->), skips comments on fork PRs (read-only token), and tolerates comment permission errors.
Or append to the job summary:
- run: |
echo '## Terraform plan' >> $GITHUB_STEP_SUMMARY
terraform show -json tfplan | tfbrief --format markdown >> $GITHUB_STEP_SUMMARY
Add --has-changes in a separate step only when a later step should run terraform apply conditionally.
Security
Redaction is best-effort. Treat CI logs as sensitive.
License
MIT — see LICENSE.
Metadata
Release files for tfbrief 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tfbrief-0.1.5.tar.gz | 20.5 kB | With provenance | Details for tfbrief-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tfbrief-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for tfbrief-0.1.5-py3-none-any.whl |
Total release size: 31.3 kB
Release files / tfbrief-0.1.5.tar.gz
| Download URL | tfbrief-0.1.5.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b514031e376699931b4dedcf0c4f4cbb4e7bc24a53e8c53580e36b316fd38d0b
|
|
BLAKE2b-256 checksum How to use checksums |
fff3091fc7ea813c500aea4a729b774b63a779e3d1323d67f3b1be147e921b15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / tfbrief-0.1.5-py3-none-any.whl
| Download URL | tfbrief-0.1.5-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4216c040251252102b98a5f2aceef34def1fd97223d68a42cde69039916b9e4d
|
|
BLAKE2b-256 checksum How to use checksums |
3006b7ab5ed0ced02925cf4f92d7c465ce415268c1a44229c841f06f92852e6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for tfbrief 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tfbrief-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.