Setting Up Sync
1. Create a Turso Database
If you don’t have a Turso account, sign up first. Create a database for your agent:2. Initialize with Sync
Create a new agent filesystem with sync enabled:Sync Commands
Pull Remote Changes
Download changes from Turso Cloud:Push Local Changes
Upload local changes to Turso Cloud:View Sync Status
Check sync statistics:Create Checkpoint
Force a sync checkpoint:Use Cases
Backup and Recovery
Automatically back up agent state:Multi-Machine Agents
Run agents on multiple machines with shared state:Partial Sync
For large filesystems, use partial sync to only fetch what’s needed:Partial Sync Options
| Option | Description |
|---|---|
--sync-partial-prefetch | Enable prefetching |
--sync-partial-segment-size | Segment size for partial sync |
--sync-partial-bootstrap-query | Custom bootstrap query |
--sync-partial-bootstrap-length | Bootstrap prefix length |
Authentication
Sync requires a Turso auth token. Set it via environment variable:Conflict Resolution
AgentFS uses last-write-wins for conflicts. If the same file is modified on multiple machines:- Push from Machine A succeeds
- Push from Machine B fails (conflict)
- Machine B must pull first, then push