Expert assistant for chezmoi dotfiles management. Use when: "add this file to chezmoi", "make this a template", "encrypt this secret", "apply on a new machine", "run script only once", "manage dotfiles across machines". Examples: - user: "Track my .zshrc with chezmoi" → chezmoi add ~/.zshrc - user: "Make my .gitconfig machine-specific" → convert to .tmpl, use {{ .chezmoi.hostname }} - user: "Run a script only on first apply" → once_ prefix - user: "Sync to a new laptop" → chezmoi init --apply $GITHUB_USERNAME - user: "Why isn't my file being applied?" → diagnose source attribute, diff, doctor
96
96%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Advisory
Suggest reviewing before use
Complete specification for chezmoi external dependencies. Externals allow you to include files, archives, and Git repositories from external sources in your dotfiles.
Externals are defined in:
home/.chezmoiexternal.<format> (single file for all externals)home/.chezmoiexternals/*.toml[.tmpl] (organized by program)Files in .chezmoiexternals/ are automatically treated as external definitions relative to the source directory.
Clones or updates a Git repository to a target directory.
Best for: Plugin managers, frameworks, complete configurations
Required fields:
type = "git-repo"url - Repository URL (HTTPS or SSH)Optional fields:
revision - Specific commit SHA, tag, or branch (CRITICAL: always use commit SHA)clone.args - Additional git clone argumentspull.args - Additional git pull argumentsrefreshPeriod - How often to check for updates (e.g., "168h")Example:
[".zsh/plugins/zsh-autosuggestions"]
type = "git-repo"
url = "https://github.com/zsh-users/zsh-autosuggestions.git"
revision = "85919cd1ffa7d2d5412f6d3fe437ebdbeeec4fc5" # Pin to SHA
refreshPeriod = "168h" # Update weeklySecurity: Always pin revision to a commit SHA for reproducibility.
Downloads a single file from a URL.
Best for: Configuration files, themes, single scripts
Required fields:
type = "file"url or urls - Download location(s)Optional fields:
executable - Make file executable (boolean)checksum - SHA-256/384/512 hash for verificationrefreshPeriod - How often to re-downloadencrypted - Handle encrypted content (boolean)Example:
[".config/bat/themes/Catppuccin-mocha.tmTheme"]
type = "file"
url = "https://github.com/catppuccin/bat/raw/6810349b28055dce54076712fc05fc68da4b8ec0/themes/Catppuccin%20Mocha.tmTheme"
refreshPeriod = "168h"With checksum:
[".local/bin/tool"]
type = "file"
url = "https://example.com/releases/v1.0.0/tool"
executable = true
checksum = "sha256:abc123def456..."Security: Use commit SHA in URL path for GitHub files.
Extracts a specific file from an archive (tar.gz, zip, etc.).
Best for: Release binaries, single files within archives
Required fields:
type = "archive-file"url or urls - Archive download locationpath - Path to file within archiveOptional fields:
executable - Make extracted file executablechecksum - Archive checksum verificationrefreshPeriod - Update frequencyExample:
[".local/bin/zellij"]
type = "archive-file"
url = "https://github.com/zellij-org/zellij/releases/download/v0.40.0/zellij-x86_64-apple-darwin.tar.gz"
executable = true
path = "zellij"
checksum = "sha256:1234567890abcdef..."
refreshPeriod = "168h"Security: Always include checksum for release binaries.
Extracts an entire archive into a target directory.
Best for: Complete directory structures, multi-file configurations
Required fields:
type = "archive"url or urls - Archive download locationOptional fields:
exact - Remove files not in archive (boolean)stripComponents - Strip leading path components (integer)include - Only extract matching patterns (array)exclude - Skip matching patterns (array)format - Force specific archive formatchecksum - Archive verificationrefreshPeriod - Update frequencyExample - Full directory:
[".oh-my-zsh"]
type = "archive"
url = "https://github.com/ohmyzsh/ohmyzsh/archive/abc123def456.tar.gz"
exact = true
stripComponents = 1
refreshPeriod = "168h"Security: Use commit SHA in URL for GitHub archives.
# Single URL
url = "https://github.com/user/repo/archive/sha.tar.gz"
# Multiple URLs (tries in order)
urls = [
"https://cdn.example.com/file.tar.gz",
"https://github.com/user/repo/releases/download/v1.0.0/file.tar.gz",
]checksum = "sha256:abc123def456..."
checksum = "sha384:abc123def456..."
checksum = "sha512:abc123def456..."Generate checksum:
curl -fsSL <url> | shasum -a 256refreshPeriod = "24h" # Daily
refreshPeriod = "168h" # Weekly (recommended for most externals)
refreshPeriod = "720h" # Monthlyrevision# CORRECT
revision = "abc123def456..." # 40-character SHA
# WRONG - mutable reference
revision = "main"# CORRECT
url = "https://github.com/user/repo/raw/abc123def456.../file.ext"
# WRONG
url = "https://github.com/user/repo/raw/main/file.ext"# CORRECT
url = "https://github.com/user/tool/releases/download/v1.2.3/tool.tar.gz"
checksum = "sha256:abc123..."
# WRONG
url = "https://github.com/user/tool/releases/download/latest/tool.tar.gz"{{ if eq .chezmoi.os "darwin" }}
[".config/tool-mac"]
type = "file"
url = "https://example.com/tool-mac"
{{ else if eq .chezmoi.os "linux" }}
[".config/tool-linux"]
type = "file"
url = "https://example.com/tool-linux"
{{ end }}{{ if lookPath "zsh" }}
[".zsh/plugins/plugin"]
type = "git-repo"
url = "https://github.com/user/plugin.git"
{{ end }}{{ $arch := .chezmoi.arch -}}
[".local/bin/tool"]
type = "archive-file"
url = "https://github.com/user/tool/releases/download/v1.0.0/tool-{{ .chezmoi.os }}-{{ $arch }}.tar.gz"
executable = true
path = "tool"Chezmoi automatically detects: .tar.gz, .tgz, .tar.bz2, .tar.xz, .tar.zst, .zip
Force specific format:
format = "tar.gz"# Archive structure: repo-abc123/config/file.conf
[".config/tool"]
type = "archive"
url = "https://github.com/user/repo/archive/abc123.tar.gz"
stripComponents = 1 # Removes "repo-abc123/" prefix[".config/tool"]
type = "archive"
url = "..."
include = ["config/**", "themes/*.json"]
exclude = ["**/*.md", "docs/**"]{{ if lookPath "tool" }} to skip on missing dependenciescurl -fsSL <url> -o /tmp/test-download
gh api repos/USER/REPO/commits/SHA
chezmoi apply -vcurl -fsSL <url> | shasum -a 256
# Update checksum in external definitionchezmoi cat home/.chezmoiexternals/program.externals.toml
chezmoi data