Skip to main content

Synchronization via Terminal

Use the command-line interface (CLI) of Sync-in to configure and trigger synchronizations between your local files and remote servers. This interface also allows you to manage multiple servers, define custom sync paths, and automate your transfer workflows.

An ideal solution for advanced users, scripting, or environments without a graphical interface.

OnlyOffice

Use Cases​

  • 🧱 Work in headless environments, such as remote servers or containers.
  • ⏰ Schedule automatic synchronizations using CRON tasks or a system scheduler.
  • πŸ” Automate your business workflows by integrating the CLI into processing or backup scripts.
  • πŸ§ͺ Test syncs in simulation mode, using the --report and --debug options to identify changes without applying them or to troubleshoot.
  • 🌐 Manage multiple servers from a single workstation, centralizing your connections in one tool.
  • πŸ› οΈ Deploy predefined configurations, for automated installations across multiple machines or environments.

Access Requirements​

To use the CLI, the following conditions must be met:

  • You must have the desktop access permission enabled.
  • You must have the sync permission enabled.
  • Node.js 22.x must be installed on the system.
  • You must download the CLI binary from your Account or the Downloads page.

Quickstart​

1. Add a server​

./sync-in-cli servers add \
--name <MY_SERVER> \
--url https://<YOUR_DOMAIN> \
--login <YOUR_LOGIN> \
--password <YOUR_PASSWORD>

2. Add a sync path​

./sync-in-cli paths add \
--server <MY_SERVER> \
--localPath </local/path/to/files> \
--remotePath <personal|spaces|shares/...> \
--name <SYNC_NAME> \
--mode <both|upload|download> \
--diffMode <fast|secure> \
--conflictMode <recent|local|remote>

3. Launch synchronization​

./sync-in-cli run \
--server <MY_SERVER> \
--path <PATH_NAME>

Management​

Once the CLI is configured and registered with the server, it has access to your account.
Connection details can be viewed in the Clients menu of your account.

You can revoke CLI access at any time, regardless of the workstation used for configuration.

From the same menu, you can also update the sync configuration of CLI-managed paths.
Changes are applied on the next sync launch.

Security​

After a certain period, you may be asked to re-authenticate to securely renew access to your account.

To perform this operation, see the re-authentication command.

Notes​

note

Unlike the desktop app, files deleted locally (on the workstation) are not moved to the trash.

Commands​

CommandDescription
--helpDisplays general help
--versionShows the CLI version
runTriggers syncs (see options below)
serversManages registered servers
pathsManages sync paths

run Command​

run – Start a synchronization​

Manually launches a sync from the command line.
You can sync all configured paths or target specific servers/paths.
If --server or --path are not specified, all folders will be selected for synchronization.

OptionAliasDescriptionRequired
--report-rRead-only mode (dry-run), shows differences without applying them❌
--debug-dEnables detailed logs for debugging❌
--async-aRuns syncs in parallel❌
--server-sID or name of the server to sync❌
--path-pID(s) or name(s) of paths to sync (requires --server)❌

servers Commands​

Sub-commandAliasDescription
listlsList all registered servers
addmkAdd a new server
removermRemove a registered server
authtouchRe-authenticate (refresh access token)

add (alias: mk)​

Adds and registers a remote server for use with the CLI.

OptionAliasDescriptionRequired
--name-nCustom name for identifying the serverβœ…
--url--webServer URL (e.g., https://your-instance.com)βœ…
--login-uUser login or emailβœ…
--password-pUser passwordβœ…

remove (alias: rm)​

Removes a registered server.

OptionAliasDescriptionRequired
--server-sID or name of the serverβœ…

auth (alias: touch)​

Refreshes the access token for a registered server.

OptionAliasDescriptionRequired
--server-sID or name of the serverβœ…
--login-uUser login or emailβœ…
--password-pUser passwordβœ…

paths Commands​

Sub-commandAliasDescription
listlsList sync paths per server
addmkAdd a new local/remote sync path
setviEdit sync options for an existing path
removermRemove an existing sync path
updateupRefresh paths from the server
flushresetClear previous snapshots of a sync path

add (alias: mk)​

Adds a new sync path (local/remote).

OptionAliasDescriptionRequiredValuesDefault
--server-sServer ID or nameβœ…β€”β€”
--localPath-lPath to local file or folderβœ…β€”β€”
--remotePath-rRemote path (spaces, personal, or shares)βœ…β€”β€”
--name-nCustom sync nameβŒβ€”β€”
--mode-mSync modeβœ…download, upload, bothβ€”
--diffMode-dDifference detection mode❌fast, securefast
--conflictMode-cConflict resolution strategy (if --mode both)❌recent, local, remoterecent

set (alias: vi)​

Modifies sync options for an existing path.

OptionAliasDescriptionRequiredValues
--server-sServer ID or nameβœ…β€”
--path-pPath ID or nameβœ…β€”
--name-nNew sync nameβŒβ€”
--mode-mSync mode❌download, upload, both
--diffMode-dDifference detection mode❌fast, secure
--conflictMode-cConflict resolution strategy (if mode is both)❌recent, local, remote

remove (alias: rm)​

Deletes an existing sync path.

OptionAliasDescriptionRequired
--server-sServer ID or nameβœ…
--path-pPath ID or nameβœ…

update (alias: up)​

Refreshes all configured paths on a server.

OptionAliasDescriptionRequired
--server-sServer ID or nameβœ…

flush (alias: reset)​

Clears the snapshots (previous states) of a path.

OptionAliasDescriptionRequired
--server-sServer ID or nameβœ…
--path-pPath ID or nameβœ