ConfigLock is a lightweight CLI tool designed to prevent production outages by configuration errors. It brings the concept of Lockfiles (inspiration from uv) to your application’s .yaml or .json configurations.
# Install from PyPi
pip install cfglock
# Initialize a lockfile
configlock init my_config.yaml
# Sync after changes
configlock sync my_config.yaml
If you want to develop locally from the repository:
git clone https://github.com/phalberg/configlock
cd configlock
# Install dependencies
uv sync
# Initialize a lockfile
uv run configlock init my_config.yaml
# Sync after changes
uv run configlock sync my_config.yaml
If you wish to not write uv each time, you can do as such (editable mode):
pip install -e .Run the command directly after install:
configlock --helpIn modern DevOps, non-technical team members often need to edit configuration files (YAML/JSON). One missing key or a wrong data type (e.g., entering a string where a boolean is expected) may crash a production environment.
Usage:
$ [OPTIONS] COMMAND [ARGS]...Options:
--install-completion: Install completion for the current shell.--show-completion: Show completion for the current shell, to copy it or customize the installation.--help: Show this message and exit.
Commands:
init: Reads a YAML config and generates a lockfile.sync: Used to check if lock file and proposed...lock: Used to update the lock file, IF compatible
Reads a YAML config and generates a lockfile.
Usage:
$ init [OPTIONS] FILE_PATHArguments:
FILE_PATH: the path for the newly proposed file [required]
Options:
--help: Show this message and exit.
Used to check if lock file and proposed file are out of sync
Usage:
$ sync [OPTIONS] FILE_PATHArguments:
FILE_PATH: the path for the newly proposed file [required]
Options:
--help: Show this message and exit.
Used to update the lock file, IF compatible
Usage:
$ lock [OPTIONS] FILE_PATHArguments:
FILE_PATH: the path for the newly proposed file [required]
Options:
--order-matters / --no-order-matters: choose if the order of the keys matter or not [default: no-order-matters]--help: Show this message and exit.
Preview the docs locally with hot reload:
uv run docs-serveConfigLock is a personal hobby project focused on learning robust CLI development and structural validation logic.
Note
This project is in an early prototype stage. It is a learning exercise in building developer tools with Python and Typer.
This project is licensed under the terms of the MIT license.