Central management and distribution tool for favorite dotfiles and configuration templates
Project description
dotconfig-hub
Centrally manage and distribute your development configurations across projects.
dotconfig-hub keeps your dotfiles, IDE settings, AI assistant instructions, CI/CD workflows, and other configuration templates in a single hub repository, and syncs them bidirectionally to any number of projects.
Key Features
- Environment Sets — Group related configurations (e.g., Python dev, AI assistants) and activate them per project.
- Bidirectional Sync — Push templates to projects, or pull project improvements back to the hub.
- Interactive Mode — When arguments are omitted, CLI prompts guide you through each action.
- Init-Only Files — Mark files that should only be delivered on first setup and never overwritten.
- File Rename Rules — Rename files during delivery (e.g.,
.gitignore.hubin the hub becomes.gitignorein the project). - Compare & Merge — Diff files across environment sets and selectively merge between them.
- Project Tracking — Automatically records which projects use which environment sets.
- Backup Exclusion —
.bakbackup files created during sync are automatically excluded from future syncs. - Safe Operations — Dry-run previews, timestamped automatic backups, and content-based change detection.
Installation
Requires Python 3.9+.
# From PyPI
pip install dotconfig-hub
# or
uv add dotconfig-hub
# From source
git clone https://github.com/hasegama/dotconfig-hub.git
cd dotconfig-hub
pip install -e .
Quick Start
1. Prepare a templates repository
Clone or create a repository that will serve as your central hub:
git clone https://github.com/your-org/dotconfig-templates.git ~/dotconfig-templates
The hub contains a config.yaml that defines your environment sets (see Configuration).
2. Set up a project
cd /path/to/your-project
dotconfig-hub setup --templates-dir ~/dotconfig-templates
dotconfig-hub init # Select environment sets interactively
dotconfig-hub sync # Sync files from hub to project
3. Keep in sync
dotconfig-hub sync --dry-run # Preview what would change
dotconfig-hub sync # Apply interactively
dotconfig-hub sync --auto-sync local # Hub -> Project (no prompts)
dotconfig-hub sync --auto-sync remote # Project -> Hub (no prompts)
How It Works
~/dotconfig-templates/ # Hub (templates repository)
├── config.yaml # Environment set definitions
├── project_mapping.yaml # Auto-maintained project registry
├── my_project_init_template/ # Environment set directory
│ ├── .claude/
│ ├── .github/
│ └── .vscode/
└── minimal_template/
└── .vscode/
your-project/ # Any project
├── dotconfig-hub.yaml # Project-level settings
├── .claude/ # <- Synced from hub
├── .github/ # <- Synced from hub
└── .vscode/ # <- Synced from hub
Each environment set groups one or more tools (logical units like vscode, github, claude_config), and each tool maps to a set of files in the hub. When you sync, dotconfig-hub compares hub files against project files and lets you choose the sync direction per file.
CLI Reference
setup
Configure the templates source for the current project.
dotconfig-hub setup # Interactive
dotconfig-hub setup --templates-dir ~/path # Explicit
global-config
Set machine-wide defaults for templates source and environment sets. These are suggested during interactive setup prompts.
dotconfig-hub global-config --templates-dir ~/dotconfig-templates
dotconfig-hub global-config --env-sets my_project_init_template,minimal_template
init
Activate environment sets for the current project.
dotconfig-hub init # Interactive selection
dotconfig-hub init --env-set my_project_init_template --force
sync
Synchronize files between hub and project.
dotconfig-hub sync # Interactive per-file prompts
dotconfig-hub sync --dry-run # Preview only
dotconfig-hub sync --auto-sync local # Hub -> Project
dotconfig-hub sync --auto-sync remote # Project -> Hub
dotconfig-hub sync --tool claude_config # Sync specific tool only
dotconfig-hub sync --env-set minimal_template # Sync specific environment set
dotconfig-hub sync --file ".gitignore" # Sync files matching pattern
dotconfig-hub sync --all # Include init_only files too
Interactive sync prompt:
Choose action:
Update [P]roject (Hub -> Project)
Update [H]ub (Project -> Hub)
[S]kip this file
[D]isplay full diff
[C]hanges only (context diff)
Select [p/h/s/d/c] (s):
list
Show configuration status — templates source, available environment sets, and active tools.
dotconfig-hub list
projects
View and manage tracked projects.
dotconfig-hub projects # List all
dotconfig-hub projects --env-set my_project_init_template # Filter by set
dotconfig-hub projects --cleanup # Remove missing projects
compare
Compare files across two environment sets within the hub. No project setup required.
dotconfig-hub compare set_a set_b # Show common file diffs
dotconfig-hub compare set_a set_b --tool vscode # Filter by tool
dotconfig-hub compare set_a set_b --file "*.json" # Filter by file pattern
dotconfig-hub compare set_a set_b --merge # Interactive merge mode
dotconfig-hub compare set_a set_b --merge --dry-run
Configuration
Hub: config.yaml
Defines environment sets and their tools in the templates repository:
environment_sets:
my_project_init_template:
description: "Complete project initialization template"
tools:
claude_config:
project_dir: my_project_init_template
files:
- CLAUDE.md
- .claude/commands/*.md
- { source: ".github/CODEOWNERS", init_only: true }
vscode:
project_dir: my_project_init_template
files:
- .vscode/settings.json
- .vscode/extensions.json
github:
project_dir: my_project_init_template
files:
- .github/workflows/*.yml
- .github/ISSUE_TEMPLATE/*.md
git_config:
project_dir: my_project_init_template
files:
# Renamed on delivery: .gitignore.hub in the hub -> .gitignore in the project
- { source: .gitignore.hub, target: .gitignore, init_only: true }
File entries can be:
- String —
"path/to/file"or"path/*.ext"(glob patterns supported, always synced) - Dict —
{ source: "file", init_only: true }(synced only on first setup; never overwrites existing files) - Dict with rename —
{ source: ".gitignore.hub", target: ".gitignore" }(renamed during delivery; glob patterns not supported with rename)
Tool-level options:
include_backup_files: true— Include.bakbackup files in sync. By default,.bakfiles (created automatically during sync as timestamped backups like.bak.20260407_153000) are excluded from file discovery. Set this totrueon a tool if you need to sync.bakfiles explicitly.
Project: dotconfig-hub.yaml
Created by setup and init in each project:
templates_source: ~/dotconfig-templates
active_environment_sets:
- my_project_init_template
Project Mapping: project_mapping.yaml
Auto-maintained in the hub. Tracks which projects use which sets:
projects:
~/workspace/my-project:
environment_sets:
- my_project_init_template
last_synced: "2024-01-15T10:30:00Z"
Use Cases
- AI Assistant Instructions — Claude (
CLAUDE.md, commands), GitHub Copilot, Cursor rules - IDE Settings — VS Code settings, extensions, tasks, launch configurations
- CI/CD Workflows — GitHub Actions, pre-commit hooks, Dependabot
- Code Quality — Linter and formatter configurations (ruff, ESLint, Prettier)
- Project Templates — Issue templates, PR templates, contributing guides,
.gitignore
Development
Built with Claude Code.
Dependencies
| Runtime | Development |
|---|---|
| click | ruff |
| pyyaml | black |
| rich | pytest |
| gitpython | pre-commit |
Contributing
- Fork the repository
- Create a feature branch (
feature/your-feature) - Make your changes
- Submit a pull request
See the Git-Flow branching model and Conventional Commits for commit messages.
License
MIT License — see LICENSE for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dotconfig_hub-0.2.0.tar.gz.
File metadata
- Download URL: dotconfig_hub-0.2.0.tar.gz
- Upload date:
- Size: 41.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6482f2790501751064f4209d2ccda4d81fb3d57ea5410d087c8ae1650a0e1509
|
|
| MD5 |
51f5486d86cc045434bebd9493ea03ae
|
|
| BLAKE2b-256 |
6c7175cbb073e67c26bcfcf60c6794289d9ce63ac319c7ecd92efdcb48fb42d8
|
Provenance
The following attestation bundles were made for dotconfig_hub-0.2.0.tar.gz:
Publisher:
publish.yml on hasegama/dotconfig-hub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dotconfig_hub-0.2.0.tar.gz -
Subject digest:
6482f2790501751064f4209d2ccda4d81fb3d57ea5410d087c8ae1650a0e1509 - Sigstore transparency entry: 1272132026
- Sigstore integration time:
-
Permalink:
hasegama/dotconfig-hub@ae817024268e656bb4569080be56ed634704694e -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/hasegama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ae817024268e656bb4569080be56ed634704694e -
Trigger Event:
push
-
Statement type:
File details
Details for the file dotconfig_hub-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dotconfig_hub-0.2.0-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e904fbd47e6ae78558a61b27d63f68e5c31c73c528ec3691f3798678ab37a8fd
|
|
| MD5 |
44885e6624b805cc1ae944bcedf4bc73
|
|
| BLAKE2b-256 |
666442776c3078fc7ce73e8bc55664e405fa1756de1b2bfdd3928197be6f5ccf
|
Provenance
The following attestation bundles were made for dotconfig_hub-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on hasegama/dotconfig-hub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dotconfig_hub-0.2.0-py3-none-any.whl -
Subject digest:
e904fbd47e6ae78558a61b27d63f68e5c31c73c528ec3691f3798678ab37a8fd - Sigstore transparency entry: 1272132154
- Sigstore integration time:
-
Permalink:
hasegama/dotconfig-hub@ae817024268e656bb4569080be56ed634704694e -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/hasegama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ae817024268e656bb4569080be56ed634704694e -
Trigger Event:
push
-
Statement type: