Skip to main content

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

Project description

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:

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

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

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

Documentation

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

Development

# Install dependencies
make install

# Run tests
pytest

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envlit-0.0.4.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envlit-0.0.4-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file envlit-0.0.4.tar.gz.

File metadata

  • Download URL: envlit-0.0.4.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for envlit-0.0.4.tar.gz
Algorithm Hash digest
SHA256 de6d4ce338eea7b12d92f1feb85238a569e20f292c4aca2d6d90936ce234328c
MD5 534412552e6fc4ea9575d51a15f6e394
BLAKE2b-256 a67ca1ff7866e9e5a1f0f6435c88de9083f755f908882f69afa3713cf0b9bf1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for envlit-0.0.4.tar.gz:

Publisher: release.yml on luocfprime/envlit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file envlit-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: envlit-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for envlit-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b3238a05611601f341ceab394046f94fda3a12a17ffacabf8be9bbd97ed39069
MD5 589dec4007720bf3465f4d7c8a01de39
BLAKE2b-256 0eaaaebdc1d91c8a7e8f19307a6c4d86e2a7bd37e12306b5ec913703489994ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for envlit-0.0.4-py3-none-any.whl:

Publisher: release.yml on luocfprime/envlit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page