envcmp
A lightweight CLI tool to sync CI/CD variables and secrets between platforms.
The problem
Your variables live in multiple places:
- Terraform Cloud workspace
- GitLab CI variables
- GitHub Actions secrets
.envfiles
They should always be in sync — but no tool does this automatically.
Solution
# see what's different
envcmp diff --from gitlab:my-project --to terraform:my-workspace
# output
KEY SOURCE TARGET STATUS
──────────────────────────────────────────────
DB_HOST localhost localhost in sync
DB_PORT 5432 5432 in sync
API_KEY •••••••• (not set) source only
STRIPE_KEY (not set) •••••••• target only
DB_PASS •••••••• •••••••• differs
Supported platforms
| Platform | Category | Read | Write | Status |
|---|---|---|---|---|
.env files |
Local | ✅ | ✅ | available |
| GitLab CI Variables | CI/CD | ✅ | ✅ | available |
| Terraform Cloud | IaC | ✅ | ✅ | available |
| GitHub Actions | CI/CD | ✅ | ⚠️ | available |
| HashiCorp Vault | Secret Store | ✅ | ✅ | available |
| AWS Secrets Manager | Secret Store | 🔜 | 🔜 | coming soon |
| Azure Key Vault | Secret Store | 🔜 | 🔜 | coming soon |
| GCP Secret Manager | Secret Store | 🔜 | 🔜 | coming soon |
| Pulumi ESC | IaC | 🔜 | 🔜 | coming soon |
| Jenkins | CI/CD | 🔜 | 🔜 | coming soon |
| CircleCI | CI/CD | 🔜 | 🔜 | coming soon |
| Azure DevOps | CI/CD | 🔜 | 🔜 | coming soon |
| Kubernetes Secrets | Container | 🔜 | 🔜 | coming soon |
| Vercel | Deploy | 🔜 | 🔜 | coming soon |
| Railway | Deploy | 🔜 | 🔜 | coming soon |
| Fly.io | Deploy | 🔜 | 🔜 | coming soon |
Installation
pip install envcmp
Configuration
Copy .env.example to .env and fill in your credentials:
cp .env.example .env
GITLAB_URL=https://gitlab.com
GITLAB_TOKEN=glpat-...
GITLAB_PROJECT_ID=12345678
GITHUB_TOKEN=ghp_...
GITHUB_ORGANIZATION=my-org
GITHUB_REPOSITORY=my-repo
TERRAFORM_TOKEN=...
TERRAFORM_ORGANIZATION=my-org
TERRAFORM_WORKSPACE=my-workspace
Usage
# diff between two providers
envcmp diff --from gitlab:my-project --to terraform:my-workspace
# diff between two .env files
envcmp diff --from env:.env.production --to env:.env.staging
# push changes
envcmp push --from gitlab:my-project --to terraform:my-workspace
# dry run
envcmp push --from env:.env --to env:.env.staging --dry-run
# pull changes from target to source
envcmp pull --from env:.env.local --to gitlab:my-project
# dry run
envcmp pull --from env:.env.local --to gitlab:my-project --dry-run
Development
git clone https://github.com/saeedya/envcmp.git
cd envcmp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
Integration Tests
Requires Docker:
# start services
docker-compose -f docker-compose.test.yml up -d
# run integration tests
pytest tests/integration/ -v -m integration
# stop services
docker-compose -f docker-compose.test.yml down
Security
- Secret values are never printed in plain text
- All output uses masked values (
••••••••) - Dependencies scanned with
pip-auditandbandit
Contributing
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a branch:
git checkout -b feat/your-feature - Make your changes
- Run tests:
pytest tests/unit/ tests/security/ - Run pre-commit:
pre-commit run --all-files - Commit:
git commit -m "feat: your feature" - Push and open a Pull Request
See docs/contributing.md for more details.
License
MIT
Metadata
Release files for envcmp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| envcmp-0.2.0.tar.gz | 21.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| envcmp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.8 kB
Release files / envcmp-0.2.0.tar.gz
| Download URL | envcmp-0.2.0.tar.gz |
|---|---|
| Size | 21.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46317ac2a65ef00a3233a409f12295751ac957a789d8f3f568dfc0c0c1eec20f
|
|
BLAKE2b-256 checksum How to use checksums |
1d1454ee02b8901e9023a269f29043b505e76a9647b6e0e56f0e716bfeba1e1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / envcmp-0.2.0-py3-none-any.whl
| Download URL | envcmp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
023d710aaebe75ad55e6b5c49371c3161f5d0c5c5ef03e08512f293c2b086937
|
|
BLAKE2b-256 checksum How to use checksums |
54970733a1b400a6f73449e21859411d71fd0e6892f17fb09cf64ffd59667c5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|