npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kushal124/env-manager

v1.0.0

Published

A simple environment variable manager with CLI and web interface

Readme

Environment Variable Manager 🔧

npm version License: MIT Node.js CI

A powerful, secure, and user-friendly environment variable manager with CLI and web interface. Perfect for developers juggling multiple projects, API keys, and configuration environments.

✨ Features

🔐 Security First

  • Encryption Support: Encrypt sensitive variables with individual passwords or master password
  • Smart Masking: Automatically masks sensitive values (API keys, tokens, passwords)
  • Secure Storage: Variables stored locally with optional encryption
  • Password Validation: Strong password requirements for encrypted variables

📁 Profile Management

  • Multiple Profiles: Organize variables by project, environment, or client
  • Easy Switching: Quick profile switching with context awareness
  • Session Tracking: Load/unload variables in current shell session
  • Profile Metadata: Add descriptions and track creation dates

🔄 Import/Export System

  • Multiple Formats: JSON, dotenv, shell exports, key-value pairs, YAML
  • Auto-Detection: Smart format detection for seamless imports
  • Bulk Operations: Import hundreds of variables at once
  • Merge Support: Combine with existing variables or replace entirely

Advanced Features

  • Variable Expiration: Set TTL for temporary tokens and credentials
  • Cleanup Tools: Automatically remove expired variables
  • Shell Integration: Native support for bash, zsh, and fish
  • Web Interface: Modern, responsive web UI for visual management
  • Session Management: Track loaded variables across shell sessions

🌐 Multi-Interface

  • CLI: Full-featured command-line interface
  • Web UI: Clean, intuitive web interface at http://localhost:3000
  • REST API: Complete API for integration with other tools

🚀 Quick Start

Installation

Option 1: NPM (Recommended)

npm install -g @kushal124/env-manager

Option 2: Quick Install Script

curl -fsSL https://raw.githubusercontent.com/kushal124/envman/main/install.sh | bash

Option 3: Manual Installation

git clone https://github.com/kushal124/envman.git
cd env-manager
npm install && npm install -g .

First Run Setup

envman setup

The setup wizard will guide you through:

  1. Choosing storage location (~/.env-manager/ recommended)
  2. Setting up your first profile
  3. Optional master password configuration

📖 Usage Guide

Basic Operations

# Add variables to current profile
envman add OPENAI_API_KEY "sk-..." --encrypt
envman add DATABASE_URL "postgresql://localhost:5432/db"

# List all variables with smart masking
envman list

# Get a specific variable
envman get OPENAI_API_KEY --decrypt

# Remove variables
envman remove DATABASE_URL

Profile Management

# Create profiles for different projects
envman profile create azure -d "Azure development environment"
envman profile create openai -d "OpenAI/ChatGPT projects"

# Switch between profiles
envman profile switch azure

# List all profiles with active indicator
envman profile list
● azure - Azure development environment  
○ openai - OpenAI/ChatGPT projects
○ default - Default profile

# View current profile status
envman profile current

Advanced Variable Management

# Add encrypted variables with individual passwords
envman add STRIPE_SECRET_KEY "sk_test_..." --encrypt

# Add variables with expiration
envman add TEMP_TOKEN "temp_value" --expires 2h

# List variables showing encryption and expiration status
envman list
🔐 STRIPE_SECRET_KEY=[ENCRYPTED]
⏰ TEMP_TOKEN=temp_value (expires in 118m)

Master Password System

# Set up master password for bulk encryption
envman master set

# Encrypt all current profile variables with master password
envman master encrypt-all

# Decrypt all master-encrypted variables
envman master decrypt-all

# Change master password (re-encrypts all variables)
envman master change

Import/Export System

# Import from various formats (auto-detected)
echo 'export API_KEY="value"' | envman import
cat .env | envman import -f dotenv
curl -s https://api.example.com/config.json | envman import -f json

# Import to specific profile with merge
envman import -p production -m < production.env

# Preview imports without saving
echo '{"api": {"key": "value"}}' | envman import --dry-run

# Export for shell loading
eval "$(envman export)"
eval "$(envman export -p azure -s fish)"

Session Management

# Load profile variables into current session
envman load azure

# Check what's currently loaded
envman status
Active profile: azure
Session ID: sess_abc123
Loaded profiles: azure, openai
Loaded variables (5):
  AZURE_CLIENT_ID (from azure)
  AZURE_CLIENT_SECRET (from azure)
  OPENAI_API_KEY (from openai)

# Unload specific profile or all variables
envman unload azure
envman unload

Web Interface

# Start web interface
envman web

# Custom port
envman web -p 8080

Features in Web UI:

  • 📊 Dashboard: Overview of all profiles and variables
  • 🔧 Variable Management: Add, edit, delete with real-time validation
  • 📁 Profile Management: Create, switch, delete profiles
  • 📥 Import Interface: Drag-and-drop or paste variables
  • 🔐 Encryption Controls: Encrypt/decrypt individual variables
  • 📤 Export Tools: Generate shell commands for any profile

🎯 Real-World Examples

Development Workflow Setup

Multi-Cloud Development

# AWS Profile
envman profile create aws -d "AWS development resources"
envman profile switch aws
envman add AWS_ACCESS_KEY_ID "AKIA..."
envman add AWS_SECRET_ACCESS_KEY "..." --encrypt
envman add AWS_DEFAULT_REGION "us-west-2"

# Azure Profile  
envman profile create azure -d "Azure development resources"
envman profile switch azure
envman add AZURE_CLIENT_ID "..."
envman add AZURE_CLIENT_SECRET "..." --encrypt
envman add AZURE_TENANT_ID "..."

# Quick switching between clouds
alias awsenv="envman profile switch aws && eval \"\$(envman export)\""
alias azureenv="envman profile switch azure && eval \"\$(envman export)\""

API Integration Projects

# OpenAI Project
envman profile create openai-project
envman add OPENAI_API_KEY "sk-..." --encrypt
envman add OPENAI_ORG_ID "org-..."
envman add MODEL_NAME "gpt-4"

# Stripe Integration
envman profile create stripe-integration  
envman add STRIPE_PUBLIC_KEY "pk_test_..."
envman add STRIPE_SECRET_KEY "sk_test_..." --encrypt
envman add STRIPE_WEBHOOK_SECRET "whsec_..." --encrypt

Environment-Specific Configurations

# Development Environment
envman profile create development
envman add NODE_ENV "development"
envman add DEBUG "true"
envman add LOG_LEVEL "debug"

# Staging Environment
envman profile create staging
envman add NODE_ENV "staging" 
envman add API_BASE_URL "https://api-staging.example.com"
envman add RATE_LIMIT "1000"

# Production Environment (with expiring tokens)
envman profile create production
envman add NODE_ENV "production"
envman add DEPLOY_TOKEN "temp_token" --expires 1h --encrypt

Team Collaboration

Sharing Configuration Templates

# Export configuration template (values masked)
envman export > project-template.sh

# Team member imports and customizes
envman import < project-template.sh
envman add PERSONAL_API_KEY "their-key" --encrypt

Environment Synchronization

# Export non-sensitive configuration
envman export --skip-encrypted > shared-config.sh

# Import shared config and add personal secrets
source shared-config.sh
envman add PERSONAL_DB_PASSWORD "secret" --encrypt

🛠️ Shell Integration

Bash/Zsh Setup

Add to your .bashrc or .zshrc:

# Environment Manager Aliases
alias envload="eval \"\$(envman export)\""
alias envstatus="envman status"

# Project-specific aliases
alias devenv="envman profile switch development && envload"
alias prodenv="envman profile switch production && envload"
alias stageenv="envman profile switch staging && envload"

# Quick profile switching function
switchenv() {
    envman profile switch "$1" && envload
    echo "Switched to $1 environment"
}

Fish Shell Setup

Add to your ~/.config/fish/config.fish:

# Environment Manager Functions
function envload
    eval (envman export -s fish)
end

function switchenv
    envman profile switch $argv[1]
    envload
    echo "Switched to $argv[1] environment"
end

# Aliases
alias envstatus="envman status"
alias devenv="switchenv development"
alias prodenv="switchenv production"

🏗️ File Structure

~/.env-manager/
├── profiles/                 # Profile-specific variable storage
│   ├── default.json         # Default profile variables  
│   ├── aws.json            # AWS profile variables
│   ├── azure.json          # Azure profile variables
│   └── openai.json         # OpenAI profile variables
├── profile-meta.json        # Profile metadata and descriptions
├── session.json            # Current session state and loaded variables
├── master-password.json    # Master password hash and metadata
└── settings.json          # Global settings and configuration

🔐 Security Features

Encryption Options

  • Individual Encryption: Each variable can have its own password
  • Master Password: Bulk encrypt/decrypt entire profiles
  • Smart Masking: Automatically masks sensitive variables in output
  • Secure Storage: All encrypted data uses AES-256-GCM encryption

Security Best Practices

  • Variables stored locally (never transmitted)
  • Strong password validation for encrypted variables
  • Automatic masking of API keys, tokens, and passwords
  • Optional master password for additional security layer
  • Secure key derivation using PBKDF2 with 100,000 iterations

📡 API Reference

The web interface exposes a REST API for integration:

Variables API

  • GET /api/variables - List all variables
  • POST /api/variables - Create variable
  • PUT /api/variables/:key - Update variable
  • DELETE /api/variables/:key - Delete variable
  • POST /api/variables/:key/encrypt - Encrypt variable
  • POST /api/variables/:key/decrypt - Decrypt variable

Profiles API

  • GET /api/profiles - List profiles
  • POST /api/profiles - Create profile
  • POST /api/profiles/:name/switch - Switch profile
  • DELETE /api/profiles/:name - Delete profile

Master Password API

  • GET /api/master/status - Check master password status
  • POST /api/master/set - Set master password
  • POST /api/master/change - Change master password
  • POST /api/master/encrypt-all - Bulk encrypt with master password

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

git clone https://github.com/kushal124/envman.git
cd env-manager
npm install
npm run dev

Running Tests

npm test
npm run test:coverage

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙋‍♂️ Support

🎉 Acknowledgments

  • Built with ♥️ by Kushal Khandelwal
  • Inspired by the need for better developer environment management
  • Thanks to all contributors and users for feedback and improvements

Made with ❤️ for developers who manage multiple environments and API keys

Star ⭐ this repository if you find it helpful!