Skip to main content

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)

CommandLevel
chezmoi init
Initialize chezmoi working directory, optionally from a GitHub repo
Basic
chezmoi init --apply
Initialize and immediately apply dotfiles to the system
Basic
chezmoi upgrade
Upgrade chezmoi to the latest version
Basic
chezmoi doctor
Check system configuration and environment compatibility
Basic

Basic Usage(6)

CommandLevel
chezmoi add
Add an existing dotfile to chezmoi management
Basic
chezmoi apply
Apply changes from chezmoi source to the system
Basic
chezmoi diff
Preview differences between source and target files
Basic
chezmoi status
Show change status of all managed files
Basic
chezmoi verify
Verify that target files match source files
Basic
chezmoi update
Pull latest changes from remote and apply
Intermediate

Dotfile Management(11)

CommandLevel
chezmoi edit
Edit a dotfile in the source directory
Basic
chezmoi remove
Remove a file from chezmoi management
Basic
chezmoi forget
Stop tracking a file without removing the target
Intermediate
chezmoi re-add
Regenerate source file from current target file
Intermediate
chezmoi chdir
Change to chezmoi source directory and run commands
Intermediate
chezmoi cd
Quickly jump to the chezmoi source directory
Basic
chezmoi git
Run a Git command directly in the source directory
Intermediate
chezmoi merge
Interactively merge conflicts between source and target
Expert
chezmoi unmanaged
List files in the target directory not managed by chezmoi
Intermediate
chezmoi state
View chezmoi's persistent state
Intermediate
chezmoi data
View template data (evaluated result)
Intermediate

Templates(4)

CommandLevel
chezmoi template
Execute a template rendering test
Intermediate
chezmoi dump
View the actual rendered content of a template file
Intermediate
.chezmoi.toml.tmpl
Main chezmoi config file (template format), defines template variables
Intermediate
.chezmoiexternal.toml
Configure external file sources (e.g., download from GitHub)
Expert

Advanced(3)

CommandLevel
chezmoi import
Import dotfiles from an archive file
Expert
chezmoi secret
Manage and retrieve secrets (supports Bitwarden, pass, Keychain, etc.)
Expert
chezmoi agekey
Display or generate Age encryption keys
Expert

FAQ

This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-20.