assets/chezmoi.io/docs/user-guide/command-overview.md
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.
chezmoi add $FILE adds $FILEfrom 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 ran chezmoi apply.
chezmoi diff shows the changes that
chezmoi apply would make to your home directory.
chezmoi apply updates your dotfiles from
the source directory.
chezmoi edit --apply $FILE is like
chezmoi edit $FILE but also runs chezmoi apply $FILE afterwards.
chezmoi cd opens a subshell in the source
directory.
sequenceDiagram
participant H as home directory
participant W as working copy
participant L as local repo
participant R as remote repo
H->>W: chezmoi add $FILE
W->>W: chezmoi edit $FILE
W-->>H: chezmoi status
W-->>H: chezmoi diff
W->>H: chezmoi apply
W->>H: chezmoi edit --apply $FILE
H-->>W: chezmoi cd
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 runs
chezmoi apply.
chezmoi update pulls the latest changes
from your remote repo and runs chezmoi apply.
Use normal git commands to add, commit, and push changes to your remote repo.
sequenceDiagram
participant H as home directory
participant W as working copy
participant L as local repo
participant R as remote repo
R->>W: chezmoi init $GITHUB_USERNAME
R->>H: chezmoi init --apply $GITHUB_USERNAME
R->>H: chezmoi update $GITHUB_USERNAME
W->>L: git commit
L->>R: git push
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.