Skip to main content

config-keeper

CI Codecov PyPI - Version PyPI - Downloads

User-friendly CLI for keeping your personal files or directories in a repository.

In a few words config-keeper does following:

  • Collects information about what files on current machine it should keep
  • Makes a temporary copy of all these files and pushes it to specified repository
  • Pulls files from a repository later and puts them to the right places

Table of contents

Use cases

  1. You spend a lot of time writing launch/build tasks or making config files for a project you develop, but these stuff cannot be placed along with the project itself.
  2. You have to switch between work computers from time to time while you working on same project and you have to send yourself archives with bunch of updated files.
  3. You want to save some system-wide config (like .bashrc) to use it later or quickly restore if something goes wrong.

Finally, you want to automate these stuff.

Key features

  • Create projects as logical groups of files to sync and a repository
  • All configuration in a single YAML file - update it using CLI or by hands using validate command after
  • Terminal auto-completion
  • User-friendly error messages if something goes wrong

Install

Install pipx first.

pipx install config-keeper2

Using pip

pip install --user config-keeper2

NOTE: if you are using latest versions of Ubuntu/Debian/Fedora, you may also need to use --break-system-packages flag. Refer to PEP 668 for more information.

Usage

config-keeper relies on a project as logical group of files to sync and a repository. Each project consists of

  • Paths. These are any files or directories in your filesystem which you want to keep. Some of them might not exist yet, if you are want to pull them first from existing repository. But they must exist if you are going to push.
  • Repository. Here your files and directories live. When you going to push or pull, this repository is used.
  • Branch. The branch of repository. Nothing special. If you want, you can use the same repository across multiple projects with different branches.

Quick start

To begin, create a project:

config-keeper project create myproject
# Repository: git@github.com:MyUser/personal-stuff.git
# Branch [main]: mybranch
# Project "myproject" saved.

Here assumed that repository exists and you have permissions to communicate with it. Branch may exist or not - if not, it will be created at first push.

Next, add path to the project:

config-keeper paths add \
    --project myproject \
    my_config.ini:~/configs/my_config.ini \
# Project "myproject" saved.

Here we said that ~/configs/my_config.ini file should live in our repository as my_config.ini.

Assuming that ~/configs/my_config.ini exists, let's push it:

config-keeper push myproject
# Going to push into following branches:
# - "mybranch" at git@github.com:MyUser/personal-stuff.git (from "myproject")
# Proceed? [Y/n]:

If something goes wrong at this step (or at any other step) you will probably have a nice-readable error. If this is not your case please create an issue describing how to reproduce the bug and the desired behavior.

Now, if you visit repository, you should see that mybranch has recent commit with my_config.ini file.

Finally, imagine you want to restore my_config.ini on your local machine from a repository. All you need to do is

config-keeper pull myproject
# Following paths will most likely be replaced:
# - /home/<my_user>/configs/my_config.ini (from "myproject")
# Proceed? [Y/n]:

If you confirmed replacing, the ~/configs/my_config.ini file now should be the same as in repository one.

Autocompletion

Run

config-keeper --install-completion

and reload shell.

NOTE: there is a known issue with zsh. As a workaround you can add compinit -D to the end of your .zshrc after installing completion.

CLI Reference

To learn what commands are available, please refer to REFERENCE.

NOTE: you can always check the description of any command by using --help, e.g.

config-keeper push --help

Metadata

Release files for config-keeper2 1.1.2

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

Source distribution (sdist)

Source distribution for config-keeper2 1.1.2
File Size Uploaded Provenance Actions
config_keeper2-1.1.2.tar.gz 29.1 kB Without provenance Details for config_keeper2-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for config-keeper2 1.1.2
File Interpreter ABI Platform Actions
config_keeper2-1.1.2-py3-none-any.whl Python 3 none any Details for config_keeper2-1.1.2-py3-none-any.whl

Total release size: 61.8 kB

Release files / config_keeper2-1.1.2.tar.gz

Download URL config_keeper2-1.1.2.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cf52e23c7fcceb62e4e2f33e8595193c6c916ec8575b95b1f4899dae597adbea
BLAKE2b-256 checksum
How to use checksums
646e9f6324c519cd68ecb164e0b6796f7f388429e7d6ed62bd4bb3d7215c6822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.7 Linux/6.2.0-1018-azure

Release files / config_keeper2-1.1.2-py3-none-any.whl

Download URL config_keeper2-1.1.2-py3-none-any.whl
Size 32.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
805480204fbb34c375ccf90499b63a98843d00e18742551ceee987a99e167781
BLAKE2b-256 checksum
How to use checksums
d64471ac7b9433e4321619341ec4f835a87af1c70fb9a1395acb5c72e07bc676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.7 Linux/6.2.0-1018-azure

Security for config-keeper2 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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