Socket
Book a DemoInstallSign in
Socket

@lucasmarkes/envfy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lucasmarkes/envfy

Simple CLI tool to manage .env environments easily

1.0.0
latest
npmnpm
Version published
Weekly downloads
66
Maintainers
1
Weekly downloads
 
Created
Source

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.example automatically 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 envfy

Or clone and link locally for development:

git clone https://github.com/yourusername/envfy.git
cd envfy
npm install
npm run build
npm link

Usage 🚀

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.example as 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.example

List available environments

envfy list

Example output:

Available environments:
  - local
  - dev
  - stage
  - prod

Switch environment

envfy switch dev
  • Copies .env.dev to .env in 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 local if --env is not provided

Show active environment

envfy status

Example output:

🌱 Active environment (.env):
API_URL=https://api.dev
DB_USER=root
DB_PASS=secret

Help command

envfy help

Shows 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 dev

Project 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 📄

MIT License. See License: MIT for details.

Stay Connected 🔗

Follow updates, share feedback, and connect on Twitter: @lucasmarkes__

Keywords

cli

FAQs

Package last updated on 03 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.