Chezmoi Reference

Reference chezmoi commands, templates, scripts, and naming conventions for dotfile management.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/oskar-dragon/claude-code --skill chezmoi-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Chezmoi Reference
Source: https://github.com/oskar-dragon/claude-code/tree/main/plugins/chezmoi/skills/chezmoi-reference
Command: npx skills add https://github.com/oskar-dragon/claude-code --skill chezmoi-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Chezmoi Reference provides concise, actionable guidance for managing dotfiles across machines, removing confusion about filename conventions, template variables, script execution order, and common chezmoi commands so users can reliably version and apply configuration changes.

Core Features & Use Cases

  • Comprehensive command reference for editing, diffing, applying, updating, and inspecting chezmoi-managed files.
  • Clear file naming and prefix conventions (dot_, private_, executable_, .tmpl) with examples for combined prefixes and permission behaviors.
  • Template system and variable reference covering .chezmoi.* variables, custom data merging, Sprig functions, and 1Password secret integration; includes script execution ordering and package management patterns for cross-machine setups.
  • Use cases: onboarding a new machine with templated configs, adding and templating a new dotfile, debugging template data, and orchestrating run_once/run_onchange scripts.

Quick Start

Generate step-by-step instructions to add a new dotfile to chezmoi, convert it to a template using available variables, and apply the changes to the home directory across machines.

Frequently Asked Questions about Chezmoi Reference

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

FAQPage Schema
What do chezmoi filename prefixes like dot_ and private_ mean?

Chezmoi filename prefixes like dot_, private_, and executable_ control target dotfile naming, permissions, and visibility behaviors when applying source files to your home directory. Combined prefixes stack to define multiple attributes for a single managed file.

How do I template dotfiles with custom data and .chezmoi variables?

Template dotfiles by appending the .tmpl suffix to source files, then inject custom data and .chezmoi.* variables using Sprig functions. This allows dynamic configuration generation tailored to specific machines during the apply process.

How do chezmoiscripts run and what is the execution order?

Chezmoiscripts execute during apply using run_once_ and run_onchange_ prefixes to control frequency and trigger conditions. Execution ordering follows deterministic alphabetical sorting to ensure reliable script orchestration across machines.

Can I use 1Password secrets to manage dotfile configurations?

Yes, chezmoi templates support 1Password secret integration, allowing you to securely embed sensitive data into configuration files. This ensures secrets are resolved dynamically during the apply process without hardcoding them.

What is the best way to preview dotfile changes before applying them?

Preview dotfile changes by running the diff command to inspect source state against target home directory files. This verifies template variable substitution and file permission updates before committing configuration syncing.

Why are my chezmoi templates not applying the correct file permissions?

Incorrect permissions often stem from missing or misordered filename prefixes like executable_ or private_. Check combined prefix semantics in your source state to ensure attributes stack correctly before applying to the target machine.