Skip to main content

Prevent environment variable drift with Pydantic schema validation, pre-commit hooks, and dotenvx encryption

Project description

envdrift logo

envdrift

PyPI version Python 3.11+ License: MIT Docs codecov CodSpeed

Sync environment variables across your team. No more "it works on my machine."

Status: stable. envdrift v11 marks the first release the project considers production-ready: core features are covered by integration tests against real backends in CI (LocalStack, HashiCorp Vault, Lowkey Vault emulating Azure) and the real encryption binaries, every bug fix ships a regression test, and changes pass a reliability-first review gate. See the changelog for history.

The Problem

  • New developer joins → spends half a day hunting for the right .env values
  • Someone updates a secret → nobody else knows until production breaks
  • "Can you send me the latest API keys?" in Slack → security nightmare

Paid SaaS solutions exist, but do you really want your production secrets on someone else's infrastructure?

The Solution

envdrift is an open-source CLI that encrypts .env files and syncs them using your existing cloud vault and git. No hosted service, no additional servers, no third-party trust.

  • Your infrastructure — Works with all major cloud providers: Azure Key Vault, AWS Secrets Manager, HashiCorp Vault, GCP Secret Manager
  • Zero trust required — Secrets never leave your cloud
  • No new servers — Just a CLI tool, no client-server architecture
  • Free forever — MIT licensed, no per-seat pricing
# New team member onboarding - one command
envdrift pull

# That's it. Keys synced from vault, .env files decrypted, ready to code.

📘 This is the heart of envdrift. The end-to-end walkthrough — encrypt, push your key to your cloud vault, and have teammates pull and decrypt in one command — lives in the Env File Sync Guide. Start there.

Installation

One-liner (recommended):

# macOS / Linux
curl -sSL https://raw.githubusercontent.com/jainal09/envdrift/main/install.sh | sh

# Windows (PowerShell)
irm https://raw.githubusercontent.com/jainal09/envdrift/main/install.ps1 | iex

Or via pip:

pip install "envdrift[vault]"  # All vault providers

Quick Start

1. Encrypt and push to vault (once per project):

envdrift encrypt .env.production
envdrift vault-push . my-app-key --env production --provider azure --vault-url https://myvault.vault.azure.net/

2. Team members pull instantly (no config needed):

envdrift vault-pull . my-app-key --env production --provider azure --vault-url https://myvault.vault.azure.net/

vault-pull fetches the key, writes .env.keys, and decrypts .env.production in one step.

3. Daily workflow (config-based, needs [vault.sync] in envdrift.toml):

envdrift pull   # After git pull - sync keys, decrypt
envdrift lock   # Before commit - encrypt, verify keys

Note: pull/lock operate on all services defined in your sync config. For a single secret without any TOML config, use vault-pull/vault-push.

Beyond Sync

Feature Description
Schema Validation Validate .env against Pydantic schemas
Environment Diffing Compare dev vs staging vs production
Vault Integration Azure, AWS, HashiCorp, GCP
Encryption dotenvx and SOPS backends
CI/CD Mode Fail builds on misconfiguration
envdrift validate .env --schema config:Settings
envdrift diff .env.dev .env.prod

Documentation

Full documentation: jainal09.github.io/envdrift

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envdrift-11.0.0.tar.gz (4.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envdrift-11.0.0-py3-none-any.whl (386.0 kB view details)

Uploaded Python 3

File details

Details for the file envdrift-11.0.0.tar.gz.

File metadata

  • Download URL: envdrift-11.0.0.tar.gz
  • Upload date:
  • Size: 4.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for envdrift-11.0.0.tar.gz
Algorithm Hash digest
SHA256 fbfa0772efd039a75cf9e6c6edc62bca26211065f078041a57d143514c2388f6
MD5 bfa3f2a9d853f03d53d8111aa63d7353
BLAKE2b-256 f5ddf4c2bfefc0e42b6a261afa7e7e04979c28253a716e8ca72be346288e72e2

See more details on using hashes here.

File details

Details for the file envdrift-11.0.0-py3-none-any.whl.

File metadata

  • Download URL: envdrift-11.0.0-py3-none-any.whl
  • Upload date:
  • Size: 386.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for envdrift-11.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 588939b742f3e7fb3022e4727ea624e72286a6dcd4d16227d237e217a3416cf5
MD5 5388bc6aea96a2a739859a6c87d765ac
BLAKE2b-256 a72c4f9620d2cbf13a32800a45396a3c0af51ca787ccd2f135ae4541bc0220ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page