chezmoi-sync

Synchronize chezmoi-managed dotfiles by comparing home files with the source repository.

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/CNife/skills --skill chezmoi-sync-cnife
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chezmoi-sync
Source: https://github.com/CNife/skills/tree/main/.archive/chezmoi-sync
Command: npx skills add https://github.com/CNife/skills --skill chezmoi-sync-cnife

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires typer, ruamel.yaml, and includes scripts (resource) components.

What problem does it solve?

This Skill removes the manual friction of keeping chezmoi-managed dotfiles aligned across your home directory, local source repository, and remote Git branch while avoiding unsafe overwrite decisions.

Core Features & Use Cases

  • Safe synchronization flow: Fetch, pull, inspect status, and push repository changes with structured checks and clear progress markers.
  • Conflict-aware file handling: Compare home versus source changes, auto-resolve some cases with timestamps, and ask for confirmation when the direction is ambiguous.
  • Managed data reconciliation: Compare and sync modify_ managed fields between home JSON files and .chezmoidata.yaml so repository data stays consistent.
  • Use case: A user edits shell, editor, or terminal configuration on their machine and wants the changes recorded into the dotfiles repo without accidentally overwriting newer source files.

Quick Start

Ask the assistant to safely sync your chezmoi dotfiles and it will inspect changes, resolve what it can, request confirmation for risky apply operations, commit updates, and push them to the remote repository.

Frequently Asked Questions about chezmoi-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync dotfiles with chezmoi without overwriting newer changes?

To sync dotfiles safely, this Skill compares home directory files with the source repository using timestamps and prompts for confirmation when conflict direction is ambiguous, preventing accidental overwrites of newer files.

What is the safest way to resolve conflicts when applying chezmoi dotfiles?

Conflict resolution for chezmoi dotfiles is handled by comparing home versus source changes, auto-resolving unambiguous cases with timestamps, and asking for explicit confirmation before executing risky apply or re-add operations.

How do I reconcile modify_ managed fields between home JSON and .chezmoidata.yaml?

Managed data reconciliation compares and syncs modify_ managed fields between home JSON files and .chezmoidata.yaml, ensuring repository configuration data stays consistent across your dotfiles.

Do I need git and uv installed to automate my chezmoi sync workflow?

Yes, automating the chezmoi dotfiles sync workflow requires chezmoi, git, and uv installed, along with a Python helper script to detect changes and enforce safe apply-versus-re-add behavior.

Can I push committed dotfiles changes to a remote Git branch automatically?

Yes, the synchronization flow fetches, pulls, inspects status, prepares commits, and pushes repository changes to the remote Git branch with structured checks and clear progress markers.

Why does my chezmoi apply keep overwriting local edits I want to keep?

Standard chezmoi apply lacks built-in conflict awareness. This Skill enforces safe apply-versus-re-add behavior by comparing timestamps and requesting confirmation for ambiguous overwrites to protect local edits.