@ariian/dtm
v1.2.4
Published
Dotfile Time Machine — automated dotfile snapshots with GitHub backup
Maintainers
Readme
🕰️ dtm
Dotfile Time Machine. Automatically snapshots your config files and pushes them to a private GitHub repo on a schedule.
DTM came from the frustration of tweaking dotfiles or config files, accidentally breaking things weeks later, and having no idea what changed. The goal was to create something simple that quietly backs up your files to GitHub on a schedule, makes it easy to track changes over time, and lets you roll back any file to a previous version whenever needed.
Install
npm install -g @ariian/dtmSetup
dtm initYou'll be prompted for:
? GitHub repo URL (SSH or HTTPS): [email protected]:you/dotfiles-backup.git
? How often should snapshots run? Once a day
? Auto-push to GitHub after every snapshot? Yes
? Select dotfiles to track: ~/.zshrc, ~/.gitconfigCreate a private GitHub repo before running dtm init.
GitHub Connection
SSH (recommended)
Use an SSH URL when prompted:
[email protected]:you/dotfiles-backup.gitMake sure your SSH key is added to your macOS Keychain so pushes work silently in the background:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519Test it:
ssh -T [email protected]
# Hi you! You've successfully authenticated.HTTPS
Use an HTTPS URL when prompted:
https://github.com/you/dotfiles-backup.gitStore your GitHub Personal Access Token in macOS Keychain:
git config --global credential.helper osxkeychainHow it works
1. you run → dtm snapshot
2. dtm copies → your tracked dotfiles into ~/.dtm/
3. dtm commits → git commit -m "snapshot 2026-05-23 22:00:00"
4. dtm pushes → git push origin main
5. done → ✔ snapshot saved and pushed to GitHubOn a schedule, this runs automatically via macOS launchd.
Upgrading from v1.1.x
v1.2.0 changed how files are stored inside ~/.dtm/ — nested files now mirror their original directory structure (e.g. ~/.ssh/config is stored as .ssh/config instead of just config). Root-level dotfiles like .zshrc and .gitconfig are unaffected.
If you tracked any nested files, run once after upgrading:
dtm migrateThis moves your stored files to the new structure, updates your config, and commits the change — no data is lost.
Commands
Setup
dtm init # first time setup wizard
dtm status # show tracked files, last snapshot, scheduleSnapshots
dtm snapshot # take a snapshot now
dtm log # show full snapshot historyFile Tracking
dtm watch ~/.npmrc # start tracking a new file
dtm watch ~/Library/Application\ Support/Code/User/settings.json
dtm unwatch ~/.vimrc # stop tracking a fileAdd any file to your snapshot with dtm watch <path>.
Diffing
dtm diff # what changed since last snapshot
dtm diff .zshrc # what changed in one specific file
dtm diff .ssh/config # nested files use the relative pathRestoring
dtm restore .zshrc # restore .zshrc to 1 snapshot ago (default)
dtm restore .zshrc -n 5 # restore .zshrc to 5 snapshots ago
dtm restore .ssh/config -n 2 # nested files use the relative pathScheduling
dtm schedule # enable automatic snapshots via launchd
dtm schedule --off # disable automatic snapshotsScheduling is enabled automatically during dtm init. You can disable or re-enable it anytime with the commands above.
Reset
dtm reset # remove all dtm data and configMigration
dtm migrate # migrate stored files to the new path structure (v1.2.0+)Node flags
dtm --version # print version number
dtm --help # show all commandsFile locations
~/.dtm/ # git snapshot repo
~/.config/dtm/config.json # dtm config file
~/Library/LaunchAgents/
com.dtm.snapshot.plist # launchd scheduler (after dtm schedule)License
MIT © Arian Najafi Yamchelo — arii.dev
