envstack
envstack is an environment variable composition and activation layer for tools and processes.
It is built for cases where environments are hierarchical, shared, and
context-dependent, and where a flat .env file stops being enough.
export ENVPATH=studio/base:show/foo:tool/nuke/14
envstack -- nuke
Why envstack
envstack is a lightweight CLI and Python library for composing, tracing,
exporting, and reproducing environment variables using a PATH-like model
called ENVPATH.
Compose
- Hierarchical environment layers
- Ordered precedence and overrides
- Cross-platform environment activation
Explain
- Trace variable origins
- Inspect unresolved values
- Debug stack ordering and overrides
Export
- Bake resolved environments
- Export to shell formats
- Reproduce environments deterministically
ENVPATH
ENVPATH defines where environment fragments are discovered and in what
order they apply, similar to PATH, but for full environments.
export ENVPATH=prod/base:prod/show/foo:prod/tools/nuke14
envstack -- nuke
Later entries can layer on top of earlier ones through includes, hierarchy, and explicit precedence rules.
envstack is not
- A dependency solver
- A package manager
- A virtualenv replacement
- A build system
It is intentionally boring: explicit inputs, deterministic outputs, and tooling that tells you what it did.
Install
pip install envstack
Quickstart
Inspect the unresolved environment:
envstack -u
Resolve a specific variable:
envstack -r DEPLOY_ROOT
Run a command inside the active stack:
envstack -- echo {DEPLOY_ROOT}
Trace where a variable comes from:
envstack -t PATH
Learn More
- Design: mental model, hierarchy, and precedence
- Examples: common patterns and stack layouts
- Secrets: encrypted values and key handling
- Comparison: how envstack differs from adjacent tools
- FAQ: operational details and gotchas
- API: Python and CLI reference material
- Roadmap: planned improvements and future work