Skip to content

About

Keep a local site folder and its servers in step from the command line, the way Dreamweaver's Synchronize does: sites with named servers, cloaked files, a preview of every change before anything moves, and a memory of the last sync so a file changed on both sides is flagged instead of overwritten.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

cmd-sync-servers

Keep a local site folder and its servers in step from the command line, the way Dreamweaver's Synchronize does: sites with named servers, cloaked files, a preview of every change before anything moves, and a memory of the last sync so a file changed on both sides is flagged instead of overwritten.

The same engine is a library: the vscode-sync-servers extension for VS Code uses it in-process, and both read one shared list of sites.

Documentation: https://isocialpractice.github.io/cmd-sync-servers/ New to it? Start with the Quickstart, and keep the Cheatsheets at hand.

Sites, servers, saved passwords, cloaking and synchronizing work from the command line, in a full-screen terminal UI, in your own editor and in plain prompts. Read the preview of a new site's first sync before you run it.

Highlights

  • Sites and servers. A site is a local folder and its servers; one holds the Remote role for synchronizing, another may hold the Testing role.
  • Protocols. SFTP by default; FTPS with explicit or implicit TLS; plain FTP only when switched on per server; local and network folders.
  • A preview of every change. Put newer files, get newer files, or both, optionally deleting what the other side lost. Only files that differ are listed, each with a checkbox, and a file changed on both sides waits for your decision.
  • Safe by default. Pinned SSH host keys, verified TLS certificates, passwords in the operating system's credential store and never in a file, a guard that holds back .env files and private keys, and local files kept for 14 days after a sync replaces them.
  • Every platform, three ways to work. Windows, macOS and Linux; a full-screen interface, a preview in your own editor, and plain or unattended runs with --json for scripts.

Install

Requires Node.js 22.14 or later.

npm install --global @isocialpractice/cmd-sync-servers
sync-servers --version

Or from a clone (building needs Node.js 22.18 or later):

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

npm link puts the sync-servers command on your PATH; npm unlink --global @isocialpractice/cmd-sync-servers takes it off again.

A first sync

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 opens the preview: check what should move, then press Enter. Run sync-servers with no command to do all of this from menus.

Without a terminal, nothing is asked and nothing connects: pass the root and add more servers the same way.

sync-servers site add --name "My Site" --local-root ~/sites/my-site \
  --host sftp.example.com --user demo-user --remote-root /var/www/my-site
sync-servers server add --site "My Site" --name Staging \
  --host 192.0.2.20 --user demo-user@example.com --remote-root /var/www/my-site --testing

Documentation

The same pages are in docs/.

Contributing and security

License

MIT

About

Keep a local site folder and its servers in step from the command line, the way Dreamweaver's Synchronize does: sites with named servers, cloaked files, a preview of every change before anything moves, and a memory of the last sync so a file changed on both sides is flagged instead of overwritten.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages