
Let your IaC flex for you.
Terrafetch is the Neofetch of Terraform—because your infrastructure deserves a little flair. It scans your Terraform repository and displays key statistics like the number of variables, resources, modules, outputs, and more—all in a stylish, terminal-friendly format. Perfect for CLI screenshots, repo intros, or just flexing your infra hygiene.
If you have a functional Go environment, you can install with:
go install github.com/RoseSecurity/terrafetch@latest
To install packages, you can quickly setup the repository automatically:
curl -1sLf \
'https://dl.cloudsmith.io/public/rosesecurity/terrafetch/setup.deb.sh' \
| sudo -E bash
Once the repository is configured, you can install with:
apt install terrafetch
git clone git@github.com:RoseSecurity/terrafetch.git
cd terrafetch
make build
Important
Do you love the tool but it's missing some information you'd like to see? Head on over to this discussion and drop a comment or open a new issue!
⨠ terrafetch
╭─────────────────────────────────────────────────────────────────╮
│ . │
│@# - │
│@@@@@ Terraform Files: 1315 │
│@@@@@@@@. Documentation: 192 │
│@@@@@@@@@@ + # Providers: 334 │
│@@@@@@@@@@ @@@@ @@@@ Module Calls: 748 │
│@@@@@@@@@@ @@@@@@@. .@@@@@@@ Resources: 424 │
│ @@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ Data Sources: 288 │
│ +@@@@@ @@@@@@@@@@ @@@@@@@@@@ Variables: 6122 │
│ .@@ @@@@@@@@@@ @@@@@@@@@@ Sensitive Variables: 16 │
│ @@@@@@@@@@ @@@@@@@@@@ Outputs: 807 │
│ @+ -@@@@@@ @@@@@@= Sensitive Outputs: 22 │
│ @@@@@ .@@@ @@@. │
│ @@@@@@@@. │
│ @@@@@@@@@@ │
│ @@@@@@@@@@ │
│ @@@@@@@@@@ │
│ .@@@@@@@@ │
│ @@@@@ │
│ %@ │
│ │
╰─────────────────────────────────────────────────────────────────╯
Give your infrastructure repositories some flair by injecting Terrafetch statistics right into your documentation.
- Add report markers somewhere in your
README.md
(or any file you point the action at):
<!-- TERRAFETCH:START -->
<!-- TERRAFETCH:END -->
- Make sure your repo permissions allow the default
GITHUB_TOKEN
tocontents: write
so the bot can push the updated file.
name: Terrafetch
on:
schedule:
- cron: "0 3 * * *" # every night at 03:00
workflow_dispatch: # manual trigger when you need it
permissions:
contents: write # let the action push changes
jobs:
terrafetch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate README stats with Terrafetch
uses: RoseSecurity/terrafetch@v0.3.0
with:
terraform_directory: infra
output_file: README.md # file with the START/END markers
terrafetch_version: 0.3.0 # "latest" also works
- Enjoy your new and improved documentation (as you can see here)
Terrafetch
╭────────────────────────────────────────────────────────────────╮
│ . │
│@# - │
│@@@@@ Terraform Files: 54 │
│@@@@@@@@. Documentation: 8 │
│@@@@@@@@@@ + # Providers: 16 │
│@@@@@@@@@@ @@@@ @@@@ Module Calls: 19 │
│@@@@@@@@@@ @@@@@@@. .@@@@@@@ Resources: 11 │
│ @@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ Data Sources: 7 │
│ +@@@@@ @@@@@@@@@@ @@@@@@@@@@ Variables: 191 │
│ .@@ @@@@@@@@@@ @@@@@@@@@@ Sensitive Variables: 1 │
│ @@@@@@@@@@ @@@@@@@@@@ Outputs: 43 │
│ @+ -@@@@@@ @@@@@@= Sensitive Outputs: 1 │
│ @@@@@ .@@@ @@@. │
│ @@@@@@@@. │
│ @@@@@@@@@@ │
│ @@@@@@@@@@ │
│ @@@@@@@@@@ │
│ .@@@@@@@@ │
│ @@@@@ │
│ %@ │
│ │
╰────────────────────────────────────────────────────────────────╯
For bug reports & feature requests, please use the issue tracker.
PRs are welcome! We follow the typical "fork-and-pull" Git workflow.
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull Request so that we can review your changes
Tip
Be sure to merge the latest changes from "upstream" before making a pull request!