A minimal CLI tool to organize, load, and switch between your project's environment contexts.
Project description
envlit
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
.envfile 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file envlit-0.0.1.tar.gz.
File metadata
- Download URL: envlit-0.0.1.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa4d347a84ad1c7523d80c90826bfb0bab2bd899ca3058f5e1da32fff8eb2ea2
|
|
| MD5 |
4fdd7c1f571f41e5a30a52123e48a8ef
|
|
| BLAKE2b-256 |
8c4bf1b7d31f30652e39bda998c12d37b43150037f85b43943c74eb7eeefd8d8
|
Provenance
The following attestation bundles were made for envlit-0.0.1.tar.gz:
Publisher:
release.yml on luocfprime/envlit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envlit-0.0.1.tar.gz -
Subject digest:
aa4d347a84ad1c7523d80c90826bfb0bab2bd899ca3058f5e1da32fff8eb2ea2 - Sigstore transparency entry: 947169140
- Sigstore integration time:
-
Permalink:
luocfprime/envlit@2a0a6b84ef231519dadf3c5f419ab59a8ef0baf6 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/luocfprime
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2a0a6b84ef231519dadf3c5f419ab59a8ef0baf6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file envlit-0.0.1-py3-none-any.whl.
File metadata
- Download URL: envlit-0.0.1-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddd6e5de724922fbcbb7194b559de3fa7e96a54a215b57d6659aa29d6309e27b
|
|
| MD5 |
ad5720106e39ba594dd7f02f2c64975d
|
|
| BLAKE2b-256 |
a20951bd3a9faa2f890a08b086afc25928fb012771e05ae6861de846ca44cb52
|
Provenance
The following attestation bundles were made for envlit-0.0.1-py3-none-any.whl:
Publisher:
release.yml on luocfprime/envlit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envlit-0.0.1-py3-none-any.whl -
Subject digest:
ddd6e5de724922fbcbb7194b559de3fa7e96a54a215b57d6659aa29d6309e27b - Sigstore transparency entry: 947169145
- Sigstore integration time:
-
Permalink:
luocfprime/envlit@2a0a6b84ef231519dadf3c5f419ab59a8ef0baf6 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/luocfprime
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2a0a6b84ef231519dadf3c5f419ab59a8ef0baf6 -
Trigger Event:
release
-
Statement type: