4.9 KiB
CLI reference
CLI is the sole public operation entry. Web is a read-only daily-report viewer. No command aliases or old IPC routes are retained.
| Function | Canonical command |
|---|---|
| Authenticate/register the device and save server configuration | drosync auth --server URL --access-key-id ID (--secret-file PATH or --secret-stdin) |
| List mappings | drosync mapping list |
| Add a mapping | drosync mapping add ROOT (--bucket NAME or --space ID) [--remote-prefix P] [--include-hidden] [--require-done] |
| Remove a mapping and abort its active sessions | drosync mapping remove ID |
| Upload/resume a mapping | drosync sync [ID] |
| Preview the plan without uploading file content | drosync sync [ID] --dry-run |
| View daemon/session status | drosync status |
| View locally recorded conflicts | drosync status --conflicts |
| Pause new upload scheduling | drosync pause |
| Resume upload scheduling | drosync resume |
| Abort one session or all active sessions | drosync abort [SESSION_ID] |
| Diagnose the state database, IPC and scoped control-plane access | drosync doctor |
| Query available update metadata, without downloading | drosync update check |
| Download, verify and install the available update | drosync update install |
| Pin the allowed update version, without installing | drosync update pin VERSION |
| Clear the update pin | drosync update unpin |
| Pause client updates | drosync update pause |
| Resume client updates | drosync update resume |
| Install a verified previous package | drosync update rollback |
| Export a daily report | drosync report [--date D] [--mapping ID or --path ROOT] [--output DIR] [--format xlsx or csv] |
| Start the read-only daily-report viewer | drosync web [--mapping ID or --path ROOT] [--host H] [--port P] [--open] |
| View CLI/protocol/platform and reachable daemon version | drosync version |
| View command help | drosync [COMMAND] --help |
Global --json selects machine-readable output. --help is the sole help entry; there is no help subcommand, -h, or --version alias.
auth also accepts --profile, --device-name, --require-https, DROSYNC_ACCESS_KEY_ID and DROSYNC_SECRET. File and stdin secret inputs are mutually exclusive. Bucket and space are two target representations within the same mapping operation; exactly one is required.
sync uses the existing unfinished session when possible. There is no separate retry operation. Omitting a mapping ID is allowed only when exactly one mapping exists. Report/Web similarly require an explicit mapping or path when multiple mappings exist. They use the selected state namespace and never guess another user's database. Report export prints file paths, not an alternative terminal dashboard. Synchronization no longer automatically exports Excel files.
A preview sends a manifest and creates a control-plane plan; it is not an entirely local dry-run. Data remains local-to-BOS only.
The Web viewer serves / and read-only GET /api/report. It has no upload, pause, resume, abort, status, mapping or export endpoints. /index.html and /sync-report aliases are removed.
Select one state namespace for both CLI and daemon. By default UNIX uses the operating-system project directories; Windows system mode uses ProgramData/drosync. DROSYNC_DATA_DIR may explicitly select an absolute directory, with state.db, the UNIX socket and config/ underneath it. Service users and interactive callers must use matching directories. The Windows endpoint is \\.\pipe\drosync; choose either the MSI system-service installation or the user-startup installation, never both. There is no endpoint fallback.
Linux system packages use the service account's ~/.local/share/drosync/device-token as the explicit credential file. DROSYNC_SECRET_FILE remains available for an explicit credential-file selection; otherwise supported desktop targets use the OS credential store. No old JSON/env configuration files, default mappings or guessed token paths are auto-imported.
Retired entries: configure, plan, retry, conflicts, --non-interactive, old update flags, GUI, Web controls/exports, terminal dashboard output, automatic Excel export, multi-path state/socket discovery, configuration-based automatic initialization, and clean-install.sh. Callers must switch to the canonical command; no aliases are provided.
The daemon is started/stopped through the selected OS service manager. Linux: systemctl {start,stop,restart,status} drosync; macOS packages: one per-user LaunchAgent; Windows: the selected service or startup mode.
Exit codes remain: 0 success, 2 CLI usage, 10 credential, 20 scope/capability, 30 lease/conflict, 40 local filesystem/state, 50 network/server/unclassified errors.
报表默认导出至所选状态目录下的 reports/,也可用 --output 显式指定;不再使用 DROSYNC_REPORT_DIR 或默认写回采集目录,避免导出的报表触发采集目录上传。