Command overview
Getting started
-
chezmoi doctor
checks for common problems. If you encounter something unexpected, run this first. -
chezmoi init
creates chezmoi's source directory and a git repo on a new machine.
Daily commands
-
chezmoi add $FILE
adds$FILE
from your home directory to the source directory. -
chezmoi edit $FILE
opens your editor with the file in the source directory that corresponds to$FILE
. -
chezmoi status
gives a quick summary of what files would change if you ranchezmoi apply
. -
chezmoi diff
shows the changes thatchezmoi apply
would make to your home directory. -
chezmoi apply
updates your dotfiles from the source directory. -
chezmoi edit --apply $FILE
is likechezmoi edit $FILE
but also runschezmoi apply $FILE
afterwards. -
chezmoi cd
opens a subshell in the source directory.
Using chezmoi across multiple machines
-
chezmoi init $GITHUB_USERNAME
clones your dotfiles from GitHub into the source directory. -
chezmoi init --apply $GITHUB_USERNAME
clones your dotfiles from GitHub into the source directory and runschezmoi apply
. -
chezmoi update
pulls the latest changes from your remote repo and runschezmoi apply
. -
Use normal git commands to add, commit, and push changes to your remote repo.
Working with templates
-
chezmoi data
prints the available template data. -
chezmoi add --template $FILE
adds$FILE
as a template. -
chezmoi chattr +template $FILE
makes an existing file a template. -
chezmoi cat $FILE
prints the target contents of$FILE
, without changing$FILE
. -
chezmoi execute-template
is useful for testing and debugging templates.