一键导入
chezmoi-workflow
Guide for working with chezmoi dotfiles - file naming, templates, and apply workflow. Use when editing files in this dotfiles repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for working with chezmoi dotfiles - file naming, templates, and apply workflow. Use when editing files in this dotfiles repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | chezmoi-workflow |
| description | Guide for working with chezmoi dotfiles - file naming, templates, and apply workflow. Use when editing files in this dotfiles repository. |
| user-invocable | false |
When editing files in this repository, follow these rules:
New dotfiles must use chezmoi prefixes:
| Prefix | Effect | Example |
|---|---|---|
dot_ | Adds leading . | dot_bashrc -> ~/.bashrc |
private_ | chmod 600 | private_dot_ssh -> ~/.ssh (restricted) |
executable_ | chmod +x | executable_script.sh -> script.sh (executable) |
symlink_ | Creates symlink | symlink_dotfile -> symlink to target |
.tmpl suffix | Go template processing | dot_bashrc.tmpl -> ~/.bashrc (templated) |
run_once_ | One-time script | Runs once on chezmoi apply |
run_onchange_ | Change-triggered script | Runs when content hash changes |
Prefixes can be combined: private_dot_config -> ~/.config with restricted permissions.
Available in .tmpl files (verify with chezmoi data):
| Variable | Value |
|---|---|
{{ .chezmoi.os }} | linux, darwin, windows |
{{ .chezmoi.arch }} | amd64, arm64 |
{{ .chezmoi.homeDir }} | Home directory path |
{{ .chezmoi.sourceDir }} | Source directory path |
{{ .name }} | "Tyler Butler" |
{{ .email }} | "tyler@tylerbutler.com" |
{{ .codespaces }} | Boolean for GitHub Codespaces |
{{ .use_rbw }} | Boolean for Bitwarden availability |
Template functions: All Go template functions plus Sprig functions.
Shared templates: .chezmoitemplates/ directory, include via {{ template "name.tmpl" . }}.
Add new aliases to dot_aliae.yaml, NOT to shell rc files.
Use aliae template syntax for cross-platform values:
{{ .Home }} instead of ~ or $HOME{{ .OS }} for OS detection{{ if eq .OS "darwin" }}mac-command{{ else }}linux-command{{ end }} for conditionalsAfter any change, verify before applying:
chezmoi diff - preview what would changechezmoi apply --dry-run --verbose - test full applychezmoi execute-template < file.tmplAdd new packages to the correct platform-specific file:
| File | Platform |
|---|---|
Brewfile | macOS (Homebrew) |
dot_default-apt | Ubuntu/Debian |
dot_default-cargo-crates | Rust (cross-platform) |
dot_default-eget | Binary downloads (cross-platform) |
dot_default-nix-packages | NixOS |
dot_default-pacman-packages | Arch Linux |
dot_default-chocolatey-packages.config | Windows |
dot_default-scoop-packages | Windows (Scoop) |
Use .chezmoiignore for OS-specific file exclusion:
{{ if ne .chezmoi.os "darwin" }}
Brewfile
{{ end }}
~/ (they'll be overwritten by chezmoi apply)mv or cp commands (they prompt for confirmation in this environment)dot_aliae.yaml instead)