upgrade command upgrades chezmoi to the latest released version from GitHub.
Usage
Description
Theupgrade command automatically downloads and installs the latest stable version of chezmoi from the official GitHub releases. The upgrade method is automatically detected based on how chezmoi was installed.
After upgrading, the new chezmoi version is executed with the --version flag to verify the upgrade was successful.
Upgrade Methods
chezmoi automatically detects the appropriate upgrade method:- replace-executable: Direct binary replacement (most common)
- brew-upgrade: Homebrew on macOS/Linux
- snap-refresh: Snap on Linux
- winget-upgrade: Windows Package Manager
- upgrade-package: Package manager on Linux (APT, DNF, etc.)
chezmoi doctor to see which upgrade method will be used.
Flags
Path to the executable to replace. By default, uses the currently running chezmoi executable.
Force a specific upgrade method. Options:
replace-executable, brew-upgrade, snap-refresh, winget-upgrade, upgrade-package. If not specified, the method is automatically detected.Examples
Upgrade to latest version
Force upgrade even if already on latest version
Upgrade with specific method
Check what method will be used
Terminal Output
Successful upgrade
Already on latest version
Forced upgrade
Platform-Specific Behavior
Linux
On Linux, chezmoi determines whether to use:- glibc or musl builds (for x86_64)
- Package managers (if installed via APT, DNF, etc.)
- Snap (if installed via Snap)
- Direct binary replacement
macOS
On macOS:- Uses Homebrew if chezmoi was installed via
brew - Otherwise replaces the binary directly
Windows
On Windows:- Uses WinGet if available
- Otherwise downloads and replaces the
.exefile - The old executable is renamed to
chezmoi.exe.old
Automation
Automatic updates with cron
Systemd timer
Upgrade notification script
Troubleshooting
Permission denied
If you get a permission error:Cannot determine upgrade method
Network errors
If GitHub is unreachable:Dev version warning
--force:
Manual Upgrade
If automatic upgrade fails, manually download from GitHub:Upgrade via Package Managers
Homebrew
Snap
APT (Ubuntu/Debian)
If installed from PPA:Pacman (Arch Linux)
Scoop (Windows)
Downgrading
If you need to downgrade:Checking for Updates
Check current version
Check latest version
Compare versions
Related Commands
- doctor - Check upgrade method and version