@lucasmarkes/envfy
v1.0.2
Published
Simple CLI tool to manage .env environments easily
Maintainers
Readme
Envfy 🚀
Envfy is a simple and developer-friendly CLI tool to manage multiple .env environments for your projects.
It helps developers quickly create, switch, and manage environment files (.env.local, .env.dev, .env.stage, .env.prod) and also generates a .env.example file for sharing with your team.
Built with developer experience (DX) in mind. Keep your workflow simple, consistent, and hassle-free.
Features ✨
- Interactive creation of
.env.*files - Optional environment variable creation
.env.exampleautomatically generated- Switch between environments easily
- Set or update variables in specific environment files
- Check which environment is currently active
- Custom help command for quick reference
Installation 💻
You can install Envfy globally via npm:
npm install -g @lucasmarkes/envfyOr clone and link locally for development:
git clone https://github.com/lucasmarkes/envfy.git
cd envfy
npm install
npm run build
npm linkUsage 🚀
After installation, you can use envfy globally in your terminal.
Initialize environments
envfy init- Interactive prompt asks if you want to create environment variables
- Generates
.env.local,.env.dev,.env.stage,.env.prod - Generates
.env.exampleas a template - All variable values are empty by default
Example interaction:
Do you want to create environment variables now? (y/N) y
How many environment variables do you want to create? 3
Enter name for variable #1: API_URL
Enter name for variable #2: DB_USER
Enter name for variable #3: DB_PASS
✅ Created: .env.local
✅ Created: .env.dev
✅ Created: .env.stage
✅ Created: .env.prod
✅ Created: .env.exampleList available environments:
envfy listExample output:
Available environments:
- local
- dev
- stage
- prodSwitch environment
envfy switch dev- Copies
.env.devto.envin your project root - Makes switching between environments fast and safe
Set or update variables
envfy set API_URL https://api.dev --env dev- Sets or updates a variable in a specific
.env.*file - Default target environment is
localif--envis not provided
Show active environment
envfy statusExample output:
🌱 Active environment (.env):
API_URL=https://api.dev
DB_USER=root
DB_PASS=secretHelp command
envfy helpShows all commands, descriptions, and examples:
Envfy - CLI to manage multiple .env environments
Commands:
init Create .env files (optional variables)
list List available environments
switch <env> Switch to the specified environment
set <key> <value> Set or update a variable in a specific .env file
status Show which environment is currently active
help Show this help message
Examples:
envfy init
envfy set API_URL https://api.dev --env dev
envfy switch devProject Philosophy 💡
Envfy is built with developer experience in mind:
- Minimal setup and fast execution
- Optional interactive creation of environment variables
- Encourages best practices with
.env.example - Helps teams and open source projects manage environments safely
Contributing 🤝
Contributions are welcome! Feel free to:
- Submit bug reports
- Suggest new features
- Open pull requests
License 📄
Stay Connected 🔗
Follow updates, share feedback, and connect on Twitter: @lucasmarkes__
