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:
| Flag | Description |
|---|---|
--help, -h | Show help for a command. |
--json | Print output as JSON (handy for scripts). |
--verbose, -v | Print 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| Flag | Description |
|---|---|
--name <name> | Device label (defaults to the machine’s hostname). |
--yes, -y | Accept defaults without prompting. |
--no-daemon | Don’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| Flag | Description |
|---|---|
--no-browser | Print 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 logoutadd
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| Flag | Description |
|---|---|
--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| Flag | Description |
|---|---|
--delete-remote | Also delete the folder and its history on the server. Irreversible; affects every device. |
--yes, -y | Skip 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| Flag | Description |
|---|---|
--dry-run | Show 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 folderstart / 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 stopservice
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 removedaemon
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| Flag | Description |
|---|---|
--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 deviceCross-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 --watchversion
treesync versionRoadmap
Planned commands, described in plain terms — no promises on exact flags:
| Command | What it will do |
|---|---|
treesync log | Browse a folder’s version history. |
treesync restore | Restore a file or folder to an earlier version. |
treesync doctor | Diagnose and self-heal common problems. |
| Selective sync | Choose which subfolders to sync on a given device. |
| Ignore presets | One-command ignore rules for common stacks. |
| Bandwidth limits | Cap upload/download bandwidth. |