The last dotfile syncer you'll ever need.
Project description
dotsync: fast-sync to all your hosts
dotsync is a blazing fast CLI for syncing dotfiles to all your remote machines — dotfiles everywhere, instantly.
Features
- Concurrent smart sync to multiple hosts over SSH — talking 100s of files to 100s of hosts
- Just-in-time SSH to bring your dotfiles with you wherever you SSH
- Watch mode for instant sync on file changes — no more manual pushes/pulls
- Flexible configuration with per-source and per-destination options
- Templating support for dynamic per-destination contents via Jinja
- Robust error handling with retries and logging, and never deletes files
- Dry-run mode to preview sync actions without making changes
Installation
Homebrew
brew install hcgatewood/tap/dotsync
Pip
pip install dotsync
# ...and install dependencies: rsync >= 3.2.3
Usage
Initialize your config
# Create sample config file in ~/.dotsync/<hostname>.dotsync.yaml
dotsync init
# Show the materialized config file
dotsync show
Quick sync
# Sync everything
dotsync
# Sync specific hosts
dotsync host1 host2
# Sync hosts by specific tags
dotsync @work @personal
Watch for changes and sync automatically
# Watch and sync everything
dotsync watch
# Watch and sync specific hosts/tags
dotsync watch host1 @work
SSH and bring your dotfiles with you
# Automatically sync dotfiles just-in-time on SSH
# With wildcard support, e.g. "*" for all hosts
dotsync ssh host1
With templating support for per-host customizations
# Create a templated version of your dotfile, with {{ var }} placeholders
vim ~/.zshrc.tpl.j2
# Edit your config file to define the desired vars per remote host/group
dotsync edit
# Sync/watch like normal, templated files will be rendered per remote host
dotsync sync
Configuration
The config is a YAML file located at ~/.dotsync/<hostname>.dotsync.yaml or ~/.dotsync/dotsync.yaml. The <hostname> is the current machine's hostname, allowing per-source-machine configurations.
groups:
work:
vars: { company: pinterest }
paths:
/local/src: /remote/dst
hosts:
devapp:
tags: [ work ] # tags organize hosts + default group-level settings
vars: { env: production } # vars when templating *.tpl.j2 files
paths:
/local/src: /remote/dst # *.tpl.j2 src files will be templated
Reference
Top-level
Usage: dotsync [OPTIONS] COMMAND [ARGS]...
CLI for syncing dotfiles to remote hosts.
Options:
-h, --help Show this message and exit.
Commands:
init (i) Initialize dotfiles configuration on the current machine.
show (o) Show dotfiles to be synced based on configuration.
sync (s) Sync dotfiles to remote machines based on configuration.
watch (w) Watch dotfiles for changes and sync automatically.
Sync and watch
Usage: dotsync sync|watch [OPTIONS] [REMOTES]...
Sync dotfiles to remote machines based on configuration.
REMOTES: optional list of remotes (either hostnames or @tags) to sync to; if not provided, syncs to all configured
hosts.
Options:
-c, --config FILE Path to the dotsync configuration file. Defaults to searching in $DOTSYNC_CONFIG_DIR or
~/.dotsync for <hostname>.dotsync.yaml then dotsync.yaml
--src-concur INTEGER Maximum concurrent source file syncs. [default: 30]
--dst-concur INTEGER Maximum concurrent syncs per destination host. [default: 8]
--dry, --dry-run Only show what would be synced, without performing any actions.
-v, --verbose Enable verbose output.
-h, --help Show this message and exit.
Turbo speed
For the fastest possible syncs (especially in watch mode), enable SSH connection caching in your SSH config:
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h:%p
ControlPersist 600
How I use dotsync
I mainly use dotsync to push a subset of my personal dotfiles to our remote dev servers. With dotsync watch, any time I change a dotfile locally it's automatically synced to all the remote servers within a second or two, no manual work needed.
My minimal dotsync config
hosts:
devapp:
tags: [pinterest]
paths:
~/.inputrc: ~/.inputrc
~/.profiles.remote/pinterest.bash_aliases.bash: ~/.bash_aliases
~/.profiles.remote/pinterest.mise.toml: ~/.mise.toml
~/.scripts/pbcopy_remote.py: ~/.scripts/pbcopy
Setting a watch
# This gets run in a startup script on my local machine
dotsync watch @pinterest 2>&1 | tee -a "$LOGDIR/dotsync.log" &
See also
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dotsync_fast-0.1.0.tar.gz.
File metadata
- Download URL: dotsync_fast-0.1.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.10 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ba64a8e4e2a58bcf7af69f422c870fb1c1a3748fc61d226a1d97a07525987dd
|
|
| MD5 |
0d18709a5ffa3bc2272ab72caf3b20d9
|
|
| BLAKE2b-256 |
0967da64263b951157554b3838cb9e3777655b21a50b8487a7b6f93524e9070d
|
File details
Details for the file dotsync_fast-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dotsync_fast-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.10 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ecaa61e5680650013a0fc5b89aecf7a2669f3caff8f13dad9cdab9d7d9f6cdf
|
|
| MD5 |
cbb5b8aee1f604617233017911565b19
|
|
| BLAKE2b-256 |
b850c30910a7408e0126b2c88591dbfcffaad093ebbff8fef14a8641feeedd1c
|