chezmoi Cheatsheet
chezmoi is a powerful dotfile manager. Store your dotfiles in Git, use Go templates for cross-platform configs, with built-in secret management, encryption, and automatic install.
Updated: 2026-07-20·28 commands
Quick Start
``bash
chezmoi init https://github.com/$GITHUB_USER/dotfiles.git # Init from repo
chezmoi add ~/.bashrc # Add a dotfile
chezmoi edit ~/.bashrc # Edit in source
chezmoi diff # Preview changes
chezmoi apply # Apply to system
chezmoi update # Pull & apply
``
Install & Init(4)
| Command | Level | ||
|---|---|---|---|
chezmoi initInitialize chezmoi working directory, optionally from a GitHub repo | Basic | chezmoi init https://github.com/$GITHUB_USER/dotfiles.git | |
chezmoi init --applyInitialize and immediately apply dotfiles to the system | Basic | chezmoi init --apply https://github.com/$GITHUB_USER/dotfiles.git | |
chezmoi upgradeUpgrade chezmoi to the latest version | Basic | chezmoi upgrade | |
chezmoi doctorCheck system configuration and environment compatibility | Basic | chezmoi doctor |
Basic Usage(6)
| Command | Level | ||
|---|---|---|---|
chezmoi addAdd an existing dotfile to chezmoi management | Basic | chezmoi add ~/.bashrc | |
chezmoi applyApply changes from chezmoi source to the system | Basic | chezmoi apply | |
chezmoi diffPreview differences between source and target files | Basic | chezmoi diff | |
chezmoi statusShow change status of all managed files | Basic | chezmoi status | |
chezmoi verifyVerify that target files match source files | Basic | chezmoi verify | |
chezmoi updatePull latest changes from remote and apply | Intermediate | chezmoi update |
Dotfile Management(11)
| Command | Level | ||
|---|---|---|---|
chezmoi editEdit a dotfile in the source directory | Basic | chezmoi edit ~/.bashrc | |
chezmoi removeRemove a file from chezmoi management | Basic | chezmoi remove ~/.bashrc | |
chezmoi forgetStop tracking a file without removing the target | Intermediate | chezmoi forget ~/.bashrc | |
chezmoi re-addRegenerate source file from current target file | Intermediate | chezmoi re-add ~/.bashrc | |
chezmoi chdirChange to chezmoi source directory and run commands | Intermediate | chezmoi chdir -- git status | |
chezmoi cdQuickly jump to the chezmoi source directory | Basic | chezmoi cd | |
chezmoi gitRun a Git command directly in the source directory | Intermediate | chezmoi git -- add . && chezmoi git -- commit -m 'Update' | |
chezmoi mergeInteractively merge conflicts between source and target | Expert | chezmoi merge ~/.bashrc | |
chezmoi unmanagedList files in the target directory not managed by chezmoi | Intermediate | chezmoi unmanaged | |
chezmoi stateView chezmoi's persistent state | Intermediate | chezmoi state dump | |
chezmoi dataView template data (evaluated result) | Intermediate | chezmoi data |
Templates(4)
| Command | Level | ||
|---|---|---|---|
chezmoi templateExecute a template rendering test | Intermediate | chezmoi template '{{ .chezmoi.os }}' | |
chezmoi dumpView the actual rendered content of a template file | Intermediate | chezmoi dump ~/.bashrc | |
.chezmoi.toml.tmplMain chezmoi config file (template format), defines template variables | Intermediate | vim ~/.local/share/chezmoi/.chezmoi.toml.tmpl | |
.chezmoiexternal.tomlConfigure external file sources (e.g., download from GitHub) | Expert | vim ~/.local/share/chezmoi/.chezmoiexternal.toml |
Advanced(3)
| Command | Level | ||
|---|---|---|---|
chezmoi importImport dotfiles from an archive file | Expert | chezmoi import --tar archive.tar.gz | |
chezmoi secretManage and retrieve secrets (supports Bitwarden, pass, Keychain, etc.) | Expert | chezmoi secret bitwarden get item my-item | |
chezmoi agekeyDisplay or generate Age encryption keys | Expert | chezmoi agekey |
FAQ
This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-20.