← 返回命令列表

Linux command

chezmoi 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Initialize

chezmoi init

Add

chezmoi add [~/.bashrc]

Apply

chezmoi apply

Edit

chezmoi edit [~/.bashrc]

Update

chezmoi update

Show

chezmoi diff

说明

chezmoi manages dotfiles across multiple machines. It uses a source directory (typically a git repository at ~/.local/share/chezmoi) to store the desired state of dotfiles, then applies that state to the home directory. The tool supports Go templates for machine-specific configurations, allowing a single source repository to produce different files on different machines based on hostname, OS, or custom data. Secrets can be managed through integrations with password managers like 1Password, Bitwarden, and pass, or via encrypted files using age or gpg. Unlike symlink-based managers like GNU Stow, chezmoi copies files to their destinations, meaning the target files are ordinary files that work with any tool.

参数

init _repo_
Initialize chezmoi
add _target_
Add file to source state
apply _target_
Apply changes to destination
edit _target_
Edit source state
update
Pull and apply changes
diff _target_
Show differences
cd
Open shell in source directory
data
Show template data

FAQ

What is the chezmoi command used for?

chezmoi manages dotfiles across multiple machines. It uses a source directory (typically a git repository at ~/.local/share/chezmoi) to store the desired state of dotfiles, then applies that state to the home directory. The tool supports Go templates for machine-specific configurations, allowing a single source repository to produce different files on different machines based on hostname, OS, or custom data. Secrets can be managed through integrations with password managers like 1Password, Bitwarden, and pass, or via encrypted files using age or gpg. Unlike symlink-based managers like GNU Stow, chezmoi copies files to their destinations, meaning the target files are ordinary files that work with any tool.

How do I run a basic chezmoi example?

Run `chezmoi init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init _repo_ do in chezmoi?

Initialize chezmoi