Skip to content

phalberg/configlock

Repository files navigation

CI Status Python Version License

ConfigLock

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.

Quick start

# 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:

CLI Usage

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-serve

Status

ConfigLock 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.

Roadmap

  • 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

The problem

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

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

sync: Compares your current YAML/JSON against the lockfile. If a key is missing or a type has changed, you get an error.

Lock

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.

Lock with strict ordering

Please use the command:

configlock lock {path_to_your_file} --order-matters

If the order of the keys matter, if not the default:

configlock lock {path_to_your_file} --no-order-matters

will be set.

License

This project is licensed under the terms of the MIT license.

About

An open-source, Git-backed, lockfile-driven configuration manager designed to bridge the gap between non-technical domain experts and production code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages