dotenvx is an enhanced environment variable loader and manager that builds on the original dotenv concept by adding strong encryption and cross-platform tooling, making it safer to work with .env files in development and production environments. Designed by the creator of the classic dotenv library, dotenvx preserves the familiar workflow while adding safeguards against one of the biggest risks with plain environment files: plaintext secrets exposure. It offers CLI commands that can encrypt and decrypt .env files, inject environment variables at runtime, and support conventions like layered environment file loading similar to Next.js or dotenv-flow. Beyond basic runtime usage, dotenvx includes tooling for key management, listing .env files in structured views, and operations like variable rotation and scoped overrides, bringing more robust secrets handling to modern app stacks.
Features
- Encrypt and decrypt .env files securely
- Cross-platform CLI with familiar dotenv-style usage
- Multi-environment and layered file support
- Runtime injection of environment variables
- Key management and rotation tooling
- Integration with existing JS/TS workflows