@alfe.ai/openclaw-sync
v0.0.2
Published
AlfeSync — agent workspace backup and sync skill for OpenClaw
Downloads
166
Readme
packages/openclaw-sync (@alfe.ai/openclaw-sync)
AlfeSync — agent workspace backup and sync skill for OpenClaw.
Syncs an agent's local workspace (config, conversations, memory) to/from S3 with hash-based change detection, conflict resolution, and flexible scheduling. Works as both an OpenClaw plugin and a standalone CLI.
Key Files
src/
├── index.ts # Package exports
├── config.ts # .alfesync/config.json management
├── manifest.ts # Local/remote manifest + hash-based diff engine
├── ignore.ts # .alfesyncignore parsing (micromatch)
├── api-client.ts # Typed HTTP client (presigned URLs, manifest, stats)
├── uploader.ts # S3 upload via presigned URLs with retries
├── downloader.ts # S3 download via presigned URLs with retries
├── watcher.ts # Chokidar file watcher with debounce
├── sync-engine.ts # Orchestration (push/pull/fullSync)
├── plugin.ts # OpenClaw plugin lifecycle + gateway IPC
└── cli/
└── index.ts # Commander-based CLI (alfesync)OpenClaw Plugin
Follows the standard plugin pattern — exports id, name, activate, deactivate, configure. On activation:
- Initializes the sync engine for the workspace
- Starts a file watcher (realtime mode) or scheduled interval (hourly/daily/weekly)
- Connects to the Alfe daemon IPC for capability registration (
sync.push,sync.pull,sync.fullSync) - Registers
sync.nowandsync.statusgateway RPC methods - Gracefully degrades if the daemon is unavailable
Lifecycle hooks (openclaw.plugin.json):
- onAgentStart —
alfesync pull --quiet - onAgentStop —
alfesync push --quiet - onCompaction —
alfesync push --quiet --filter=context/
Development
pnpm install
pnpm --filter @alfe.ai/openclaw-sync buildTesting
pnpm --filter @alfe.ai/openclaw-sync testDependencies
- chokidar — file watching
- commander — CLI framework
- micromatch — glob pattern matching
See SKILL.md for full CLI usage, storage classes, conflict resolution, and programmatic API docs.
