My dotfiles, app config, and formatter config, synced between host and repo with a single script.
- Two-way sync between host system and this repository.
- JSON-based mapping for flexible file organization.
- Dry-run mode for safe previewing.
- No external dependencies (Python 3 standard library only).
Clone the repo and pull your host config into it:
git clone <repo-url> && cd config
./scripts/sync.py # host -> repoTo push repo config back to the host:
./scripts/sync.py --to-host # repo -> hostPreview before writing:
./scripts/sync.py --dry-runAn array of objects, each mapping a host path to a repo path:
[{ "hostPath": "~/.zshrc", "projPath": "app/.zshrc" }]hostPath: absolute or~-prefixed path on the host.projPath: path relative to the project root.
| Flag | Description |
|---|---|
--to-host |
Reverse direction: copy from repo to host. |
--dry-run |
Preview actions without writing files. |
--map FILE |
Use a different mapping file (default: mappings.json). |
--project-root DIR |
Set the base directory for repo paths (default: current directory). |
--verbose |
Print each copy action. |
- Place the config file under
app/(or another fitting directory). - Add an entry to
mappings.json. - Run
./scripts/sync.pyor./scripts/sync.py --to-hostas needed.
app/: application config (shell, editor, input method, SSH, etc.).formatters/: formatter config (clang-format, prettier, ruff).scripts/sync.py: the sync script.mappings.json: default host-to-repo path mapping.
Copyright (c) 2025 Yulong Ming i@myl7.org
MIT License