← Back to all products

Environment Manager

$19

Multi-environment configuration manager with secrets, variables, and environment promotion.

📁 12 files
JSONMarkdownPython

📄 Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample

📁 File Structure 12 files

environment-manager/ ├── LICENSE ├── README.md ├── examples/ │ ├── env.dev │ ├── env.prod │ └── required_vars.json ├── free-sample.zip ├── guide/ │ ├── 01_features.md │ ├── 02_quick-start.md │ ├── 03_cli-reference.md │ └── 04_license.md ├── index.html └── src/ └── env_manager.py

📖 Documentation Preview README excerpt

Environment Manager

Part of the Deploy Kit by CodeVault

Manage .env files across development, staging, and production environments. Diff, sync, validate, and audit environment configurations to prevent missing variables from breaking your deployments.

Features

  • Diff environments: Compare .env files across dev/staging/prod and spot missing or changed variables
  • Sync variables: Copy missing variables from one environment to another
  • Validate configs: Check for required variables, empty values, and format issues
  • Audit report: Generate a full audit of all environments as JSON or text
  • Template generation: Create .env.example from your actual .env (strips values)
  • Support for comments and sections in .env files
  • Detects common mistakes: trailing spaces, duplicate keys, unquoted special characters
  • Python stdlib only — zero dependencies

Quick Start


# Compare two environment files
python src/env_manager.py diff --source examples/env.dev --target examples/env.prod

# Validate an env file against required variables
python src/env_manager.py validate --env examples/env.dev --required examples/required_vars.json

# Sync missing variables from dev to staging
python src/env_manager.py sync --source examples/env.dev --target examples/env.staging

# Generate .env.example template (strips secret values)
python src/env_manager.py template --env examples/env.dev --output .env.example

# Full audit report across all environments
python src/env_manager.py audit --envs examples/env.dev,examples/env.staging,examples/env.prod --format json

CLI Reference

CommandDescription
diffCompare two env files and show differences
validateCheck env file for issues and required vars
syncCopy missing variables from source to target
templateGenerate .env.example from a real env file
auditFull audit report across multiple env files
FlagDescription
--sourceSource env file (for diff/sync)
--targetTarget env file (for diff/sync)
--envEnv file to operate on (for validate/template)
--envsComma-separated list of env files (for audit)
--requiredJSON file listing required variable names
--output, -oOutput file path
--format, -fOutput format: text or json
--verbose, -vEnable verbose logging

License

MIT — See LICENSE file.

... continues with setup instructions, usage examples, and more.

📄 Code Sample .py preview

src/env_manager.py #!/usr/bin/env python3 """ Environment Manager — Deploy Kit by DataNest Manage .env files across development, staging, and production environments. Diff, sync, validate, audit, and generate templates from environment configs. Why this exists: Missing or mismatched environment variables are one of the most common causes of deployment failures. This tool lets you compare .env files across environments, validate them against a requirements spec, and generate sanitized templates — all from the command line. Usage: python env_manager.py diff --source .env.dev --target .env.prod python env_manager.py validate --env .env.dev --required required_vars.json python env_manager.py sync --source .env.dev --target .env.staging python env_manager.py template --env .env.dev --output .env.example python env_manager.py audit --envs .env.dev,.env.staging,.env.prod --format json License: MIT """ from __future__ import annotations import argparse import json import logging import re import sys from dataclasses import dataclass, field from datetime import datetime, timezone from pathlib import Path from typing import Any # --------------------------------------------------------------------------- # Constants # --------------------------------------------------------------------------- LOG = logging.getLogger("env-manager") # Patterns that suggest a value is a secret and should be masked in templates. # We check the variable NAME against these patterns. SECRET_PATTERNS: list[re.Pattern[str]] = [ re.compile(r"(password|passwd|secret|token|key|credential)", re.IGNORECASE), ] # Common issues detected during validation ISSUE_EMPTY_VALUE = "empty_value" ISSUE_TRAILING_SPACE = "trailing_space" # ... 619 more lines ...
Buy Now — $19 Back to Products