Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Environment store logo

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 transfer command to move between them.
  • Three interfaces: EnvironmentStoreManager in Python, the environment-store CLI, 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 level

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.0rc1

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

Source distribution (sdist)

Source distribution for environment-store 0.1.0rc1
File Size Uploaded
environment_store-0.1.0rc1.tar.gz 41.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for environment-store 0.1.0rc1
File Interpreter ABI Platform
environment_store-0.1.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 97.5 kB

Release files / environment_store-0.1.0rc1.tar.gz

Download URL environment_store-0.1.0rc1.tar.gz
Size 41.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a474557abb57be1ef068b57875688b1f742739ed888288a996b26aad7f61b904
BLAKE2b-256 checksum
How to use checksums
e846351d71b87d1e8d25cffa0a429faa11e91cf61fc597bafca6834e1b0cb1a3
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.0rc1-py3-none-any.whl

Download URL environment_store-0.1.0rc1-py3-none-any.whl
Size 55.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fec357cfdbcab08245df6a9a6aeb934f0c431cae0e5d0ffac5039ce08871258
BLAKE2b-256 checksum
How to use checksums
460c6835e7c909523e8494c81ec577dd756de02bc6a2c01f7d3288ec66c0325e
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 history Release notifications | RSS feed

This release

0.1.0rc1 This release

2 release files

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