Cheatsheets
The commands and keys you use most, each with what it does in plain words. Commands act on the site of the current folder, or on the one named with --site "My Site".
Start here
sync-servers site addsets up a site and its server, asking each question in turn.sync-servers sync --put, in the site's folder, previews your changes and sends what you check.- ? on any screen of the interface lists every key of that screen.
Everyday tasks
| To | Run |
|---|---|
| Set up a site and its server | sync-servers site add |
| Send your changes, after a preview | sync-servers sync --put |
| Bring down changes made on the server | sync-servers sync --get |
| Do both at once | sync-servers sync --both |
| See what changed, moving nothing | sync-servers status |
| See how one file differs | sync-servers diff css/site.css |
| Send one file now | sync-servers put index.html |
| Check that the server still answers | sync-servers server test |
| Work from menus instead | sync-servers |
| Find out what is wrong with the setup | sync-servers doctor |
Sites and servers
| Run | Does |
|---|---|
sites | Lists every site |
site add | Adds a site and its first server, connecting first |
site show | Shows a site, its servers and its cloaking |
site edit --name "New Name" | Renames a site; --local-root moves it |
site edit --symlinks follow-inside-root | Puts and gets the site's links that stay inside its folder as the files and folders they point to; follow follows all (Symbolic links) |
site remove | Removes a site; its folder and the server's files stay |
server add --name Staging --testing | Adds another server, here as the Testing server |
server edit | Changes a server, asking the setup questions again in a terminal |
server test | Connects, signs in and checks the site's folder on the server |
server set-remote Production | Chooses the server sync uses |
server set-testing Staging | Chooses the server the VS Code extension uploads to on save |
password set, password forget | Saves or forgets a server's password |
Every command and option: Commands and Options.
Synchronizing
| Run | Does |
|---|---|
sync --put | Puts files that are newer on your computer |
sync --get | Gets files that are newer on the server |
sync --both | Both; a file changed on both sides waits for your decision |
sync --put --delete | Also deletes server files that are gone locally |
sync --put --dry-run | Shows the preview and moves nothing |
sync --put --yes | Runs without a preview, for scripts |
sync --put css | Limits the preview to one folder |
put img, get img | Moves these files now, with a preview only when a decision is needed |
status | Lists what changed on each side since the last sync |
diff css/site.css | Shows how the two copies of a file differ |
mark-synced css/site.css | Records a file as in sync without moving it |
How changes are found and turned into actions: Synchronization.
Preview keys
The menu at the bottom of the preview, then the keys ? adds:
| Key | Does |
|---|---|
| Space = CHECK/UNCHECK ALL | Checks or unchecks every file: unchecks them all when most are checked, else checks them all |
| c = Check/Uncheck | Checks or unchecks the focused file |
| p = Put | Sends the file to the server |
| g = Get | Brings the file down from the server |
| s = Skip | Leaves the file as it is |
| d = Diff | Shows how the two copies differ |
| a = All | Checks every file that can run, or unchecks them all when all are checked |
| q = Quit | Quits, transferring nothing, as Ctrl+C does |
| Enter = Synchronize | Runs the checked files, after one question |
| m | Records both copies as in sync without moving the file |
| x | Deletes the file, asking where when both copies exist |
| Tab | Shows only one kind of row: All, Put, Get, Resolve, Delete, Guarded or Errors |
| / | Finds a path as you type |
| Esc | Goes back, transferring nothing |
Keys on every screen
| Key | Does |
|---|---|
| Up Down, j k | Move |
| Page Up Page Down, Home End | Move by a page, or to the first or last row |
| Tab | Changes pane or tab |
| Space | Toggles a checkbox, or changes a choice; in the preview, checks or unchecks every file |
| Enter | Opens the focused item, or runs the screen's main action |
| Esc | Goes back, or cancels a question or a running task |
| Ctrl+S | Saves |
| ? | Lists every key of the screen |
| q | Quits, from a top screen or the preview |
| Ctrl+C | Cancels the running task, or quits |
A dashed line at the top or bottom of a list means more rows are hidden past it. More about the interface: The terminal interface.
Plain mode
With --plain, the preview prints numbered rows and takes typed commands:
| Type | Does |
|---|---|
3, 1 4, 2-6 | Checks or unchecks rows |
p 3, g 3, s 3, m 3 | Sets Put, Get, Skip or Synchronized for row 3 |
x 3 | Deletes row 3, asking where when both copies exist |
all, none | Checks or unchecks every row that can run |
diff 3 | Shows how the two copies of row 3 differ |
list, help | Shows the rows, or the commands, again |
go | Synchronizes the checked rows, after one question |
q | Cancels, transferring nothing |
Cloaking
| Pattern | Cloaks |
|---|---|
.psd | Every name ending in .psd |
archive* | Every name starting with archive |
node_modules/ | Every folder named node_modules, and all it holds |
/drafts/ | Only the drafts folder at the top of the site |
!keep.psd | Uncloaks what an earlier pattern cloaked |
| Run | Does |
|---|---|
cloak .psd "archive*" | Cloaks patterns in this site |
cloak img/raw | Cloaks one existing file or folder |
cloak --global .git/ node_modules/ | Cloaks patterns in every site |
cloak --ignore-global, cloak --use-global | Stops or starts using the global patterns in this site |
cloak --list, cloak --global | Shows the site's cloaking, or the global patterns |
uncloak .psd, uncloak --global node_modules/ | Removes a pattern or a path |
The full rules: Cloaking.
Exit codes
| Code | Means |
|---|---|
| 0 | Done, or nothing to do |
| 1 | The command could not run |
| 2 | A usage error, or no site could be chosen |
| 3 | Finished, with failed rows or rows still waiting for a decision |
| 4 | Cancelled |
| 5 | Stopped by a safety guard |
Where settings live
sync-servers config path prints the folders in use.
| System | Folder |
|---|---|
| Windows | %APPDATA%\sync-servers |
| macOS | ~/Library/Application Support/sync-servers |
| Linux and other systems | ~/.config/sync-servers |
State, logs and the environment variables that move them: Where things are kept and Environment variables.