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

anho-env-helper

v1.1.3

Published

A CLI tool to manage and visualize environment variables across projects

Readme

anho-env-helper

A powerful CLI tool to manage and visualize environment variables across your projects. Perfect for developers working with multiple .env files in monorepos or complex project structures.

🚀 Features

  • 🔍 Smart Discovery: Automatically finds all .env files in your project
  • 📊 Beautiful Display: Clean, colored output showing all environment variables
  • 🔄 Sync Checking: Compares .env vs .env.example files to find missing variables
  • 🔧 Auto-Fix Sync Issues: Automatically add missing variables to .env files
  • 📝 Template Generation: Create .env.example files from existing .env files
  • 📋 Variable Listing: List all environment variables across all files
  • 📦 Secure Export: Export env files to secure archives outside your project
  • 🔒 Security Warnings: Identifies potential security issues with sensitive variables
  • 🏗️ Context Aware: Understands frontend/backend/mobile project structures
  • ⚡ Fast & Lightweight: Built with TypeScript and tested with Jest

📦 Installation

Install globally via npm:

npm install -g anho-env-helper

Or use directly with npx:

npx anho-env-helper

🎯 Usage

Show Available Commands

Run env-helper without arguments to see all available commands:

env-helper

Basic Scan

Scan the current directory and show all environment files:

env-helper scan

Verbose Output

Show detailed information including all variables:

env-helper scan --verbose
env-helper scan -v

Scan Specific Directory

env-helper scan --path /path/to/your/project
env-helper scan -p ./my-project

Check Sync Status

Find missing variables between .env and .env.example files:

env-helper sync
env-helper sync --path ./backend
env-helper sync --fix  # Automatically add missing variables

Security Scan

Check for potential security issues:

env-helper security
env-helper security -p ./my-project

Create Template Files

Generate .env.example files from existing .env files:

env-helper template
env-helper template --overwrite  # Replace existing .env.example files
env-helper template -p ./my-project

List Environment Variables

List all environment variables found across all env files:

env-helper list
env-helper list --unique           # Show only unique variable names
env-helper list --values           # Show variable values (sensitive masked)
env-helper list --unique --values  # Combined options

Export Environment Files

Securely export all env files to an archive outside your project:

env-helper export                  # Interactive prompt for output path
env-helper export -o ~/Desktop     # Export to specific directory
env-helper export --format zip     # Export as ZIP instead of tar.gz
env-helper export -p ./my-project -o ~/backups  # Export specific project

Disable Colors

env-helper scan --no-colors

📋 Example Output

Basic Scan

Environment Variables Analysis

Root:
  .env - 8 vars (4 sensitive)
  .env.example - 8 vars (4 sensitive)

Security Warnings:

.env:
  [HIGH] DATABASE_PASSWORD: Sensitive variable contains a value and file is not in .gitignore - this could be committed to version control
  [HIGH] JWT_SECRET: Sensitive variable contains a value and file is not in .gitignore - this could be committed to version control
  [HIGH] API_KEY: Sensitive variable contains a value and file is not in .gitignore - this could be committed to version control

Summary:
2 files, 16 variables
3 issue(s) found

Verbose Mode

Environment Variables Analysis

Root:
  .env - 8 vars (4 sensitive)
    NODE_ENV=production
    PORT=3000
    [SENSITIVE] DATABASE_PASSWORD=••••••••
    DATABASE_HOST=localhost
    [SENSITIVE] JWT_SECRET=••••••••
    [SENSITIVE] API_KEY=••••••••
    REDIS_URL=redis://localhost:6379
    [SENSITIVE] STRIPE_SECRET=••••••••
  .env.example - 8 vars (4 sensitive)
    NODE_ENV=development
    PORT=3000
    DATABASE_HOST=your_host_here
    REDIS_URL=your_url_here
    [SENSITIVE] DATABASE_PASSWORD=••••••••
    [SENSITIVE] JWT_SECRET=••••••••
    [SENSITIVE] API_KEY=••••••••
    [SENSITIVE] STRIPE_SECRET=••••••••

Sync Check

Sync Issues:

Missing Variables:
  API_KEY (required by .env.example, missing from: .env)
  DATABASE_URL (required by .env.example, missing from: .env)

Extra Variables:
  OLD_CONFIG (in .env, not in .env.example)

Sync Fix

Sync Fix: Adding missing variables...

✅ Added 2 variables to .env

🎉 Successfully added 2 missing variables!
Remember to fill in the actual values for these variables.

Template Creation

Creating .env.example template files...

✅ Created .env.example
✅ Created client/.env.example
✅ Created server/.env.example

🎉 Successfully created 3 template file(s)!

Generated Template File

# Environment Variables Template
# Generated from .env
# Fill in the actual values for your environment

# Configuration Variables
NODE_ENV=development
PORT=3000
DISCORD_CHANNEL_ID=your_id_here
REDDIT_USERNAME=your_username_here

# Sensitive Variables (keep these secret!)
API_KEY=your_key_here
DATABASE_PASSWORD=your_password_here
JWT_SECRET=your_secret_here
REDIS_URL=your_url_here

List Variables (Unique)

Environment Variables List

Found 8 unique environment variables:

Configuration Variables:
  DATABASE_HOST (in 2 files)
  NODE_ENV (in 2 files)
  PORT (in 2 files)
  REDIS_URL (in 2 files)

Sensitive Variables:
  API_KEY (in 2 files)
  DATABASE_PASSWORD (in 2 files)
  JWT_SECRET (in 2 files)
  STRIPE_SECRET (in 2 files)

Export Files

🔒 For security, env files should be exported outside your project directory.

Export directory [/Users/user/Desktop]: 

Exporting environment files...

✅ Exported 2 environment files
📦 Archive created: /Users/user/Desktop/my-project-env-files-2025-09-29T10-04-30.tar.gz
📏 Archive size: 2.1 KB

Files exported:
  .env (4 sensitive)
  .env.example (4 sensitive)

🔒 Keep this archive secure - it contains sensitive environment data!

🏗️ Supported File Types

The tool automatically detects these environment file patterns:

  • .env - Main environment file
  • .env.local - Local overrides
  • .env.development - Development environment
  • .env.production - Production environment
  • .env.example - Template file
  • .env.template - Template file
  • .environment.* - Alternative naming

🎯 Context Detection

Automatically detects project contexts based on directory structure:

  • Frontend: client/, frontend/, web/, app/, ui/
  • Backend: server/, backend/, api/, service/
  • Mobile: mobile/, android/, ios/, react-native/
  • Shared: shared/, common/, lib/, packages/

🔒 Security Features

  • Identifies sensitive variables (passwords, keys, tokens, secrets)
  • Masks sensitive values in output
  • Warns about potential security issues
  • Detects secrets in unexpected places

🧪 Development

Built with Test-Driven Development (TDD) using:

  • TypeScript for type safety
  • Jest for comprehensive testing
  • Commander.js for CLI interface
  • Chalk for beautiful terminal output

Running Tests

npm test
npm run test:watch
npm run test:coverage

Building

npm run build

📜 License

MIT License - see LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

🐛 Issues

Found a bug or have a feature request? Please create an issue on GitHub.


Made with ❤️ by Andreas Hoj