chezmoi

Map deployed dotfiles to chezmoi source paths and apply changes.

1|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/huangeddie/dotfiles --skill chezmoi-huangeddie
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chezmoi
Source: https://github.com/huangeddie/dotfiles/tree/main/dot_agents/exact_packages/devops/exact_skills/chezmoi
Command: npx skills add https://github.com/huangeddie/dotfiles --skill chezmoi-huangeddie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents you from breaking your dotfiles workflow by ensuring you edit the correct chezmoi source-of-truth files instead of directly changing deployed targets.

Core Features & Use Cases

  • Edit the source state, not the deployed targets: Ensures agents modify ~/.local/share/chezmoi/ (or the configured source-path) so changes can be applied safely to $HOME.
  • Apply a consistent workflow for sync and debugging: Covers chezmoi source-path, status, diff, and apply so you can preview and reason about changes before they land.
  • Use correct filename attributes and script conventions: Documents naming prefixes (e.g., dot_, private_, executable_, symlink_, run_onchange_) and the behavioral rules for run_ scripts and templates.

Quick Start

Use the chezmoi skill to find the source file for a deployed target, then edit the corresponding file in the chezmoi source directory and run chezmoi apply.

Frequently Asked Questions about chezmoi

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

FAQPage Schema
How do I prevent configuration drift when editing dotfiles managed by chezmoi?

To prevent configuration drift, edit the chezmoi source state files instead of deployed targets. Modify files in the source directory, preview changes with diff and status, then run apply to safely update your home directory.

What do chezmoi filename prefixes like run_ and run_onchange_ mean?

Chezmoi filename prefixes like run_ and run_onchange_ define script hook semantics. The run_ prefix executes scripts, run_onchange_ triggers scripts when content changes, and run_once_ ensures scripts execute only a single time during apply.

How do I map a deployed dotfile target back to its chezmoi source path?

You can map a deployed dotfile target to its source path using the chezmoi source-path command. This ensures you locate and edit the correct source-of-truth file before applying changes to your home directory.

What is the safest workflow for applying dotfile changes across multiple machines?

The safest workflow for applying dotfile changes is to edit the source state, use chezmoi status and diff to preview pending changes, and then execute chezmoi apply to synchronize the deployed targets in your home directory.

Why did my changes disappear after running chezmoi apply?

Changes disappear after running chezmoi apply if you edited the deployed target directly instead of the source state. You must modify the corresponding source file in the chezmoi source directory to preserve changes during synchronization.

Can I use templates and script hooks together in chezmoi configuration management?

Yes, you can use templates and script hooks together in chezmoi. You apply template and data conventions to source files while using script prefix semantics like run_onchange_ to execute logic when templated configurations change.