New:Socket for Asana Is Now Available.Learn more
Sign In

@itsthw/autoenv

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@itsthw/autoenv

Generate .env.example from your project's env usage

latest
npmnpm
Version
8.0.0
Version published
Weekly downloads
18
-55%
Maintainers
1
Weekly downloads
 
Created
Source

autoEnv generates a .env.example file by scanning your project for real environment variable usage. It creates a single source of truth for your team without guessing secrets.

Installation & Usage

First, install it as a development dependency:

# Using npm
npm install -D @itsthw/autoenv

# Using pnpm
pnpm add -D @itsthw/autoenv

then, run the initialization command:

npx autoenv init

How It Works

  • Scan: Analyzes codebase for process.env, import.meta.env, and ${VAR} usage.
  • Detect: Identifies only variables that are actually used.
  • Generate: Creates a clean .env.example file.
  • Default Mode: Lists variable names only.
  • AI Mode: Adds descriptions and safe example values using LLMs.

OpenAI API Key Security

If you choose AI Mode, an OpenAI API key is required.

  • Input: Reads from the OPENAI_API_KEY environment variable (recommended) or an interactive prompt.
  • Safety: The key is never written to disk, never logged, and only used for the current run.

Key Options

CommandDescription
npx autoenv initStandard interactive setup.
npx autoenv init --forceOverwrites existing output files.

Keywords

env

FAQs

Package last updated on 04 Jan 2026

Related posts