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.
# Clone the repo
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:
Install the project in editable mode while developing:
pip install -e .Run the command directly after install:
configlock --help
configlock init {path_to_your_file}
configlock lock {path_to_your_file}
configlock sync {path_to_your_file}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.
- Basic CLI integration with Typer
- GitHub Actions CI/CD pipeline
- Recursive Type & Structure checking
- GitHub API integration (Fetch remote configs)
- Web-based UI for configuration visualization
In 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.
init: Analyzes your YAML/JSON and creates a config.lock.json that stores the required structure and types.Note: ConfigLock generates one unique lockfile corresponding to the file path provided.
sync: Compares your current YAML/JSON against the lockfile. If a key is missing or a type has changed, you get an error.lock: Checks your current YAML/JSON and tries to replace the locked file with the new changed current file, if the change is not compatible, you get an error.
Please use the command:
configlock lock {path_to_your_file} --order-mattersIf the order of the keys matter, if not the default:
configlock lock {path_to_your_file} --no-order-matterswill be set.
This project is licensed under the terms of the MIT license.