CtrlK
BlogDocsLog inGet started
Tessl Logo

pantheon-ai/chezmoi

Expert assistant for chezmoi dotfiles management. Use when: "add this file to chezmoi", "make this a template", "encrypt this secret", "apply on a new machine", "run script only once", "manage dotfiles across machines". Examples: - user: "Track my .zshrc with chezmoi" → chezmoi add ~/.zshrc - user: "Make my .gitconfig machine-specific" → convert to .tmpl, use {{ .chezmoi.hostname }} - user: "Run a script only on first apply" → once_ prefix - user: "Sync to a new laptop" → chezmoi init --apply $GITHUB_USERNAME - user: "Why isn't my file being applied?" → diagnose source attribute, diff, doctor

96

Quality

96%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

source-attrs.mdchezmoi-assistant/references/

Source State Attributes

File Prefixes (in order)

PrefixEffect
after_Run script after updating the destination
before_Run script before updating the destination
create_Ensure file exists; create with contents if absent (never overwrites)
dot_Rename to use a leading dot — dot_foo.foo
empty_Ensure file exists even if empty (by default empty files are removed)
encrypted_Encrypt file in source state; decrypt on apply
exact_Remove anything in the target dir not managed by chezmoi
executable_Add executable permissions to target
external_Ignore attributes in child entries
literal_Stop parsing further prefix attributes
modify_Treat contents as a script that modifies an existing file (receives current file on stdin)
once_Only run the script if its contents have never run before
onchange_Only run if content has changed since last run
private_Remove all group and world permissions (chmod 600/700)
readonly_Remove all write permissions
remove_Remove the file/symlink/empty-dir if it exists
run_Treat contents as a script to run (not copied to target)
symlink_Create a symlink instead of a regular file

File Suffixes

SuffixEffect
.tmplRender contents as a Go template before applying
.literalStop parsing further suffix attributes

Ordering Rules by Target Type

Target typeAllowed prefixes (in order)Allowed suffixes
Directoryremove_, external_, exact_, private_, readonly_, dot_none
Regular fileencrypted_, private_, readonly_, empty_, executable_, dot_.tmpl
Create filecreate_, encrypted_, private_, readonly_, empty_, executable_, dot_.tmpl
Modify filemodify_, encrypted_, private_, readonly_, executable_, dot_.tmpl
Remove fileremove_, dot_none
Scriptrun_, then once_ or onchange_, then before_ or after_.tmpl
Symlinksymlink_, dot_.tmpl

Common Examples

dot_zshrc                          → ~/.zshrc
dot_zshrc.tmpl                     → ~/.zshrc  (template rendered)
private_dot_ssh/                   → ~/.ssh/   (mode 700)
executable_dot_local/bin/my-script → ~/.local/bin/my-script  (chmod +x)
encrypted_private_dot_netrc        → ~/.netrc  (encrypted + chmod 600)
run_once_before_install-homebrew.sh → executed once before apply
run_onchange_after_reload-launchd.sh → executed when script changes
exact_dot_config/fish/             → ~/.config/fish/ (removes unmanaged files)
create_dot_hushlogin               → ~/.hushlogin  (created if absent, never overwritten)

Changing Attributes

Use chezmoi chattr — do not rename files manually:

chezmoi chattr +template ~/.zshrc       # add .tmpl suffix
chezmoi chattr +encrypted ~/.netrc      # add encrypted_ prefix
chezmoi chattr +executable ~/.local/bin/myscript
chezmoi chattr -private ~/.config/some/file

chezmoi-assistant

SKILL.md

tile.json