cmd-sync-servers
Keep a local site folder and its servers in step from the command line, the way Dreamweaver's Synchronize does.
New here? The Quickstart gets you to a first sync in five steps, and the Cheatsheets keep every everyday command and key on one page.
Before a new site's first sync, read its preview: it lists every file that would move, and nothing moves until you confirm.
What it does
- Sites and servers. A site is a local folder and a list of servers. One server holds the Remote role for synchronizing; another may hold the Testing role.
- A preview of every change. Put newer files, get newer files, or both. The preview lists only the files that differ, each with a checkbox, and nothing moves until you confirm.
- A memory of the last sync. A file changed on both sides since the last sync waits for your decision instead of being overwritten.
- Cloaking. Suffixes, names, folders and single paths that every operation skips, in one site or in every site.
- Safe by default. SFTP host keys are pinned, FTPS certificates verified, passwords kept in the operating system's credential store, sensitive files such as
.envheld back, and local files that a sync replaces kept for 14 days. - Three ways to work. A full-screen terminal interface, a preview in your own editor, and plain prompts or unattended runs with
--jsonfor scripts. The same engine is a library, and the VS Code extension uses it too.
Install
It needs Node.js 22.14 or later, on Windows, macOS or Linux.
npm install --global @isocialpractice/cmd-sync-servers
sync-servers --version
Or run it from a clone; npm link puts the sync-servers command on your PATH:
git clone https://github.com/isocialPractice/cmd-sync-servers.git
cd cmd-sync-servers
npm ci --ignore-scripts
npm run build
npm link
sync-servers --version
A first sync in two commands
sync-servers site add --name "My Site" --local-root ~/sites/my-site \
--protocol ftps --host 203.0.113.10 --user demo-user@example.com
cd ~/sites/my-site && sync-servers sync --put
On Windows, in cmd.exe:
sync-servers site add --name "My Site" --local-root "C:\Users\<user>\Sites\my-site" ^
--protocol ftps --host 203.0.113.10 --user demo-user@example.com
site add asks for the password, connects, and asks about anything only a person can decide: an SSH host key or a TLS certificate seen for the first time, and the folder on the server that holds the site, starting where the server opens. With no options it asks for everything. The last command scans both sides and opens the preview: check what should move, then press Enter.
Prefer menus? Run sync-servers with no command to add sites and servers, test a connection and synchronize, all from the keyboard.
Where to next
- Quickstart
Five steps to a first sync, for someone new to the tool.
- Getting started
A site and its server in one command, and the first preview, step by step.
- Examples
Commands for common jobs, ready to adapt.
- Cheatsheets
Every everyday command and key on one page.
- Configuration
Where settings live, every field, cloaking, the guard and secrets.
- Command line
Every command and option, the terminal interface, editor and plain modes.
- Options
Every option, environment variable and preview mode in one place.
- Synchronization
How changes are found and turned into actions.
- Library API
Use the engine from your own program.
- Security
Protocols, host keys, certificates, secrets and safe deletes.
- Troubleshooting
Connection, sign-in, time and case problems, and what each error means.