CLI: Library Sync Setup Commands
Overview
After pairing two devices, use these commands to set up library synchronization between them.Prerequisites
- Devices must be paired - Use
sd network pair generateandsd network pair joinfirst - At least one library exists - Use
sd library listto see available libraries - Networking must be running - Check with
sd network status - Know the device IDs - Use
sd network devicesto list paired devices
Commands
0. List Paired Devices (Get Device IDs)
First, you need to know the device ID of the paired device.--connected- Show only currently connected devices
1. Discover Remote Libraries
Discover what libraries are available on a paired device.<DEVICE_ID>- UUID of the paired device
2. Setup Library Sync
Configure library sync between local and remote devices.--local-library- UUID of your local library--remote-device- UUID of the paired device
--remote-library- UUID of the remote library to sync with (optional for register-only)--action- Sync action type (default:register-only)register-only- Just register devices (Phase 1)merge-into-local- Future (Phase 3)merge-into-remote- Future (Phase 3)create-shared- Future (Phase 3)
--leader- Which device is the sync leader (default:local)local- This device is the leaderremote- Remote device is the leader
--local-device- Override auto-detected local device ID
Complete Workflow Example
Here’s a complete workflow for pairing devices and setting up library sync:Device A (CLI Daemon)
Device B (iOS)
Output Formats
All commands support--output flag:
Common Use Cases
Scenario 1: Simple Two-Device Setup
You have a desktop and a phone, both with “My Library” auto-created.Scenario 2: Multiple Libraries
You want to choose which libraries to sync.Scenario 3: One-Way Registration
Register your device in their library without syncing data.Troubleshooting
”Device not paired"
"Device offline"
"Library not found"
"Context not available”
Integration with Other Commands
List Paired Devices
Verify Registration
After setup, the remote device should appear in your library’s device list:Advanced Usage
Custom Device ID
If you need to override the auto-detected local device ID:Specify Remote as Leader
If the remote device should be the sync leader:Future Commands (Phase 3)
When full sync is implemented, additional actions will be available:See Also
- Pairing:
sd network pair --help - Devices:
sd network devices --help - Libraries:
sd library --help - Networking:
sd network --help - Design:
docs/core/LIBRARY_SYNC_SETUP.md
