Skip to main content

EnvShield: A CLI for secure local environment management and secret prevention.

Project description

EnvShield 🛡️ – Environment Variable Management & Secret Scanner CLI

CI PyPI version License: MIT Downloads Website Stars

EnvShield is an open-source CLI for environment variable management, configuration as code, and proactive secret scanning—your caffeine-proof way to avoid the “oops, I just leaked prod keys” nightmare.

📚 Full Documentation

Table of Contents

  1. Why Secure Environment Management Matters

  2. Key Features of the EnvShield CLI

  3. Installation

  4. The EnvShield Philosophy: Schema-First Configuration

  5. CLI Commands

  6. Competitor Comparison: Choosing the Right Tool

  7. The Brains of the Operation: The Core Files

  8. Future Roadmap: Teams & Enterprise

  9. Community & Support

  10. TL;DR

Why Secure Environment Management Matters

Managing .env files by copy-pasting them around like a hot potato is fun… until a secret lands in a public repo. EnvShield solves the “dotenv dumpster fire” by giving you schema-first configuration, automatic documentation, and built-in secret scanning—all wrapped in a workflow lazy enough for a 3 a.m. commit.

Key Features of the EnvShield CLI

Demo of EnvShield scanning secrets

  • Environment Variable Governance – One env.schema.toml file becomes your single source of truth.

  • Open-Source Secret Scanner – Detects API keys, private keys, and other credentials before you push.

  • Local Development Workflow – Automatic .env.example syncing and onboarding that even future-you will thank you for.

  • Git Pre-commit Hook – Blocks secret leaks faster than you can say git push --force.

  • Configuration as Code – Your environment config is version-controlled and documented like real code.

(Translation: EnvShield is that overprotective friend who checks the door lock five times so you can sleep.)

Installation

Requires Python 3.10+.

pip install envshield
envshield --help

Done. Your project is now 72 % less combustible.

The EnvShield Philosophy: Schema-First Configuration

EnvShield's power comes from a simple idea: your configuration should be treated like code. It introduces a single source of truth, the env.schema.toml file.

This file is a "configuration contract" that explicitly defines every environment variable your project needs. By defining your variables here, you get:

  • Automated Documentation: Your .env.example is always perfectly in sync with your schema.
  • Ironclad Validation: Catch typos and missing variables before you even run your app.
  • Proactive Security: A built-in scanner and Git hook prevent secrets from ever being committed.

CLI Commands

Command Purpose Demo
envshield init Auto-detects framework, creates env.schema.toml, installs the Git hook. Demo of EnvShield init
envshield scan Scans files or staged commits for secrets. Demo of EnvShield scan
envshield install-hook Manually install or update the Git pre-commit hook. For when you skipped step one because YOLO.
envshield check <file> Validates a local .env file against the schema. Demo of EnvShield check
envshield schema sync Regenerates .env.example from the schema. Demo of EnvShield sync
envshield setup Interactive onboarding to create a local env. Demo of EnvShield setup
envshield doctor Runs a full health check (and can auto-fix). Demo of EnvShield check
envshield import <file> Intelligently converts an existing .env file into a new env.schema.toml. The fastest way to adopt EnvShield for an existing project.

Competitor Comparison: Choosing the Right Tool

A scanner is a smoke detector. A cloud vault is an off-site bank. EnvShield is the fireproof, self-organizing house you should have been living in all along. It provides the complete local workflow that developers need to prevent secret leaks in the first place.

Developer Pain Point EnvShield 🛡️ TruffleHog / Gitleaks Doppler / Infisical direnv
Preventing Secret Commits Built-in. init sets up an automated pre-commit hook. Core feature. Specialized tools for just finding secrets. Indirectly. Doesn't actively scan commits. Not addressed.
Migrating Existing Projects ✅ One-command import. import command auto-generates a schema from an existing .env file. ❌ Not addressed. ❌ Not addressed. (They manage, but don't import your old files) ❌ Not addressed.
Streamlining Developer Onboarding Automated. The setup command interactively creates a local .env file from the project's template. Not addressed. Strong. Provides a central place to get secrets, but doesn't manage local files. Not addressed.
Preventing Configuration Drift Solved. The schema is the source of truth. schema sync and check enforce consistency. Not addressed. Solved. The cloud is the single source of truth. Not addressed.
Primary Focus Complete Local Workflow. Manages files, documents schemas, validates setups, and scans for leaks. Secret Detection Engine. Cloud-Based Secret Vault. Shell Environment Automation.

Think of scanners as smoke detectors and cloud vaults as off-site banks. EnvShield is the fire-proof, self-organizing house you should have been living in all along.

The Brains of the Operation: The Core Files

envshield is managed by two simple files you commit to your repository.

  • env.schema.toml: The source of truth. This is where you define every variable your project needs.
    # env.schema.toml

    [DATABASE_URL]
    description = "The full connection string for the PostgreSQL database."
    secret = true # Marks this as sensitive

    [LOG_LEVEL]
    description = "Controls the application's log verbosity."
    secret = false
    defaultValue = "info" # Provides a fallback
  • envshield.yml: The workflow config. In Phase 1, it's very simple and mainly points to your schema and defines scanner exclusions.

Future Roadmap: Teams & Enterprise✨

Phase 1 is the free, powerful "Local Guardian." But the journey doesn't end there. Upcoming paid tiers will turn envshield into a complete collaboration and automation platform.

Phase 2: The Team Collaborator (Paid Tier)

  • envshield use <profile>: Instantly switch your entire project's configuration between different environments (e.g., local, staging).

  • envshield onboard <profile>: A supercharged setup that can also run scripts like docker compose up and database migrations for a true one-command setup.

  • envshield share: Securely share a secret with a teammate via an encrypted, one-time-use link.

  • envshield docs: Generate beautiful Markdown or HTML documentation from your schema.

Phase 3: The Enterprise-Grade System (Paid Tier)

  • envshield login, pull, push: Full integration with a centralized, cloud-based secret vault.

  • envshield export: Securely inject secrets into your CI/CD pipelines for automated deployments.

  • Audit Logs & RBAC: A complete, compliant, and auditable history of all secret access and team permissions, managed through a web dashboard.

Community & Support

Got questions? Have a brilliant idea? Come hang out with us!

  • 🤔 Ask a question on GitHub Discussions:Discussions

Or, Follow us on our socials:

🌍 Community & Links

Contributing (Don't Be Shy)

Spotted a bug? Think our jokes are terrible? We want to hear it all. Check out CONTRIBUTING.md to get started.

TL;DR

EnvShield = environment variable management + secret scanning + configuration as code + just enough sarcasm to keep you awake. Stop leaking secrets. Start shipping securely.

Project details


Download files

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

Source Distribution

envshield-3.0.0.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

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

envshield-3.0.0-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

Details for the file envshield-3.0.0.tar.gz.

File metadata

  • Download URL: envshield-3.0.0.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for envshield-3.0.0.tar.gz
Algorithm Hash digest
SHA256 d915522a19f163c5c7bc4393b48a8f23179bcdee010e9f8aa68164baf389fb1c
MD5 3532ddb13e7ed64a484daf3b1edc939e
BLAKE2b-256 2f1bd966ba3ad87dade8ca52021ef799b0a96fb50e02d741819840a2511799a2

See more details on using hashes here.

File details

Details for the file envshield-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: envshield-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for envshield-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09cd50027aac03f113be55fe458a5b89a3717eef1bd928bae282df99e961fa30
MD5 7510fe2bea4198d45f2624a2bfa01d1b
BLAKE2b-256 5345c1522b37f526527f3e2a070bee721f0193e7ad8413b8aad4abe59814144e

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