← 返回
开发者工具 中文

clawsync

Git-first backup, migration, restore, and token-protected archive serving for OpenClaw state. Highlights: complete Git-native workflow (`git init/push/pull/m...
Git优先的OpenClaw状态备份、迁移、恢复及令牌保护归档服务。亮点:完整Git原生工作流(git init/push/pull...)
linsheng9731
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 541
下载
💾 4
安装
1
版本
#latest

概述

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, and merge commands for branch-based backup and restore.
  • Fine-grained backup scope control: supports --include, --exclude, --ignore-paths, and --workspace-include-globs to 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-first merge with 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 <git-url> --repo-dir ~/.clawsync-repo
clawsync push --repo-dir ~/.clawsync-repo
clawsync pull --repo-dir ~/.clawsync-repo --branch <branch> --dry-run
clawsync pull --repo-dir ~/.clawsync-repo --branch <branch> --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 "<secret>" --port 7373

Endpoints:

  • GET /health (no token)
  • GET / (simple web UI, token required)
  • GET /archives (token required)
  • GET /download/ (token required)
  • POST /upload (token required)
  • POST /backup (localhost-only)
  • POST /restore/?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.sh when needed

Agent Execution Checklist

When executing restore/migration for users:

  1. Always run --dry-run first.
  2. Show user high-risk paths summary before apply.
  3. Apply with --yes only after explicit confirmation.
  4. If env vars are missing after restore, ask user to run printed source command.
  5. 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 --token as sensitive; do not share token publicly.
  • Do not expose serve endpoint directly to public internet without TLS/reverse proxy.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-19 20:45 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,157
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,174
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,799