completion command generates shell completion scripts for bash, fish, PowerShell, and zsh.
Usage
Description
Shell completion provides command-line suggestions and auto-completion for chezmoi commands, flags, and file paths. Thecompletion command generates the appropriate completion script for your shell.
Supported Shells
bash- Bash completionfish- Fish completionpowershell- PowerShell completionzsh- Zsh completion
Examples
Bash
One-time setup:.bashrc:
Zsh
One-time setup:.zshrc:
Fish
One-time setup:PowerShell
Add to profile:Platform-Specific Instructions
macOS
Bash (via Homebrew):Linux
Debian/Ubuntu (bash):Windows
PowerShell:Testing Completion
After installation, test the completion:Features
Command completion
Flag completion
File path completion
Subcommand completion
Troubleshooting
Completion not working (bash)
Ensure bash-completion is installed:Completion not working (zsh)
Ensure compinit is loaded:Completion not working (fish)
Check completion file location:Permission denied
If installing system-wide:Updating Completions
After upgrading chezmoi, regenerate completions:Related Commands
- init - Initialize chezmoi