This release is a pre-release and may not be stable for production use.
Environment store
Store and manage environment variables persistently, in a hierarchy, on different backends: a local file, PostgreSQL, AWS Parameter Store or AWS Secrets Manager. Use it from Python, the command line or an interactive terminal UI.
- Hierarchical: organisation > project > environment > service. Child levels override their parents.
- Pluggable backends: the same API, CLI and TUI for every store, and a
transfercommand to move between them. - Three interfaces:
EnvironmentStoreManagerin Python, theenvironment-storeCLI, and a Textual-based TUI. - Agent friendly: ships a skill that teaches LLM agents to use the CLI safely.
root LOG_LEVEL=info
└── acme (organisation) DB_HOST=db.acme.internal
└── webapp (project)
└── prod (environment) LOG_LEVEL=warning
└── api (service) PORT=8080
The resolved variables of acme / webapp / prod / api are all of the above combined, deeper values winning:
DB_HOST=db.acme.internal, LOG_LEVEL=warning, PORT=8080.
Quickstart
uv add "environment-store[tui]" # or: pip install "environment-store[tui]"
export ENVIRONMENT_STORE_BACKEND=json ENVIRONMENT_STORE_JSON_FILE=./store.json
environment-store set LOG_LEVEL info
environment-store set PORT 8080 -o acme -p webapp -e prod -s api
environment-store list -o acme -p webapp -e prod -s api --resolved
environment-store tui
from environment_store import EnvironmentStoreManager
from environment_store.adapters.json import JsonFileAdapter
manager = EnvironmentStoreManager(adapter=JsonFileAdapter("./store.json"))
manager.set_variable("DB_HOST", "localhost", organisation="acme", project="webapp")
manager.get_resolved_variables(organisation="acme", project="webapp")
The full walkthrough is in the Quickstart.
Documentation
| Guide | |
|---|---|
| Quickstart | five minutes from install to your first variables |
| Installation | extras, uv, pip, git, uvx |
| Python usage | the EnvironmentStoreManager API |
| Command line interface | all commands, transfer, exit codes, recipes |
| Terminal UI | layout and key bindings |
| Storage backends | JSON, PostgreSQL, Parameter Store, Secrets Manager |
| Development | setup, architecture, tests, contributing |
| Adding a storage adapter | developer guide for new backends |
Installation
The core package depends only on pydantic and includes the JSON backend and the CLI. Everything else is an extra:
| Extra | Adds |
|---|---|
aws |
AWS Parameter Store and Secrets Manager backends (boto3) |
postgres |
PostgreSQL backend and migrate (psycopg, sqlalchemy, yoyo-migrations) |
tui |
the terminal UI (Textual) |
full |
all of the above |
uv add "environment-store[full]"
More, including installing from git and running without installing, in the installation guide.
Python
Everything goes through EnvironmentStoreManager; only the adapter changes per backend. Pass the hierarchy as
keyword arguments (organisation=, project=, environment=, service=); levels cannot be skipped.
manager.set_variables({"LOG_LEVEL": "INFO"}, organisation="acme")
manager.get_variable("DB_HOST", organisation="acme", project="webapp") # exact level
manager.get_resolved_variables(organisation="acme", project="webapp") # with parent levels
manager.get_child_levels(organisation="acme") # ["webapp"]
manager.delete_level(organisation="acme", project="webapp", confirm="webapp")
Reading, writing, resolving, discovering, deleting and copying are covered in the Python guide.
Command line
environment-store set DB_HOST localhost -o acme -p webapp
environment-store get DB_HOST -o acme -p webapp
environment-store list -o acme --resolved --format json
environment-store import .env -o acme -p webapp -e dev
environment-store delete-level -o acme -p webapp --dry-run
environment-store transfer --dest-backend postgres --dest-database-url "$URL" --dry-run
environment-store migrate # PostgreSQL schema
Commands: get, set, list, delete, import, children, delete-level, transfer, migrate, tui.
Choose the backend with --backend or ENVIRONMENT_STORE_BACKEND. Data goes to stdout, messages to stderr, and
exit codes are stable. See the CLI guide for every option.
Terminal UI
environment-store tui
A tree of your levels next to a table of their variables. Navigate with the arrow keys or hjkl; a add, e edit,
d delete, n new level, x delete a level (you must type its name), r resolved view, v show values,
q quit. See the TUI guide.
Storage backends
| Backend | --backend |
Stores |
|---|---|---|
| JSON file | json |
one local file |
| PostgreSQL (15+) | postgres |
one row per variable; run environment-store migrate first |
| AWS Parameter Store | ssm |
one parameter per variable |
| AWS Secrets Manager | secretsmanager |
one secret per prefix |
Options, IAM permissions, layouts and trade-offs are in Storage backends.
Development
uv sync && pre-commit install
uv run pytest && uv run ruff check && uv run ty check
The CLI, the TUI and any future frontend are thin layers over EnvironmentStoreManager; all logic lives in
environment_store/core/. Architecture, testing, adding features and adapters, and database migrations are in the
development guide. To add a new storage backend follow
Adding a storage adapter.
License
MIT, see LICENSE.
Metadata
Release files for environment-store 0.1.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| environment_store-0.1.0rc2.tar.gz | 42.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| environment_store-0.1.0rc2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 99.6 kB
Release files / environment_store-0.1.0rc2.tar.gz
| Download URL | environment_store-0.1.0rc2.tar.gz |
|---|---|
| Size | 42.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a8e979c346126a376fc8bca62566f9d84074ef2f49e542e7402109c7635bf9e
|
|
BLAKE2b-256 checksum How to use checksums |
b01f0ab06e3c010b8fbb8948b384ff59f9ca4153b398a83994a597e5302601a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / environment_store-0.1.0rc2-py3-none-any.whl
| Download URL | environment_store-0.1.0rc2-py3-none-any.whl |
|---|---|
| Size | 56.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05c642152c676265351aefcfd29b2cff25788879539d79354d4c9168c9c50ec8
|
|
BLAKE2b-256 checksum How to use checksums |
74b08fc2bd0aaa0e34a1a78ceaed40640984021ee0421c1b5b7b7cf15b05af26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|