← All posts

CLI

chezmoi: Manage Your Dotfiles Across Every Machine

chezmoi manages your dotfiles across machines with templating, secrets, and git - your config, reproducible anywhere.

C CLI

Everyone's shell, editor, and tool configs represent hours of accumulated tuning, and moving them to a new machine is usually a manual, error-prone copy job. chezmoi makes your dotfiles reproducible. It manages them in a git repository with real templating and secret handling, so you can set up a brand-new machine's entire configuration with one command - and keep every machine in sync as you tweak things.

Your Config as Code

You add files to chezmoi, commit them, and apply them anywhere:

# Start managing a dotfile chezmoi add ~/.bashrc # On a new machine, pull and apply everything chezmoi init --apply https://github.com/you/dotfiles.git

Templating and Secrets

The killer feature is that dotfiles can be templates: the same source produces machine-specific output (a different git email at work, a different path on macOS versus Linux), and secrets can be pulled from a password manager at apply time rather than committed. That's what makes one dotfiles repo work across genuinely different environments.

Rough Edges and Limitations

  • Concepts to learn. Source state, target state, and templates take a little reading up front.
  • Setup investment. Migrating existing dotfiles into it is a one-time effort.
  • Overkill for one machine. The payoff comes with multiple machines or a rebuild.

The first time you provision a fresh machine to feel exactly like home with a single command, the setup cost pays for itself.

Internal link suggestion: link "shell ... configs" to the Starship post, whose prompt config is exactly the kind of dotfile chezmoi keeps in sync.