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

Everyday tasks

Everyday tasks
ToRun
Set up a site and its serversync-servers site add
Send your changes, after a previewsync-servers sync --put
Bring down changes made on the serversync-servers sync --get
Do both at oncesync-servers sync --both
See what changed, moving nothingsync-servers status
See how one file differssync-servers diff css/site.css
Send one file nowsync-servers put index.html
Check that the server still answerssync-servers server test
Work from menus insteadsync-servers
Find out what is wrong with the setupsync-servers doctor

Sites and servers

Sites and servers
RunDoes
sitesLists every site
site addAdds a site and its first server, connecting first
site showShows a site, its servers and its cloaking
site edit --name "New Name"Renames a site; --local-root moves it
site edit --symlinks follow-inside-rootPuts 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 removeRemoves a site; its folder and the server's files stay
server add --name Staging --testingAdds another server, here as the Testing server
server editChanges a server, asking the setup questions again in a terminal
server testConnects, signs in and checks the site's folder on the server
server set-remote ProductionChooses the server sync uses
server set-testing StagingChooses the server the VS Code extension uploads to on save
password set, password forgetSaves or forgets a server's password

Every command and option: Commands and Options.

Synchronizing

Synchronizing
RunDoes
sync --putPuts files that are newer on your computer
sync --getGets files that are newer on the server
sync --bothBoth; a file changed on both sides waits for your decision
sync --put --deleteAlso deletes server files that are gone locally
sync --put --dry-runShows the preview and moves nothing
sync --put --yesRuns without a preview, for scripts
sync --put cssLimits the preview to one folder
put img, get imgMoves these files now, with a preview only when a decision is needed
statusLists what changed on each side since the last sync
diff css/site.cssShows how the two copies of a file differ
mark-synced css/site.cssRecords 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:

Keys of the preview
KeyDoes
Space = CHECK/UNCHECK ALLChecks or unchecks every file: unchecks them all when most are checked, else checks them all
c = Check/UncheckChecks or unchecks the focused file
p = PutSends the file to the server
g = GetBrings the file down from the server
s = SkipLeaves the file as it is
d = DiffShows how the two copies differ
a = AllChecks every file that can run, or unchecks them all when all are checked
q = QuitQuits, transferring nothing, as Ctrl+C does
Enter = SynchronizeRuns the checked files, after one question
mRecords both copies as in sync without moving the file
xDeletes the file, asking where when both copies exist
TabShows only one kind of row: All, Put, Get, Resolve, Delete, Guarded or Errors
/Finds a path as you type
EscGoes back, transferring nothing

Keys on every screen

Keys on every screen
KeyDoes
Up Down, j kMove
Page Up Page Down, Home EndMove by a page, or to the first or last row
TabChanges pane or tab
SpaceToggles a checkbox, or changes a choice; in the preview, checks or unchecks every file
EnterOpens the focused item, or runs the screen's main action
EscGoes back, or cancels a question or a running task
Ctrl+SSaves
?Lists every key of the screen
qQuits, from a top screen or the preview
Ctrl+CCancels 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:

Plain preview commands
TypeDoes
3, 1 4, 2-6Checks or unchecks rows
p 3, g 3, s 3, m 3Sets Put, Get, Skip or Synchronized for row 3
x 3Deletes row 3, asking where when both copies exist
all, noneChecks or unchecks every row that can run
diff 3Shows how the two copies of row 3 differ
list, helpShows the rows, or the commands, again
goSynchronizes the checked rows, after one question
qCancels, transferring nothing

Cloaking

Cloaking patterns
PatternCloaks
.psdEvery 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.psdUncloaks what an earlier pattern cloaked
Cloaking commands
RunDoes
cloak .psd "archive*"Cloaks patterns in this site
cloak img/rawCloaks one existing file or folder
cloak --global .git/ node_modules/Cloaks patterns in every site
cloak --ignore-global, cloak --use-globalStops or starts using the global patterns in this site
cloak --list, cloak --globalShows 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

Exit codes
CodeMeans
0Done, or nothing to do
1The command could not run
2A usage error, or no site could be chosen
3Finished, with failed rows or rows still waiting for a decision
4Cancelled
5Stopped by a safety guard

Where settings live

sync-servers config path prints the folders in use.

Where sites.json is kept
SystemFolder
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.