clawsync
/install clawgitsync
clawsync Skill
clawsync provides backup/migration workflows for OpenClaw with Git-native sync and safer restore behavior.
Install
One-click install (GitHub Releases)
curl -fsSL "https://raw.githubusercontent.com/linsheng9731/clawsync/main/scripts/install.sh" | CLAWSYNC_GH_REPO="linsheng9731/clawsync" bash
Install a specific version:
curl -fsSL "https://raw.githubusercontent.com/linsheng9731/clawsync/main/scripts/install.sh" | CLAWSYNC_GH_REPO="linsheng9731/clawsync" bash -s -- v0.1.8
Default install path: ~/.local/bin/clawsync (override with CLAWSYNC_INSTALL_DIR). Ensure this path is in your PATH.
Local development install
npm install
npm run build
npm link
clawsync --help
Feature Highlights
- More complete Git-native workflow: first-class
clawsync git init,push,pull, andmergecommands for branch-based backup and restore. - Fine-grained backup scope control: supports
--include,--exclude,--ignore-paths, and--workspace-include-globsto precisely control what is archived. - Built-in sensitive data sanitization pipeline: supports placeholder replacement for secrets and env recovery script guidance after restore.
- Richer restore strategies: supports
overwrite,skip, and local-firstmergewith safety defaults (--dry-run, pre-restore snapshot, gateway token preservation).
When To Use
Use this skill when user asks to:
- back up OpenClaw state to Git or local archive
- migrate OpenClaw data to another machine
- restore from archive or Git branch
- run periodic backups
- prune old remote backup branches (e.g. keep last 30 days)
- expose backup archives via local HTTP service
Core Commands
1) Local full migration archive (recommended for machine migration)
clawsync profile full-migrate --dry-run
clawsync profile full-migrate
Default output: ~/.openclaw/migrations
Default behavior: workspace/ is collected in full for migration.
2) Git-based sync
clawsync git init --repo-url \x3Cgit-url> --repo-dir ~/.clawsync-repo
clawsync push --repo-dir ~/.clawsync-repo
clawsync pull --repo-dir ~/.clawsync-repo --branch \x3Cbranch> --dry-run
clawsync pull --repo-dir ~/.clawsync-repo --branch \x3Cbranch> --yes
clawsync git prune-branches --repo-dir ~/.clawsync-repo --keep-days 30 --dry-run
3) Restore from local archive
clawsync unpack --from /path/to/archive.tar.gz --dry-run
clawsync unpack --from /path/to/archive.tar.gz --yes
4) Token-protected archive server
clawsync serve --token "\x3Csecret>" --port 7373
Endpoints:
GET /health(no token)GET /(simple web UI, token required)GET /archives(token required)GET /download/\x3Cfilename>(token required)POST /upload(token required)POST /backup(localhost-only)POST /restore/\x3Cfilename>?dry_run=1|confirm=1(localhost-only)
Restore Safety Model
For unpack / pull / merge, the CLI defaults to:
- high-risk restore confirmation (unless
--yes) - pre-restore snapshot in
/tmp(unless--no-pre-snapshot) - preserve local
gateway.auth.token(unless--overwrite-gateway-token) - check missing env vars and print
source env-export.shwhen needed
Agent Execution Checklist
When executing restore/migration for users:
- Always run
--dry-runfirst. - Show user high-risk paths summary before apply.
- Apply with
--yesonly after explicit confirmation. - If env vars are missing after restore, ask user to run printed
sourcecommand. - If env vars are already loaded, report gateway status and reconnect reminders.
Security Notes
- Archives may contain sensitive data (
openclaw.json, credentials, sessions). - Keep remotes private.
- Treat
serve --tokenas sensitive; do not share token publicly. - Do not expose
serveendpoint directly to public internet without TLS/reverse proxy.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install clawgitsync - 安装完成后,直接呼叫该 Skill 的名称或使用
/clawgitsync触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
clawsync 是什么?
Git-first backup, migration, restore, and token-protected archive serving for OpenClaw state. Highlights: complete Git-native workflow (`git init/push/pull/m... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 231 次。
如何安装 clawsync?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install clawgitsync」即可一键安装,无需额外配置。
clawsync 是免费的吗?
是的,clawsync 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
clawsync 支持哪些平台?
clawsync 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 clawsync?
由 linsheng9731(@linsheng9731)开发并维护,当前版本 v1.0.0。