envsetter
v1.0.0
Published
Interactive CLI to scan your codebase for environment variables and set their values — no more manually writing KEY=VALUE.
Downloads
102
Maintainers
Readme
⚡ EnvSetter
Stop manually writing
KEY=VALUE. Scan your codebase, paste values, done.
EnvSetter scans your entire codebase for environment variable references (process.env.X,
import.meta.env.X, .env.example files, etc.), shows you which ones are
missing, and gives you a clean interactive interface to fill them in.
Install
npm install -g envsetterUsage
cd your-project
envsetterThat's it. It will:
- 🔍 Scan your codebase for every env variable reference
- 📂 Discover all folders with
.envfiles (monorepo support) - 📋 Show which are already set and which are missing
- ✏️ Prompt you with a clean interactive interface
- 💾 Save everything to your
.envfile with proper formatting - 🔄 Sync keys to
.env.exampleautomatically
Features
🎯 Smart Scanning
- Deep scanning across 20+ file types and all major languages
- Detects patterns like
process.env.VAR,os.environ,env('VAR')and more - Reads
.env.examplefiles to find expected variables
📂 Multi-Folder Support
- Automatically discovers all folders containing
.envfiles - Navigate between folders in monorepos and multi-service projects
- Process individual folders or edit all at once
⬆ Bulk Paste
- Paste your entire
.envcontent in one go - Automatically parses
KEY=VALUEpairs, handles quotes, comments, messy formatting - Preview what was parsed before confirming
🔐 Security Aware
- Masks sensitive values (passwords, tokens, API keys) in the UI
- Warns if
.envis not in.gitignore - Auto-detects secret keys by pattern
✨ Smart Hints
- Categorizes variables (Database, AWS, Auth, Email, etc.)
- Shows type hints (URL, Secret, Number, Flag)
- Displays where each variable is used in your code
📝 Auto-Sync .env.example
- Automatically syncs new keys to
.env.example(without values) - Creates
.env.exampleif it doesn't exist - Team-friendly — everyone knows what keys are needed
🎨 Beautiful UI
- Progress bars, category grouping, colored output
- Interactive prompts with commands:
skip,back,clear,list,exit,skipall - Clean boxed layouts and visual hierarchy
What It Detects
| Pattern | Language/Framework |
| ----------------------- | ------------------ |
| process.env.VAR | Node.js |
| process.env['VAR'] | Node.js |
| import.meta.env.VAR | Vite |
| NEXT_PUBLIC_* | Next.js |
| REACT_APP_* | Create React App |
| VITE_* | Vite |
| NUXT_* | Nuxt |
| EXPO_PUBLIC_* | Expo |
| os.environ.get('VAR') | Python |
| ENV["VAR"] | Ruby |
| env('VAR') | Laravel |
| System.getenv("VAR") | Java |
| os.Getenv("VAR") | Go |
| std::env::var("VAR") | Rust |
| ${VAR} | Docker/YAML |
| .env.example entries | Any |
Modes
Fill Missing
Only prompts for variables that don't have a value yet.
Edit All
Re-prompts for every variable, letting you update existing values.
Bulk Paste
Paste a whole .env file content at once — perfect for migrating from Vercel, Railway, or another project.
Commands (during prompts)
| Command | Action |
| --------- | ------------------------------- |
| skip | Skip this variable |
| back | Go to the previous variable |
| clear | Set value to empty string |
| list | Show all variables and status |
| skipall | Skip all remaining variables |
| exit | End session (with confirmation) |
| ? | Show help panel |
How It Works
╭─────────────────────────────────────────────────────╮
│ │
│ _____ _ ___ __ │
│ | ____| \ | \ \ / / │
│ | _| | \| |\ \ / / │
│ | |___| |\ | \ V / │
│ |_____|_| \_| \_/ │
│ │
│ --- S E T T E R --- │
│ │
│ Scan > Fill > Save | Interactive .env manager │
│ v1.0.0 │
│ │
╰─────────────────────────────────────────────────────╯
◆ ✔ Found env files in 3 folders
>> Project Folders ───────────────────────────
? Select folder
> ./ (root) 3 env files
backend/ 1 env file
frontend/ 2 env files
Edit all folders
◆ Working in: backend
╭────────────────────────────────────────────────╮
│ ◆ Scan Results │
│ ● Variables found 8 │
│ ● Already set 3 │
│ ● Missing 5 │
│ Coverage ████████░░░░░░░░░░░░ 38% │
╰────────────────────────────────────────────────╯
? Select mode
> ▸ Fill missing only 5
✎ Edit all variables 8
⬆ Bulk paste (paste whole .env content)
✖ Exit
╭──────────────────────────────────────────────╮
│ ◆ DATABASE_URL [1/5] 0% │
│ ████░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
│ URL Database connection string │
│ ● Not set │
╰──────────────────────────────────────────────╯
▸ Value: postgresql://user:pass@localhost:5432/db
╭──────────────────────────────────────────────────╮
│ ✔ Complete │
│ Saved 5 variables │
│ Target .env │
╰──────────────────────────────────────────────────╯License
MIT © Zain Afzal
