env-sweeper
v1.0.1
Published
<div align="center">
Readme
🛡️ Env Sweeper
Hunt down exposed
.envfiles and API keys before they get committed and ruin your life.
███████╗███╗ ██╗██╗ ██╗ ███████╗██╗ ██╗███████╗███████╗██████╗ ███████╗██████╗
██╔════╝████╗ ██║██║ ██║ ██╔════╝██║ ██║██╔════╝██╔════╝██╔══██╗██╔════╝██╔══██╗
█████╗ ██╔██╗ ██║██║ ██║ ███████╗██║ █╗ ██║█████╗ █████╗ ██████╔╝█████╗ ██████╔╝
██╔══╝ ██║╚██╗██║╚██╗ ██╔╝ ╚════██║██║███╗██║██╔══╝ ██╔══╝ ██╔═══╝ ██╔══╝ ██╔══██╗
███████╗██║ ╚████║ ╚████╔╝ ███████║╚███╔███╔╝███████╗███████╗██║ ███████╗██║ ██║
╚══════╝╚═╝ ╚═══╝ ╚═══╝ ╚══════╝ ╚══╝╚══╝ ╚══════╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═╝Did you know thousands of AWS keys, Stripe tokens, and OpenAI keys are leaked on GitHub every single day because developers forget to add .env to their .gitignore?
Env Sweeper is a blazing-fast, interactive CLI security scanner that recursively sweeps your local directories for unprotected .env files and exposed API keys, allowing you to instantly preview, delete, or safely .gitignore them.
✨ Features
- ⚡ Lightning Fast: Uses
fast-globto rip through massive codebases in milliseconds while aggressively ignoringnode_modules. - 👀 Smart Preview: Safely peeks inside discovered
.envfiles and automatically masks sensitive keys so you can verify them securely. - 🛡️ Instant Remediation: Automatically injects the
.envpath into the correct local.gitignorefile with a single keystroke. - 🗑️ Secure Shredding: Permanently deletes dangerous files if you choose to obliterate them.
- 🎯 Interactive UX: Powered by
inquirerfor a bulletproof, non-glitchy terminal experience.
🚀 Installation
You can run it instantly without installing:
npx env-sweeperOr install it globally to sweep any folder at any time:
npm install -g env-sweeper🎮 Usage
Navigate to any directory you want to scan and run:
env-sweeperFlow:
- Sweeper will scan the directory and list all unprotected
.envfiles. - Select the files you want to handle (Space to select, Enter to proceed).
- Choose an action:
- Preview masked secrets (to see what keys are inside).
- Shred them (delete permanently).
- Add to .gitignore (secures them without deleting).
🛠️ How it works
- It recursively globs
**/.env*while bypassing massive folders likenode_modulesand.git. - It parses
.gitignorefiles to ensure it doesn't bother you with.envfiles that are already safely ignored. - It presents a beautiful terminal UI for you to take immediate action on vulnerabilities.
Architected by @lakshanmuruganandam
Built for developers who prefer not to wake up to a $50,000 AWS bill.
