Design Philosophy
chezmoi follows these principles for composability:- Semantic versioning: The command line tool follows semantic versioning, ensuring stable APIs
- Standard I/O: Commands work with standard input, output, and error streams
- Exit codes: Proper exit codes for success and failure conditions
- Scriptability: All functionality is accessible via the command line
Integration Approaches
Command-Line Execution
The recommended approach is to execute thechezmoi binary with appropriate arguments:
Inspecting Internal State
chezmoi provides commands to inspect its internal state:chezmoi dump
Dump chezmoi’s computed state in JSON format:
- Understanding what chezmoi will do
- Debugging template evaluation
- Building tools that need to understand chezmoi’s state
chezmoi state
Manage and inspect chezmoi’s persistent state:
Best Practices
Standard I/O Configuration
When executing chezmoi, configure standard input and output appropriately:Error Handling
Always check exit codes and handle errors appropriately:Version Compatibility
Check the chezmoi version to ensure compatibility:Example Integrations
See the Related Software page for examples of tools built on top of chezmoi, including:- Editor integrations (Vim, NeoVim, Emacs)
- UI tools
- Automation scripts
- Package manager plugins
See Also
- Architecture - Understanding chezmoi’s internal structure
- Related Software - Examples of existing integrations