chezmoi

Automate dotfiles management with Chezmoi templates and secret handling.

3|Updated May 18, 2019
One-click install
npx skills add https://github.com/barnabasJ/dotfiles --skill chezmoi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chezmoi
Source: https://github.com/barnabasJ/dotfiles/tree/main/agents/skills/chezmoi
Command: npx skills add https://github.com/barnabasJ/dotfiles --skill chezmoi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires chezmoi, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive expertise in managing dotfiles with chezmoi, solving the problem of inconsistent configurations across multiple machines. It simplifies cross-platform setup, templating, and secret management, ensuring your development environment is always consistent and up-to-date.

Core Features & Use Cases

  • Cross-Platform Configuration: Use Go templating with chezmoi variables (.chezmoi.os, .chezmoi.hostname) to create dynamic dotfiles that adapt to different operating systems and machines.
  • Secret Management: Securely manage sensitive data like API keys and GPG keys by integrating with password managers (Bitwarden, 1Password) or using age/gpg encryption.
  • Automated Setup Scripts: Define run_onchange_ scripts to automatically install packages (e.g., Homebrew bundles, apt-get packages) and configure external tools, ensuring idempotency.
  • Use Case: Set up a new development machine by simply running chezmoi init and chezmoi apply. This skill ensures all your dotfiles, configurations, and essential packages are installed and configured automatically, saving hours of manual setup.

Quick Start

Use the chezmoi skill to explain how to use dot_zshrc.tmpl to create a templated ~/.zshrc file and include a conditional block for macOS-specific settings.

Frequently Asked Questions about chezmoi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage dotfiles consistently across multiple machines?

Dotfile management ensures consistent configurations across machines using a single source of truth. Chezmoi automates this by version-controlling your dotfiles and applying them across platforms with templating, secret encryption, and platform-specific logic, eliminating manual sync errors.

Can I use Go templates to create platform-specific dotfile configurations?

Yes. Chezmoi supports Go templating with built-in variables like `.chezmoi.os` and `.chezmoi.hostname`, letting you write conditional blocks within templated files (`.tmpl`) that adapt to macOS, Linux, or specific machines automatically.

How do I securely store API keys and secrets in my dotfiles?

Secret management in chezmoi integrates with password managers (Bitwarden, 1Password) or encryption tools (age, gpg) to encrypt sensitive data directly in your dotfile repository, keeping secrets secure while maintaining version control and cross-platform deployment.

Can dotfile automation install packages and run setup scripts automatically?

Yes. Chezmoi supports `run_onchange_` scripts that execute idempotently during apply, automating package installation (Homebrew, apt-get) and tool configuration across your machines without manual intervention on each setup.

What's the best way to set up a new development machine quickly?

Running `chezmoi init` and `chezmoi apply` automates new-machine setup by deploying all dotfiles, configurations, and installation scripts in one operation, reducing manual setup time from hours to minutes across all your machines.

Does chezmoi work across Windows, macOS, and Linux?

Yes. Chezmoi is cross-platform, supporting Windows, macOS, and Linux. Go templating and naming conventions (prefix/suffix) let you define OS-specific configurations in a single repository and apply them correctly on each platform.