Skip to main content

envlit

CI codecov Python Versions PyPI

A simple CLI tool to organize, load, and switch between your project's environment variable contexts.

Installation

pip install envlit

Quick Start

Initialize envlit in your shell (add to .bashrc or .zshrc):

eval "$(envlit init)"

Create a config file at .envlit/default.yaml:

dotenv:
  - "./.env"
  - "./.env.local"

env:
  PROJECT_MODE: "Development"
  DEBUG: "true"

Dotenv paths are relative to the YAML file. Later dotenv files override earlier ones with a warning, and env: overrides dotenv values last. Declared files are required; envlit never auto-discovers .env files.

Load and unload environment variables:

el                       # Load default profile
echo $PROJECT_MODE       # Output: Development (variable set by envlit)
echo $DEBUG              # Output: true (variable set by envlit)

eul                      # Unload environment variables
echo $PROJECT_MODE       # Output: (empty - variable restored to original state)
echo $DEBUG              # Output: (empty - variable restored to original state)

Features

  • Smart state tracking - Detects manual changes and preserves them
  • Dynamic flags - YAML-defined flags become CLI options
  • Path operations - Prepend, append, remove path entries
  • Lifecycle hooks - Run scripts before/after load/unload
  • Config inheritance - Extend base configurations
  • Explicit dotenv imports - Load one or more .env files with deterministic precedence

Comparison with Similar Tools

Feature envlit direnv dotenv
Auto-activation on cd ❌ ✅ ❌
Manual load/unload ✅ ❌ ✅
State restoration ✅ Full restore ⚠️ Basic ❌ No
Config format YAML Shell/direnvrc .env
Dynamic CLI flags ✅ ❌ ❌
PATH operations ✅ ✅ ❌
Lifecycle hooks ✅ 4 stages ⚠️ Limited ❌
Config inheritance ✅ ❌ ❌
Manual change detection ✅ ❌ ❌

Key Differences:

  • envlit: Manual control with explicit load/unload. Full state tracking with restoration. Better for variable contexts that you want to toggle on demand.
  • direnv: Automatically activates on directory change. Great for per-directory isolation but less control over when environments load. Basic restoration.
  • dotenv: Simple .env file loading, no restoration or advanced features. Good for 12-factor apps but lacks state management.

When to use envlit:

  • You want CLI flags that map to environment variables (especially useful for long names and values)
  • You want explicit control over when environments load/unload
  • You need to preserve user modifications and restore clean state
  • You need complex PATH operations or lifecycle hooks

AI Agent Skill

Documentation

Visit luocfprime.github.io/envlit for full documentation.

Development

# Install dependencies
make install

# Run tests
pytest

License

MIT License - see LICENSE for details.

Metadata

Release files for envlit 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envlit 0.0.8
File Size Uploaded Provenance Actions
envlit-0.0.8.tar.gz 34.5 kB With provenance Details for envlit-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for envlit 0.0.8
File Interpreter ABI Platform Actions
envlit-0.0.8-py3-none-any.whl Python 3 none any Details for envlit-0.0.8-py3-none-any.whl

Total release size: 54.9 kB

Release files / envlit-0.0.8.tar.gz

Download URL envlit-0.0.8.tar.gz
Size 34.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fcce3639a3d0e3d69c15d7e560f6c801255ab6e49ae47e6be11a38b68c5f30d1
BLAKE2b-256 checksum
How to use checksums
35cd4f7c374cac71a2eb3e690f824ded5e65be4e74e7b1ad8bdc660e9efc703c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / envlit-0.0.8-py3-none-any.whl

Download URL envlit-0.0.8-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43b459b3ff6a74728d849560366057dcb7b104c296ca85e3233f92266294ce49
BLAKE2b-256 checksum
How to use checksums
8b3eee2e9093c17a6fde3ddc17a024f3eb72d9bedf51fd57a79560f0f6d66367
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Security for envlit 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for envlit-0.0.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page