Skip to Content
CLI reference

CLI reference

treesync is both the command-line tool and the background sync daemon.

treesync <command> [flags]

Run treesync help or treesync <command> --help any time. Global flags work on every command:

FlagDescription
--help, -hShow help for a command.
--jsonPrint output as JSON (handy for scripts).
--verbose, -vPrint more detail about what treesync is doing.

init

The one-command setup: signs this device in, offers to sync a folder (the current directory by default), runs the first sync, and installs and starts the background daemon. Equivalent to login, add, push, then start.

treesync init
FlagDescription
--name <name>Device label (defaults to the machine’s hostname).
--yes, -yAccept defaults without prompting.
--no-daemonDon’t install or start the background service.

login

Sign this device in using a secure device flow. treesync prints a verification URL (and opens your browser when possible); confirm the device in your account to link it. On first login, treesync sets up your encryption key and shows your recovery codes — save them.

treesync login
FlagDescription
--no-browserPrint the verification URL instead of opening a browser.

logout

Sign the current device out. Your local files stay exactly where they are — this only unlinks the device from your account.

treesync logout

add

Register a folder to sync and start mirroring everything inside it (all repos, all files, including each repo’s .git). Point it at the single parent folder that holds your repositories.

treesync add ~/code
FlagDescription
--name <name>Display name for the folder (defaults to the folder name).

remove

Stop syncing a folder. The daemon stops watching it and its local treesync index is deleted. Your files are left untouched, and by default the folder’s data on the server is kept so your other devices keep syncing it. Alias: rm.

treesync remove # pick from a list of synced folders treesync remove ~/code # stop syncing here; keep server data treesync remove ~/code --delete-remote # also delete it for all devices
FlagDescription
--delete-remoteAlso delete the folder and its history on the server. Irreversible; affects every device.
--yes, -ySkip the confirmation prompt.

push

Upload the current state of your synced folders. treesync detects what changed, encrypts it locally, uploads only the chunks not already stored, and records a versioned snapshot. Safe to run repeatedly.

treesync push # all synced folders treesync push ~/code # a specific folder
FlagDescription
--dry-runShow what would be uploaded without uploading.

status

Show what treesync is tracking and whether it’s up to date: your folders, their sync state, and any in-flight transfer.

treesync status # all folders treesync status ~/code # one folder

start / stop

Start or stop the background sync daemon as an OS service (launchd on macOS, systemd --user on Linux). start installs and launches it, so changes sync in real time and the daemon restarts at every login. stop halts it.

treesync start treesync stop

service

Lower-level control of the background service.

treesync service status # installed? running? how many folders? treesync service install # install and start treesync service uninstall # stop and remove

daemon

Run the two-way sync loop in the foreground (what the service runs for you): it pushes local changes and pulls changes from your other devices. Useful for debugging — it logs each sync as it happens. Ctrl-C to stop.

treesync daemon
FlagDescription
--debounce <dur>Quiet period after a local change before pushing (default 2s).
--poll-interval <dur>How often to pull remote changes (default 3s).

resolve

Walk through any sidecar conflict copies and pick which version to keep. In a terminal it prompts for each one; flags handle the common cases in one shot.

treesync resolve # interactive treesync resolve --keep-mine # keep your files, delete the copies treesync resolve --accept michal-macbook # take the copies from a device

Cross-device sync (preview)

These power the “same folder on every device” flow. The daemon uses them under the hood; you can also run them directly.

# Attach this device to a folder created elsewhere, then keep it in two-way sync treesync clone --folder-id <id> --dest ~/code # Reconstruct a folder from the cloud; --watch keeps it live, --tree renders it treesync pull --folder-id <id> --dest ./somewhere --watch --tree # Print a directory as a tree (no network); --watch re-renders live treesync tree ~/code --watch

version

treesync version

Roadmap

Planned commands, described in plain terms — no promises on exact flags:

CommandWhat it will do
treesync logBrowse a folder’s version history.
treesync restoreRestore a file or folder to an earlier version.
treesync doctorDiagnose and self-heal common problems.
Selective syncChoose which subfolders to sync on a given device.
Ignore presetsOne-command ignore rules for common stacks.
Bandwidth limitsCap upload/download bandwidth.