A fast, extensible CLI tool for inspecting Terraform workspaces—supports unique module source listing, and more.
Go to the Releases page
Download the cp-tf-inspect binary for Linux.
curl -LO https://github.com/colpal/cp-tf-inspect/releases/download/vX.Y.Z/cp-tf-inspect
chmod +x cp-tf-inspect
./cp-tf-inspect --helpIf you are on a platform other than Linux or want to build from source:
git clone https://github.com/colpal/cp-tf-inspect.git
cd cp-tf-inspect
go build -o cp-tf-inspect .Command:
list-module-source
- Description: Outputs a unique, sorted JSON array of all module sources found in the specified workspace or module directory.
- Options:
--dir <directory>: Path to a Terraform workspace.--recursive: (Optional) Recursively follow local module calls (./,../) and include underlying module sources.
- Usage (non-recursive, default):
./cp-tf-inspect list-module-source --dir <path-to-terraform-workspace>
- Example:
./cp-tf-inspect list-module-source --dir ./test/fixtures/basic
- Output:
[ "../modules/storage", "git::https://example.com/bar.git", "terraform-aws-modules/vpc/aws" ]
- Example (with recursive wrapper layout):
./cp-tf-inspect list-module-source --dir ./test/fixtures/wrapper --recursive
Unit tests:
go test ./cmd/...Integration tests:
go build -o cp-tf-inspect
go test ./test/...- Every PR:
- Unique preview release with a tag like
pr-<PR_NUMBER>-<RUN_NUMBER>-<RUN_ATTEMPT>.
- Unique preview release with a tag like
- On every successful merge to main:
- A new automatic versioned release (semver, e.g.
v1.0.0,v1.0.1) - "Latest" release always updated.
- A new automatic versioned release (semver, e.g.
- Binaries:
- All stable and PR preview builds have downloadable
cp-tf-inspectbinary. - Download URL pattern:
https://github.com/colpal/cp-tf-inspect/releases/download/<tag>/cp-tf-inspect
- All stable and PR preview builds have downloadable
We welcome contributions via fork & pull request!
- Fork this repository.
- Create a feature/fix branch from
main. - Make your changes, following the commit message guidelines below.
- Push your branch and open a Pull Request (PR) to
main. - Ensure all Go tests pass. Our GitHub Actions will automatically run checks and build PR preview releases.
We use Conventional Commits for automated release management.
Every commit meant to trigger a release must start with a valid type and a colon.
fix: correct terraform parsing bug
feat: add storage module support
chore: update dependencies
Format:
<type>[optional scope]: <short description>
Recommended types:
feat: New featurefix: Bug fixchore: Internal/tooling changedocs: Documentationrefactor: Code refactoringtest: Testing only
Any type is allowed (with current config), as long as the message starts with type:.
- Main development happens on
mainonly. - All features/fixes go through short-lived feature branches pushed directly to this repo.
- PRs must target
mainand pass CI before being merged.