Helps users work with chezmoi dotfile manager: init, apply, add/re-add, templating, encryption, and cross-machine setup. Includes agent-specific guidance like avoiding `chezmoi edit` and using `--force`.
Ships in chezmoi-helper. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Chezmoi is a dotfile manager that lets users maintain configuration files across multiple machines with templating, encryption, and secret management. This skill helps users work with chezmoi at intermediate to advanced levels.
chezmoi init <repo-url> - Initialize chezmoi with a dotfiles repochezmoi apply - Apply managed dotfiles to the systemchezmoi status - See which files differ from the repositorychezmoi update - Pull changes from the repo and apply themchezmoi add <path> - Bring a new, untracked file under management. Never run this on an already-tracked file (see below).chezmoi re-add <path> - Update the source from a modified plain file. Safe default: it refuses to overwrite templates.chezmoi source-path <path> - Show where a target actually lives in the sourcechezmoi remove <path> - Stop managing a filechezmoi diff - Preview what changes would be appliedchezmoi verify - Check that all files match their targetschezmoi add on a tracked file replaces its source with a static snapshot. If that source was a template or modify_ script, the logic is destroyed, and anything that includes it breaks on every subsequent chezmoi command. Always resolve the source first:
chezmoi source-path <target>
.tmpl, or the basename starts modify_ / create_ / run_ → templated. Edit that source file directly with normal file tools, then chezmoi apply --force <target>.chezmoi re-add <target>.Never edit the target file directly — the next apply overwrites it.
chezmoi edit is unsuitable for agents. It launches $EDITOR and hangs. Edit the path from source-path instead.--force. Without a TTY, prompts fail with could not open a new TTY. Applies to add, apply, forget, re-add.chezmoi cat <target> # rendered output, without applying
chezmoi execute-template < "$(chezmoi source-path <target>)"
Reading the target only shows the last-applied state, which lies if apply failed.If chezmoi add already ate a template, the source repo is a git repo — restore it:
cd "$(chezmoi source-path)" && git status --short
rm <source>/<snapshot-file> && git checkout <source>/<template>.tmpl
chezmoi merge - Merge upstream changes (with conflict resolution)chezmoi archive - Create tarball/zip of managed fileschezmoi import - Import files from tarballs/zipschezmoi export - Export managed files with templates preservedChezmoi uses Go text/template syntax with 70+ built-in functions. Templates are powerful for:
{{ .hostname }} or custom variables to vary configs by machineFiles in ~/.local/share/chezmoi/ (or .chezmoi directory in repo) can be templates:
filename.tmpl → target is filename with template processing.chezmoidata.yaml → defines variables available to all templates.chezmoidata/<machine>.yaml → machine-specific data{{ template "partial" . }} to include template fragments{{ if eq .hostname "work-laptop" }}
# work-specific config
{{ else }}
# personal config
{{ end }}
{{ with bitwarden "item-name" }}
password: {{ .password }}
{{ end }}
{{ include "common-functions" }}
Password Manager Integration (recommended for teams)
chezmoi completion helps set up 1Password, Bitwarden, etc.File Encryption (for repo-based secrets)
age (modern, no dependencies)gpg (widely available)git-crypt (transparent, git-integrated)chezmoi add --encrypt <path>chezmoi edit-encrypted <path>.chezmoiignoreTemplates not rendering
.chezmoidata.yaml for variable definitions{{ variable }}chezmoi execute-template to test templatesFiles not applying
chezmoi status shows what differschezmoi diff previews changeschezmoi verify checks current stateMerge conflicts
chezmoi merge guides you through conflicts~/.local/share/chezmoi/"could not open a new TTY"
--force.Template disappeared after chezmoi add
add snapshots the target over the source. Restore via git in $(chezmoi source-path) and edit the template directly instead.Encryption issues
.chezmoiignore for encryption patternsUse .chezmoidata.yaml to define variables:
hostname: "{{ env "HOSTNAME" }}"
os: "{{ env "OSTYPE" }}"
email: "[email protected]"
Then reference in templates. For machine-specific data:
.chezmoidata/[hostname].yaml{{ include "chezmoidata/" .hostname ".yaml" }}chezmoi init --apply <repo-url>sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply <username>chezmoi updatecd ~/.local/share/chezmoi && git pushchezmoi data - Show variables available to templateschezmoi execute-template <file> - Test template renderingchezmoi managed - List all managed fileschezmoi source-path <target> - Show source file pathchezmoi cat <target> - Display managed file contentschezmoi help <command> - Get help on any commandWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/chezmoi-helper:chezmoi-helperfrom chezmoi-helper
npx claudepluginhub iamshobe/dotfiles --plugin chezmoi-helper