A TypeScript-based dotfiles manager for syncing configuration files across macOS machines.
This tool helps you:
- Back up dotfiles to a git repository
- Sync dotfiles across multiple machines
- Manage symlinks automatically
- Deno 2 (optional, only needed for development)
- Git
-
On your first machine (where you have existing dotfiles):
# Clone this repo git clone <your-repo-url> ~/.dotfiles cd ~/.dotfiles # Copy existing dotfiles and create symlinks ./dotfiles copy # Commit and push git add . git commit -m "Initial dotfiles backup" git push
-
On additional machines:
# Clone the repo git clone <your-repo-url> ~/.dotfiles cd ~/.dotfiles # Create symlinks to dotfiles ./dotfiles link
Copies dotfiles from your home directory to ~/.dotfiles and creates symlinks.
./dotfiles copyUse this for:
- Initial setup on your first machine
- Adding new dotfiles to track
Creates symlinks from your home directory to files in ~/.dotfiles.
./dotfiles linkUse this for:
- Setting up a new machine after cloning the repo
- Restoring symlinks if they get broken
Pulls and pushes changes to/from the git repository.
./dotfiles syncUse this for:
- Syncing changes between machines
- After manually editing dotfiles
The managed dotfiles are defined in dotfiles.ts:
const DEFAULT_CONFIG: DotfilesConfig = {
dotfiles_dir: `${Deno.env.get("HOME")}/.dotfiles`,
paths: [
".gitconfig",
".zshrc",
".claude",
".vscode",
".nvm",
],
ignore_patterns: [
".DS_Store",
"node_modules",
"*.log",
"cache",
"tmp",
"*.swp",
],
};To add more dotfiles, edit the DEFAULT_CONFIG and recompile.
The following patterns are automatically excluded:
.DS_Storenode_modules*.logcachetmp*.swp
If you modify dotfiles.ts, recompile the binary:
deno compile \
--allow-read \
--allow-write \
--allow-run \
--allow-env \
--output dotfiles \
dotfiles.tsThen commit the updated binary.
# Edit your dotfiles normally
vim ~/.zshrc
# Sync when ready
cd ~/.dotfiles
./dotfiles sync# Pull changes
cd ~/.dotfiles
./dotfiles sync
# Your ~/.zshrc is automatically updated (via symlink)If you see "Error: file already exists", manually resolve the conflict:
# Check what exists
ls -la ~/.<file>
# Back it up if needed
mv ~/.<file> ~/.<file>.backup
# Try again
./dotfiles linkRe-run the link command:
./dotfiles linkHandle manually:
cd ~/.dotfiles
git status
# resolve conflicts
git add .
git commit
./dotfiles syncMIT