Skip to main content

The official Python engine for the ConfigLock ecosystem

Project description

CI Status Python Version

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

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

Quick start (locally)

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

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.

CLI

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

init

Reads a YAML config and generates a lockfile.

Usage:

$ init [OPTIONS] FILE_PATH

Arguments:

  • FILE_PATH: the path for the newly proposed file [required]

Options:

  • --help: Show this message and exit.

sync

Used to check if lock file and proposed file are out of sync

Usage:

$ sync [OPTIONS] FILE_PATH

Arguments:

  • FILE_PATH: the path for the newly proposed file [required]

Options:

  • --help: Show this message and exit.

lock

Used to update the lock file, IF compatible

Usage:

$ lock [OPTIONS] FILE_PATH

Arguments:

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

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfglock-0.1.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cfglock-0.1.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file cfglock-0.1.2.tar.gz.

File metadata

  • Download URL: cfglock-0.1.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}

File hashes

Hashes for cfglock-0.1.2.tar.gz
Algorithm Hash digest
SHA256 931d3daaa2fa27b08b601b4cb9818af5c5b9b3ddc5d26ab1a70e031f3da18c4b
MD5 eb9dd3cfc94fd9059108cb216597feb3
BLAKE2b-256 44c19dbbcc2a28282e3f0850ad37c78c7dcdcd4fdbe91a4d28a63b947298668e

See more details on using hashes here.

File details

Details for the file cfglock-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cfglock-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}

File hashes

Hashes for cfglock-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 30aefebda7f1f4d8bbf0a496065d9321d76336622ca8704b3d828e34dcce43de
MD5 06c31ab81bac8e24f3b5324a5968821b
BLAKE2b-256 67879293eb3e6c37785d4e54aef1e9bbdf4afecb20ace2716920a034cf35da5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page