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

dotenvx-interactive-cli

v1.3.3

Published

An interactive CLI tool for managing .env files with dotenvx - encrypt, decrypt, and manage environment variables with ease.

Downloads

655

Readme

[!NOTE] Dotenvx team made vscode plugin to do the same thing -> https://marketplace.visualstudio.com/items?itemName=dotenv.dotenvx-vscode&ssr=false#overview

dotenvx-interactive-cli

A powerful CLI tool for managing your .env files with dotenvx. Built with @effect/cli, this tool provides both command-line and interactive interfaces for encrypting and decrypting environment files, as well as setting up precommit hooks.

Why?

This tool was created to simplify the process of working with dotenvx encryption and decryption. Whether you prefer command-line efficiency or interactive guidance, you can quickly:

  • Encrypt or decrypt .env files via direct commands or interactive menus
  • Work with all files at once or target specific .env files
  • Avoid typing lengthy dotenvx commands manually
  • Set up precommit hooks with a single command
  • Integrate seamlessly into CI/CD pipelines and scripts

Prerequisites

  • Node.js (v22 or higher)
  • dotenvx must be installed globally (npm install -g @dotenvx/dotenvx)

Installation

You can install this package globally:

npm install -g dotenvx-interactive-cli

Or use it directly with npx:

npx dotenvx-interactive-cli

Features

  • 🔒 Encrypt .env files - Command-line or interactive file selection
  • 🔓 Decrypt .env files - Batch or targeted decryption
  • 🪝 Precommit hook installation - One-command setup
  • Built on @effect/cli - Modern, type-safe CLI framework
  • 🎯 Hybrid interface - Direct commands, interactive selection, wizard, or help-guided
  • 🗂️ Interactive file selection - Beautiful checkbox interface when no files specified
  • 🔍 Smart file detection - Automatically finds .env files (excludes .keys and .vault)
  • Professional CLI features - Help, version, completions, and more
  • 🛡️ Robust error handling - Clear error messages and graceful failures

Usage

Command Line Interface

Navigate to your project directory and use any of these commands:

Quick Actions

# Encrypt all .env files
dotenvx-interactive-cli encrypt

# Decrypt all .env files  
dotenvx-interactive-cli decrypt

# Install precommit hook
dotenvx-interactive-cli precommit

Target Specific Files

# Encrypt specific files
dotenvx-interactive-cli encrypt .env .env.production

# Decrypt specific files
dotenvx-interactive-cli decrypt .env.development

Interactive File Selection

# Run without file arguments to get an interactive selection menu
dotenvx-interactive-cli encrypt    # Shows checkbox menu to select files
dotenvx-interactive-cli decrypt    # Interactive selection for decryption

# The interactive menu allows you to:
# - Select individual files with spacebar
# - Choose "All files" option to select everything
# - Navigate with arrow keys
# - Confirm with Enter
# - Cancel with Ctrl+C

Get Help and Information

# Show main help
dotenvx-interactive-cli --help

# Show command-specific help
dotenvx-interactive-cli encrypt --help

# Show version
dotenvx-interactive-cli --version

Interactive Mode

# Launch wizard mode for guided command building
dotenvx-interactive-cli --wizard

# Run without arguments to see available commands
dotenvx-interactive-cli

Shell Completions

# Generate completions for your shell
dotenvx-interactive-cli --completions bash   # for bash
dotenvx-interactive-cli --completions zsh    # for zsh
dotenvx-interactive-cli --completions fish   # for fish

# Install completions (example for bash)
source <(dotenvx-interactive-cli --completions bash)

NPX Usage

All commands work with npx as well:

npx dotenvx-interactive-cli encrypt .env
npx dotenvx-interactive-cli --wizard
npx dotenvx-interactive-cli --help

Requirements

  • A .env.keys file must be present in your project directory
  • dotenvx must be installed globally

Examples

Basic Workflow

# 1. Interactive encryption with file selection
dotenvx-interactive-cli encrypt
# ✨ Shows a checkbox menu to select which .env files to encrypt

# 2. Set up precommit hook to auto-encrypt on commits
dotenvx-interactive-cli precommit

# 3. Later, interactive decryption for development
dotenvx-interactive-cli decrypt
# ✨ Interactive menu to choose which files to decrypt

Quick Commands (No Interaction)

# Direct file specification (no prompts)
dotenvx-interactive-cli encrypt .env .env.production
dotenvx-interactive-cli decrypt .env.development

CI/CD Integration

# In your CI/CD pipeline
npx dotenvx-interactive-cli decrypt .env.production

Development Workflow

# Start with wizard mode if unsure
dotenvx-interactive-cli --wizard

# Or get help for specific commands
dotenvx-interactive-cli encrypt --help

Migration from v0.3.x

If you're upgrading from the previous interactive-only version:

  • Old: dotenvx-interactive-cli (interactive menu only)
  • New: dotenvx-interactive-cli [command] (direct commands with fallback to guidance)

The tool now supports both approaches - you can use direct commands for scripting or run without arguments to see available options.

License

MIT

Contributing

Contributions, issues, and feature requests are welcome!