| name | dotfile-sync |
| description | Manage dotfiles with symlinks from a central git repository. Use when tracking config files, syncing dotfiles between machines, or bootstrapping a new machine. Triggers include "dotfiles", "sync config", "dfs", "track dotfiles", "symlink config", "new machine setup". |
dotfile-sync
CLI tool for tracking and syncing dotfiles via a git-backed symlink repository.
Quick Start
dfs init --remote git@github.com:user/dotfiles.git
dfs add ~/.zshrc
dfs add ~/.gitconfig
dfs push
dfs init --clone git@github.com:user/dotfiles.git
dfs link
Track Files
dfs add ~/.zshrc
dfs add ~/.config/nvim/init.lua
dfs add ~/.config/work/config --profile work-mac
List and Status
dfs list
dfs status
Status symbols:
ok - file is correctly symlinked
* - file needs linking (unlinked)
x - conflict (file exists but is not a repo symlink)
? - missing (symlink target not in repo)
Link and Unlink
dfs link
dfs link --force
dfs link ~/.zshrc
dfs unlink
Sync with Remote
dfs push
dfs push --message "add nvim config"
dfs pull
dfs diff
dfs diff ~/.zshrc
Machine Profiles
Profiles group files for specific machines:
dfs profile list
dfs profile create work-mac
dfs profile add work-mac ~/.config/work
dfs profile apply work-mac
The common profile includes all files with no profile assignment (linked on all machines).
Bootstrap New Machine
dfs init --clone git@github.com:user/dotfiles.git
dfs link
dfs init --clone git@github.com:user/dotfiles.git --profile home-linux
Remove Tracking
dfs remove ~/.zshrc
CLI Reference
| Command | Description |
|---|
init | Initialize dotfiles repo |
add <file> | Track a file |
remove <file> | Stop tracking a file |
list | List tracked files with status |
status | Overall sync status |
link [file] | Create symlinks |
unlink [file] | Remove symlinks |
push | Commit and push changes |
pull | Pull and re-link |
diff [file] | Show uncommitted changes |
profile | Manage machine profiles |
Environment Variables
| Variable | Default | Description |
|---|
DFS_REPO_PATH | ~/dotfiles | Dotfiles repository path |
DFS_NO_COLOR | 0 | Disable ANSI color (1 to disable) |
DFS_DEBUG | 0 | Enable debug logging (1 to enable) |
Exit Codes
| Code | Meaning |
|---|
| 0 | Success |
| 1 | File not tracked |
| 2 | Conflict (file exists, not a symlink) |
| 3 | Runtime error |