Control CLI reference
proton-sync is a thin control client. It sends requests to the running daemon over its
Unix socket and prints the reply. It runs no sync logic of its own. The daemon answers
control requests from an in-memory snapshot on a dedicated task, so every command below
responds immediately — even while a sync pass is running.
proton-sync [--config <PATH>] [--socket-path <PATH>] [--json] [--pair <NAME> | --all-pairs] <command>When --socket-path is omitted, the CLI uses the same default as the daemon —
$XDG_RUNTIME_DIR/proton-sync.sock, with an OS-temp-directory fallback — so on a normal
setup you don’t need to pass it.
If your daemon runs with a socket_path set in its config file,
point the CLI at the same file with --config instead of repeating --socket-path on
every command. The precedence matches the daemon’s: --socket-path beats the config file’s
socket_path, which beats the default. Only socket_path is read from the file; every other
key belongs to the daemon. A relative socket_path is rejected on both sides, because it
would resolve against each process’s own working directory.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
doctor |
Check this machine for what the first sync needs: proton-drive runs, a sign-in is stored, the config file reads. Does not use the daemon or its socket (see below). |
status |
Show what the daemon is doing right now (see below). |
history |
Show the recorded sync passes, newest first — duration, kind, outcome. |
activity [<path>] |
Show what has moved recently, or one path’s own history. |
list [<path>] |
List one folder on Proton Drive, as the daemon sees it now. |
pause |
Pause automatic and manual sync for the selected folder pair until resumed. The pause is remembered in that pair’s own index, so it survives a daemon restart. A pause made while a pair is unavailable is kept in memory only, and a restart loses it. A paused unavailable pair is not retried, so to make the pause stick, resume the pair once its folder is back and pause it again. proton-sync says “Not saved”. |
resume |
Resume sync work for the selected folder pair, and forget its remembered pause. If the pair was paused, a pass is queued at once (as syncnow would) instead of waiting for the pair’s next timer, and the reply says a pass is scheduled. A pair that was not paused queues nothing. |
syncnow |
Trigger a sync and watch it finish (--no-wait to just schedule it). |
resync |
Force a full remote re-scan on the next pass instead of the fast warm start. |
reset-index --yes |
Discard the baseline, the event cursors and the standing delete approvals, and rebuild them from a full scan of both sides. Your files are not touched; the rebuild adopts what already agrees, downloads what is missing and deletes nothing. It is also how you start a folder over from Proton when the daemon holds it as replaced by an empty folder, and how you accept a changed remote_root (add --pair NAME beside several folders; the start-over also uploads what only your folder has to the new Proton folder): the daemon holds a pair set to another Proton folder than its index was last synced with, until you put remote_root back or reset. |
stop |
Ask the running daemon to exit gracefully. |
pending |
List deletions currently withheld by the delete-approval guard. |
approve <path> | approve --all |
Approve a withheld deletion (or all) so it applies next sync. |
deny <path> | deny --all |
Revoke a prior approval before it applies. |
keep <path> | keep --all |
Refuse a withheld deletion and put the surviving copy back on the other side. |
Folder pairs
Section titled “Folder pairs”A daemon config may name more than one folder pair (each a [[pair]] table); see
Multiple folder pairs for how to write one and what the daemon checks.
Every command above addresses one pair, except stop, which is daemon-wide (see below). With
neither --pair nor --all-pairs, the addressed pair is the default pair — the first
[[pair]] table, or the whole file’s top-level keys when it has no [[pair]] at all — which is
exactly what every proton-sync invocation predating this feature already meant.
--pair <NAME>addresses one pair by its configuredname, matched case-sensitively. Pair names are already unique case-insensitively — no daemon can hold bothPhotosandphotos— but the selector still compares byte-exact:--pair photosagainst a pair configured asPhotosdoes not resolve. The command runs and waits for completion on that pair alone, same as an unqualified invocation.--all-pairsruns the command once per configured pair, in the orderstatuslists them, and reports each pair’s immediate reply rather than waiting for each pass to finish — use--pairon one pair when you want to watch it through to completion. Under--json, the output is a JSON array of{"pair": "<name>", "result": <the same value --json prints for one pair>}objects; over one configured pair that array has exactly one element.stophas no per-pair meaning, so the selector is ignored on it:--pair <NAME>and--all-pairseach send exactly one shutdown request and the daemon exits exactly as an unqualifiedstopwould — under--jsontoo, which prints the same single response object rather than the--all-pairsarray. A--pairnaming no configured pair still shuts the daemon down. The capability check below still runs first, though: on a daemon too old to understand--pair/--all-pairsat all,stopis refused with the same upgrade message as every other command.- Naming a pair that does not exist does nothing at all for every other command — no sync is scheduled, no approval is recorded, no index is reset — and the command exits non-zero.
- The human-readable
statusheadline names the pair only when more than one is configured — a one-pair daemon’s headline is unchanged from before this feature existed. --pair/--all-pairsneed a daemon new enough to understand them.proton-syncchecks first and refuses with a message to upgradeproton-syncdrather than silently running the command against an older daemon’s one pair under the wrong name. Leaving both off needs no such check: the default pair is correct on any daemon, old or new.
Human-readable by default, --json for scripts
Section titled “Human-readable by default, --json for scripts”Commands print a concise, git-style summary by default:
$ proton-sync status● syncing — 2 uploads, 1 download planned folders ~/ProtonDrive ⇄ /Drive/RemoteFolder activity downloading Documents/takeout.tgz — 1.4 GiB so far · 3m12s [step 812/6377] queued notes/scratch.md, reports/q3-summary.pdf and 115 more moved 44 sent · 115 received — 386.0 MB up, 1.1 GB down last sync 2m ago changes 3 queued locally
$ proton-sync historyLast full sweep 2d ago — nothing was out of step.Today: 386 MB sent · 1.1 GB received.
just now 1.4s incremental ✓ 3 change(s), 2.1 MB sent 15m ago 12s full-sweep ✗ proton-drive: request failed …
$ proton-sync activity just now sent to Proton Drive notes/today.md (4.2 kB) 3m ago brought to this computer photos/trip.jpg (2.1 MB)
2 file(s), 2 event(s) in this window · 4.2 kB sent · 2.1 MB receivedactivity takes an optional path (proton-sync activity notes/today.md) to show just that
file’s history, --days N to bound the window, and --limit N to cap the rows. A
path-filtered reply carries no byte totals: the totals are per pass and hold no paths, so
the only number available would be the window’s whole traffic — which would read as that
one file’s.
The headline dot reflects the daemon state: idle (everything up to date), syncing
(a pass is in flight, with the plan when known), running (changes queued for the next
pass), paused, or error (the last pass failed; the error is shown on its own line).
A folder is idle only once a pass has finished for it since the daemon started: until
then it reads waiting (another folder’s pass is running, and it is named) or starting
(nothing is running yet; the first pass starts on its own). --all-pairs and --pair read
the same way for each folder.
Extra lines — queued changes, deletions awaiting approval, the last error — appear only
when they apply.
While a pass is in flight, the activity line shows what the daemon is doing right
now: which remote folder a full-tree walk is listing (with a running count), which local
file the scan is hashing, or which file is transferring — with live bytes-so-far for
downloads, sampled from the staging directory while the transfer runs. The same line
animates in place on the syncnow spinner.
Two lines join it while transfers are running. queued names the files waiting behind the one in flight, then counts the rest; moved is what this pass has actually landed so far, per direction — file counts and byte totals from the same fold, so they always describe the same transfers. Both are omitted rather than shown at zero.
One transfer runs at a time (a batched download counts as one row covering a folder’s chunk), so the queue is what is next, not what is also moving.
Pass --json to any command to get the daemon’s raw response instead: status --json
prints the full response object (below), history --json the history block, activity --json the file_history block, and pending --json the pending-deletions array.
--json output is always the daemon’s data verbatim.
history --json changed shape: it used to be the raw status_history array, stored
oldest-first, and is now the history object described under Pass history.
Scripts reading it need updating; status --json still carries status_history unchanged
for anything that wants the old attempt trail.
syncnow
Section titled “syncnow”syncnow schedules a pass and is acknowledged immediately — the daemon never blocks other
control clients while syncing. The CLI then polls status and shows a live spinner until
your pass finishes, printing its outcome:
$ proton-sync syncnow✓ sync completed — 3 uploadsThe exit code is non-zero if the watched pass failed. Use --no-wait to only schedule the
sync and return at once, and --json to print the final status object (or, with
--no-wait, the acknowledgement). While the daemon is paused, syncnow reports the skip
and schedules nothing. A pause is remembered per folder pair across daemon restarts (and across the
restart the desktop app does after you save settings): a restarted daemon keeps a paused pair
paused, and skips its first pass, until you resume it. The exception is a pause made while the pair is unavailable (its folder or index cannot be reached): it is kept in memory only and a restart loses it. A paused unavailable pair is not retried, so to make the pause stick, resume the pair once its folder is back and pause it again. proton-sync pause prints “Not saved”.
The status object (--json)
Section titled “The status object (--json)”{ "status": "running", "paused": false, "syncing": false, "reconcile_seq": 4, "pending_changes": 0, "message": "daemon status", "last_sync_epoch_secs": null, "last_error": null, "last_plan_summary": null, "last_successful_sync_summary": null, "status_history": [], "pending_deletions": [], "unsyncable": []}-
status/paused/pending_changes— the live daemon state (running,syncing, orpaused) and the number of changes waiting to reconcile. The string reports live activity: it stayssyncingwhile a pass is in flight even if a pause was just accepted mid-pass (pausedcarries the standing request; the CLI shows this combination as “pausing”). -
pause_unsaved— present only on apauseorresumereply, and only when the daemon could not record the change in the pair’s index (the reason). The change took effect, but a restart before it is saved would not keep it;proton-syncprints this as aNot savedline. -
syncing—truewhile a reconcile pass is actually in flight. -
reconcile_seq— count of completed passes since the daemon started; clients that scheduled a sync poll until it advances to know their pass finished. -
last_sync_epoch_secs— when the last sync ran (nullbefore the first). -
last_error— the most recent error, if any. -
last_plan_summary/last_successful_sync_summary— nullable plan summaries (upload/download/conflict/… counts). -
status_history— the last 20 reconcile attempts, idle ones included: a rolling debug trail, not the pass log. See Pass history. -
history— the durable pass log:{ recent, last_full_sweep, today }(also viahistory). See Pass history. -
pending_deletions— the items awaiting delete approval (also viapending). -
unsyncable— the standing list of entities that cannot be synced at all, printed undercan't syncand grouped by cause. Each item is{ path, entity_kind, reason, first_seen_epoch_secs }.reasonis a token —remote_not_downloadable(a Proton Docs/Sheets document, or a node the remote listing could not fully decode),unrepresentable_path(a name that is not valid UTF-8),local_unusable_date(a file or folder dated before 1 January 1970, or whose date cannot be read: it is held, not dropped, so nothing is deleted or downloaded over it, a folder is held whole with everything under it, and setting a current date on it releases it), or one of the local kindslocal_symlink/local_socket/local_fifo/local_device/local_special_file— and an unfamiliar one must be rendered verbatim, not rejected: more may be added, and that is exactly how these were.The list is merged, not recomputed per pass, so
first_seen_epoch_secsanswers “how long has this been stuck”. A path leaves it when a pass plans a real action for it; it also leaves by absence, but only from a pass whose evidence covers where the reason came from — a local kind on any pass that ran the local scan, a remote one (and a held date) only on a full-tree walk (proton-sync resyncforces one; fixing a held item’s date makes the next pass one). A path an exclude glob or include filter hides is not here: that is a rule you wrote, not a limitation. -
auth— what the daemon believes about your Proton sign-in:signed-in,signed-out, orunknown. See Sign-in state. -
listing— the answer to alistrequest, andnullon every other reply. See Browsing the remote. -
activity— what the daemon is doing right now (nullwhen idle):{ phase, detail, folders_listed, files_scanned, action_index, action_total, transfers, transfers_remaining, transfer, since_epoch_secs, pass }, wherephaseis one ofscanning-local,listing-remote,fetching-events,executing,committing. Every field is display-only and best-effort; new phases may appear, so render unknown tokens rather than failing.since_epoch_secsis when the phase began and resets on every phase change; thepassblock is the pass as a unit and does not, so an elapsed time rendered from it climbs monotonically.transfersis the transfer queue as a bounded window: every transfer in flight first, then the next planned ones asqueuedrows, capped at six. Each row carriesdirection,path,state(activeorqueued),bytes_total(uploads only — a remote listing exposes no size),bytes_done(downloads only — sampled live from the staging directory),started_epoch_secs(nullon a queued row), andfileswhen the row stands for a whole batched download rather than one file.transfers_remainingis how many transfers the pass has left, counted past the window, so+n morecomes from the daemon rather than from the length of the list.nullmeans the pass is not executing (or the daemon predates the field) — unknown, not zero;0is the only value that means nothing is left to transfer.transferis the firstactiverow oftransfers, repeated for clients written before the list existed. It is derived, never set on its own.passis{ started_epoch_secs, changes, kind, uploaded_files, downloaded_files, uploaded_bytes, downloaded_bytes }.changesisnulluntil the plan exists, which means unknown, not zero. The four counters are what this pass has landed and committed so far, per direction — files and bytes folded from the same events, so they always describe the same set of transfers.
There is no per-file percentage, and there will not be one from this client: an upload knows its total and gets no progress from the CLI, a download reports progress and has no total. The honest fraction is per pass —
pass.uploaded_bytesagainstlast_plan_summary.upload_bytes.
Browsing the remote
Section titled “Browsing the remote”proton-sync list asks the daemon to list one folder on Proton Drive, non-recursively.
The daemon runs the proton-drive call itself, which matters for more than tidiness: the CLI
is not safe to run twice at once (it shares a SQLite cache), so a client that shelled out to
it directly would race the daemon’s own sync. Going through the socket puts every invocation
behind one gate.
$ proton-sync listthe remote root photos/ archive/ notes.txt proposal.gdoc (can't be downloaded)
$ proton-sync list photosphotos 2019/ beach.jpgOmit the path for the remote root. The path is relative to the daemon’s configured
remote_root, and there is no reserved word — a folder named all lists like any other.
This is remote ground truth, not sync state: selective-sync rules are not applied, and nothing is read from the sync index. It answers “what is on Proton under this folder”, which is a different question from “what would this daemon sync”.
--json prints the listing object, which is one of three states:
{ "state": "listed", "path": "photos", "entries": [ { "path": "photos/beach.jpg", "name": "beach.jpg", "entity_kind": "file", "sha1": "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d", "downloadable": true } ], "total": 1, "truncated": false}state: "listed"—entriesholds the folder’s contents (directories first, then by name).totalis the untruncated count andtruncatedsays whether the daemon held any back; the reply is capped at 500 entries by default and 5000 with--limit, because the whole reply is read into memory at once.downloadable: falsemarks a node the engine cannot fetch — typically a Proton-native Docs/Sheets file, which has nosha1either.state: "busy"— aproton-drivecommand was already running and this request gave up waiting. Nothing was attempted, so it says nothing about the folder; retry.state: "failed"— the listing was attempted and failed;errorsays why. If the cause was your sign-in,authon the same reply already sayssigned-out.
list exits non-zero for busy and failed, so a script can branch on the exit code
instead of parsing the state — and never mistakes “busy” for “empty folder”.
Sign-in state
Section titled “Sign-in state”Every reply carries auth, the daemon’s own verdict on your Proton session, so a UI never
has to guess it from error text:
signed-in— something reached Proton successfully (a sync pass completed, or alistreturned).signed-out— aproton-drivecommand was refused for the session. Runproton-drive auth login; the daemon reuses that CLI’s session and picks the new one up on its next pass.unknown— nothing has proved or disproved it yet. A freshly started daemon reports this, and so does one whose only failures were of some other kind (a timeout, a missing binary, a full disk). It is not a synonym for either other state: only success moves it tosigned-in, and only a recognised sign-in failure moves it tosigned-out.
proton-sync status shows a sign-in line only when the answer is signed-out.
Pass history
Section titled “Pass history”Two different records, answering two different questions.
status_history is the attempt trail: every completed reconcile attempt, idle ones
included, with epoch_secs, message, last_error, plan_summary,
successful_sync_summary and failed_item_count. The daemon keeps the most recent 20
in a JSON file next to the index and reloads them on restart. With event-driven detection on
by default the daemon runs a pass every 30 seconds, so those twenty entries are roughly ten
minutes of wall clock and are mostly idle polls — useful for “is it alive and what did the
last few passes say”, useless for anything older.
history is the durable pass log, stored in the index database:
recent— the last 20 recorded passes, newest first. Each is{ id, started_epoch_secs, duration_ms, kind, outcome, changed, failed, bytes_uploaded, bytes_downloaded, error }.kindisfull-sweep,warm-startorincremental;outcomeisclean,partial,failed, orinterrupted(a pass the process died in the middle of). Both are open tokens — render an unfamiliar one verbatim.last_full_sweep— the most recent full-tree walk, however long ago.today—{ since_epoch_secs, uploaded_bytes, downloaded_bytes }since local midnight.
An idle pass records nothing. Recording ~2900 “nothing happened” rows a day would evict
every interesting one within minutes, and “the daemon is alive” is already answered by
reconcile_seq and last_sync_epoch_secs. A pass is recorded when it changed something, or
did not end cleanly, or was a full sweep — a changeless full sweep is recorded precisely
because “when did the last one run, and was anything out of step” is what it answers.
Retention is bounded in both dimensions: passes keep the newest 2000 rows and one year, the per-file event log the newest 20 000 rows and 90 days. The most recent full sweep is exempt from both pass bounds, so a chronically failing daemon cannot evict it. For anything older, read the journal:
journalctl --user -u proton-syncd.serviceDelete approval
Section titled “Delete approval”The pending, approve, deny and keep commands drive the delete-approval
guard. pending labels each item with its direction — a
LOCAL DELETE (removed on Proton Drive; approving removes your local copy) or a
REMOTE DELETE (removed locally; approving removes it on Proton Drive) — so you always
know which way a deletion runs before approving.
proton-sync pendingproton-sync approve notes/old.txt # one itemproton-sync approve --all # everything pendingproton-sync deny notes/old.txt # revoke an approval before it appliesproton-sync keep notes/old.txt # refuse it: put the surviving copy back on the other sideproton-sync syncnow # apply nowapprove/deny/keep require either a <path> or --all, never both and never
neither — a bare approve won’t silently approve everything.
approve also takes --direction local|remote, which is read only when nothing pending
matches the path: that is how a deletion is approved before the pass that withholds it (the
desktop app’s Plan screen does exactly this when you type DELETE). A path alone does not say
which of the two deletions at it you mean, so without the flag nothing is recorded.
Stopping the daemon
Section titled “Stopping the daemon”proton-sync stop asks the daemon to exit through the same clean path as a SIGTERM: an
in-flight transfer is cancelled (actions that fully completed before the stop keep their
checkpoint commits; the interrupted action is never recorded and replans, along with the
rest, on next start), the control socket is removed, and the process exits. Under systemd, start it again
with systemctl --user start proton-syncd; the unit’s Restart=on-failure does not respawn
a clean stop.
Checking this machine: doctor
Section titled “Checking this machine: doctor”proton-sync [--config <PATH>] [--json] doctor [--proton-cli <PATH>]doctor is the one command that does not talk to the daemon. It never resolves or dials the
control socket, never creates a runtime directory and never starts proton-syncd, so it works
on a machine where nothing is installed or running yet. It looks at this machine and prints one
line per check:
| Check | Required | What it looks at |
|---|---|---|
proton-drive |
yes | The CLI is found and proton-drive version runs and exits 0. A crash, a non-executable file, a directory or a non-zero exit is reported as such, not as missing. A relative proton_cli path (one with a / that is not absolute) is a problem: the service resolves it against its own working directory, so the answer would depend on where you ran doctor. |
signed in |
yes | A proton-drive sign-in is stored in the desktop keyring. Only whether it exists is read; the stored session is never printed. |
config |
yes | The config file reads and validates. No file at the default path is fine. With no home directory (no absolute XDG_CONFIG_HOME or HOME) nothing is read and the check says it could not be made. |
secret-tool, curl, session bus |
no | The tools and the session bus the daemon uses to follow changes. Without them sync still works but walks the whole folder on every pass. |
service |
no | proton-syncd.service is installed for your user. |
Each problem comes with a fix and a link: Proton’s page for the CLI where that is the fix, and a section of Troubleshooting for the rest.
It takes these options:
--proton-cli <PATH>checks thatproton-driveinstead of the config file’sproton_cli. Give it afterdoctor.--config <FILE>reads that config file, and a missing file is a problem. Without it, the default file is read and a missing one is fine. Give it beforedoctor, as for every command;proton-sync doctor --config FILEis a usage error.--jsonprints the report as JSON.
It refuses --socket-path, --pair and --all-pairs, because it checks this machine and not a
folder pair: it prints “doctor checks this machine, not the daemon; it takes no socket or folder
pair” and exits 2.
Exit codes
Section titled “Exit codes”The CLI exits 0 on a successful round-trip and non-zero on failure — it can’t reach the
daemon, or the pass watched by syncnow failed. If it can’t connect, confirm the daemon is
running and that both sides use the same socket path — see
Troubleshooting.
doctor has its own codes, because it never reaches the daemon:
| Exit | Meaning |
|---|---|
0 |
Everything required is in place. Recommended problems are listed but do not change the code. |
1 |
A required check found a problem (missing or failed). |
3 |
No required problem, but a required check could not be made (unknown): a timeout, or no session bus to ask the keyring through. |
2 |
A usage error, as for any command, including the refused flags above. A proton-sync too old to have doctor also exits 2. |