Xpersona
C

clawmerge

CLAWHUB · Unverified

OpenClaw workspace 备份/恢复/合并工具。 支持:完整备份、合并恢复(不覆盖已有)、Cron 任务备份、会话记录备份、配置导出。 新增:灾难备份包含系统配置 + workspace + sessions;恢复默认安全合并,避免误覆盖运行配置。 触发词:「备份」「恢复」「迁移」「换电脑」「导出配置... Skill: clawmerge Owner: sinoslug Summary: OpenClaw workspace 备份/恢复/合并工具。 支持:完整备份、合并恢复(不覆盖已有)、Cron 任务备份、会话记录备份、配置导出。 新增:灾难备份包含系统配置 + workspace + sessions;恢复默认安全合并,避免误覆盖运行配置。 触发词:「备份」「恢复」「迁移」「换电脑」「导出配置... Tags: latest:4.0.2 Version history: v4.0.2 | 2026-05-04T13:55:06.432Z | user v4.0.2: Add manual backup/restore instructions, OpenClaw natural-language usage examples, safer restore-mode documentation, and publish chec

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s1767tsjgz8fkahkcjz0faka4583kajy:clawmerge
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-sinoslug-clawmerge/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

71,799 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: clawmerge
version: 4.0.2
description: |
  OpenClaw workspace 备份/恢复/合并工具。
  支持:完整备份、合并恢复(不覆盖已有)、Cron 任务备份、会话记录备份、配置导出。
  新增:灾难备份包含系统配置 + workspace + sessions;恢复默认安全合并,避免误覆盖运行配置。
  触发词:「备份」「恢复」「迁移」「换电脑」「导出配置」「合并记忆」「灾难备份」。
  当 workspace 需要迁移、定期备份、或从另一台设备恢复时使用。
---

# Clawmerge - Workspace 备份/恢复工具

> 换电脑不丢记忆,恢复默认不覆盖重要文件。

---

## 使用方式总览

Clawmerge 有两种使用方式:

1. **手动命令行使用**:你直接在服务器终端运行脚本,适合明确知道要备份/恢复哪个文件。
2. **通过 OpenClaw 调用技能**:你直接对 OpenClaw 说“帮我做灾难备份/恢复检查/合并恢复”,由助手先判断风险,再调用脚本或给出确认步骤。

---

## 手动备份模式

### 1. 普通 workspace 备份

只备份当前 workspace:记忆、人格、脚本、skills、配置模板等。

```bash
cd ~/.openclaw/workspace
bash skills/clawmerge/scripts/one-click-backup.sh ~/backups/workspace-$(date +%Y%m%d).tar.gz
```

适合:日常备份、改脚本前留档、迁移一部分 workspace。

### 2. 普通 workspace 备份预览

```bash
bash skills/clawmerge/scripts/one-click-backup.sh ~/backups/test.tar.gz --dry-run
```

只预览,不创建备份。

### 3. 灾难完整备份

备份范围更大:workspace + system config + cron + agent auth + sessions。

```bash
bash skills/clawmerge/scripts/one-click-full-backup.sh ~/openclaw-disaster-backup.tar.gz
```

适合:重装系统前、迁移整台 OpenClaw、重大升级前。

### 4. 灾难完整备份但排除 sessions

```bash
bash skills/clawmerge/scripts/one-click-full-backup.sh ~/openclaw-disaster-backup.tar.gz --no-sessions
```

适合:想减小备份体积,或者不需要历史会话。

### 5. 灾难完整备份预览

```bash
bash skills/clawmerge/scripts/one-click-full-backup.sh ~/openclaw-disaster-backup.tar.gz --dry-run
```

---

## 手动恢复模式

### 1. 普通 workspace 恢复(合并/安全)

```bash
cd ~/.openclaw/workspace
bash skills/clawmerge/scripts/one-click-restore.sh /path/to/workspace-backup.tar.gz --dry-run
bash skills/clawmerge/scripts/one-click-restore.sh /path/to/workspace-backup.tar.gz --merge
```

建议先 `--dry-run`,确认内容后再 `--merge`。

### 2. 灾难恢复预览

```bash
bash skills/clawmerge/scripts/one-click-full-restore.sh /path/to/openclaw-disaster-backup.tar.gz --dry-run
```

只检查备份包和恢复计划,不修改任何文件。

### 3. 灾难恢复(默认安全模式)

```bash
bash skills/clawmerge/scripts/one-click-full-restore.sh /path/to/openclaw-disaster-backup.tar.gz
```

默认安全模式会:

- `openclaw.json`、`.env`、cron、agent auth → 放入 `~/.openclaw/restore-candidates/<timestamp>/`
- sessions → 放入 `~/.openclaw/agents/main/sessions-restored-<timestamp>/`
- workspace → 解压时跳过已有文件,避免覆盖当前记忆/人格

### 4. 灾难恢复(危险全覆盖模式)

```bash
bash skills/clawmerge/scripts/one-click-full-restore.sh /path/to/openclaw-disaster-backup.tar.gz --unsafe-overwrite
```

只有在你明确要用备份覆盖当前运行环境时才使用。它可能覆盖:

- `~/.openclaw/openclaw.json`
- cron jobs
- workspace 文件
- live sessions

---

## 通过 OpenClaw 调用技能

你可以直接这样说:

### 备份类

- “用 clawmerge 给当前 workspace 做一次备份”
- “做一次灾难备份,包含 sessions”
- “做一次灾难备份,但不要包含 sessions”
- “先 dry-run 看看灾难备份会包含什么”

### 恢复类

- “检查这个备份包能不能恢复:/path/to/backup.tar.gz”
- “用 clawmerge 对这个备份包做 dry-run 恢复检查”
- “从这个灾难备份里安全恢复记忆和人格”
- “把 sessions 从备份里解出来,但不要合并到当前 live sessions”

### 高风险恢复类

如果涉及覆盖当前配置、启用 cron、外发消息、恢复 token、覆盖 live sessions,OpenClaw 应该先确认,不应直接执行。

示例:

> “用 clawmerge 从 `/home/admin/.openclaw/disaster-backup-2026-05-02.tar.gz` 安全恢复,重点恢复记忆和人格,不要启用定时任务。”

OpenClaw 应执行:

1. 先做当前快照
2. `tar -tzf` 检查备份结构
3.

_meta.json

{
  "ownerId": "kn75j1gn2h0kzncm5aykxyde39823cs6",
  "slug": "clawmerge",
  "version": "4.0.2",
  "publishedAt": 1777902906432
}

scripts/INSTALL-CONFIG-TOOLS.md

# 安装配置工具指南

## 📦 ClawMerge v2.3.1+ 配套工具

ClawMerge v2.3.1 开始支持**自动导出公开配置**功能,需要安装以下配套脚本。

---

## 🚀 快速安装

### 方法 1:从 workspace 复制(推荐)

如果你已经从 workspace 备份恢复,脚本应该已经存在:

```bash
# 检查是否已安装
ls -la ~/.openclaw/workspace/scripts/export-public-config.py
```

如果不存在,从备份中提取:

```bash
# 从最新备份中提取
cd /tmp
tar -xzf ~/backups/clawmerge-*.tar.gz workspace/scripts/export-public-config.py
mv workspace/scripts/export-public-config.py ~/.openclaw/workspace/scripts/
```

### 方法 2:从 ClawHub 技能包中提取

```bash
# 安装 clawmerge 技能
clawhub install clawmerge

# 提取脚本
cp ~/.openclaw/workspace/skills/clawmerge/scripts/../../scripts/export-public-config.py \
   ~/.openclaw/workspace/scripts/
```

---

## 📋 安装验证

### 检查文件是否存在

```bash
# 检查导出脚本
ls -la ~/.openclaw/workspace/scripts/export-public-config.py

# 检查 configs 目录
ls -la ~/.openclaw/workspace/configs/
```

### 测试导出功能

```bash
# 手动运行一次
python3 ~/.openclaw/workspace/scripts/export-public-config.py

# 应该输出:
# 📋 Export Public Configuration
# ✅ 配置已导出:public-config.json
```

### 测试自动导出

```bash
# 运行备份(会自动导出)
cd ~/.openclaw/workspace/skills/clawmerge/scripts
./one-click-backup.sh --dry-run

# 应该看到:
# [0/5] Exporting public configuration...
# ✓ Public configuration exported
```

---

## 📁 文件结构

安装后的完整结构:

```
~/.openclaw/workspace/
├── scripts/
│   └── export-public-config.py  # ✅ 配置导出脚本
├── configs/
│   └── public-config.json       # ✅ 导出的公开配置
└── skills/
    └── clawmerge/
        └── scripts/
            └── one-click-backup.sh  # ✅ 备份脚本(v2.3.1+)
```

---

## ⚠️ 常见问题

### 问题 1:脚本不存在

**错误信息**:
```
[0/5] Exporting public configuration...
ℹ Export script not found (v2.3.0+ feature)
```

**解决方法**:
```bash
# 安装导出脚本
# 参考上面的"快速安装"部分
```

### 问题 2:configs 目录不存在

**错误信息**:
```
Permission denied: /home/user/.openclaw/workspace/configs
```

**解决方法**:
```bash
# 手动创建目录
mkdir -p ~/.openclaw/workspace/configs
```

### 问题 3:导出失败

**错误信息**:
```
⚠ Export script ran but may have warnings
```

**解决方法**:
```bash
# 查看详细错误
python3 ~/.openclaw/workspace/scripts/export-public-config.py

# 检查 openclaw.json 是否存在
ls -la ~/.openclaw/openclaw.json
```

---

## 🎯 功能说明

### 自动导出(v2.3.1+)

备份时自动执行:

```bash
./one-click-backup.sh
# 自动:
# [0/5] 导出公开配置
# [1/5] 导出 cron 任务
# ...
```

### 手动导出

也可以手动运行:

```bash
python3 export-public-config.py
```

---

## 📊 导出内容

**包含**:
- ✅ 股票持仓列表(38 只)
- ✅ 薛斯通道参数(N=102, M=7)
- ✅ 推送目标群 ID(2 个)
- ✅ Heartbeat 规则(重试 3 次)

**不包含**:
- ❌ API keys(用占位符标注)
- ❌ Gateway tokens
- ❌ 个人隐私信息

---

## 🔗 相关文档

- [CONFIG-BACKUP-GUIDE.md](../../../scripts/CONFIG-BACKUP-GUIDE.md) - 完整使用指南
- [SKILL.md](../SKILL.md) - ClawMerge 技能文档

---

**创建时间**:2026-03-22  
**版本**:v2.3.1  
**维护者**:小虾 🦐

PUBLISHING.md

# Clawmerge Publishing Checklist

ClawHub CLI v0.12.x does **not** support `clawhub skill publish --dry-run`.
Use this checklist before publishing.

## Preflight

```bash
cd ~/.openclaw/workspace

grep -E '^(name|version):' skills/clawmerge/SKILL.md
bash -n skills/clawmerge/scripts/*.sh
python3 -m py_compile skills/clawmerge/scripts/*.py
openclaw skills info clawmerge
```

## Safety smoke tests

```bash
# backup preview
bash skills/clawmerge/scripts/one-click-full-backup.sh /tmp/clawmerge-test.tar.gz --dry-run

# if you have a backup file, restore preview only
bash skills/clawmerge/scripts/one-click-full-restore.sh /path/to/backup.tar.gz --dry-run
```

## Publish

```bash
clawhub whoami
clawhub skill publish skills/clawmerge \
  --slug clawmerge \
  --name clawmerge \
  --version <version> \
  --changelog '<changelog>'
```

## Verify after publish

```bash
clawhub inspect clawmerge --json
clawhub search clawmerge --limit 5
```

## Policy

- Do not claim publish dry-run support unless the installed `clawhub` CLI actually supports it.
- Prefer a patch version bump for documentation/safety changes.
- Disaster restore defaults must remain safe; destructive live overwrite requires `--unsafe-overwrite`.

skill-card.md

## Description:

clawmerge helps OpenClaw users back up, restore, and safely merge workspace files, disaster backups, cron configuration, sessions, and exported configuration.

This skill is ready for commercial/non-commercial use.

## Publisher:

[sinoslug](https://clawhub.ai/user/sinoslug)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and OpenClaw operators use clawmerge to migrate, back up, inspect, and safely restore OpenClaw workspaces, sessions, cron definitions, and system configuration. It is intended for routine backups, device migration, disaster recovery, and merge-style restoration that avoids overwriting existing workspace files by default.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Backup archives can contain secrets, sessions, and agent or system configuration.

Mitigation: Treat every backup archive as secret and executable, keep disaster backups encrypted and private, and avoid sharing archives with untrusted parties.

Risk: Restoring from an untrusted archive can reintroduce persistent executable content such as skills, cron definitions, scripts, or dependencies.

Mitigation: Prefer dry-run first, inspect the archive contents, and review restored memory, skills, cron entries, and dependencies before activation.

Risk: Unsafe restore mode can overwrite live OpenClaw configuration, cron jobs, workspace files, sessions, or credentials.

Mitigation: Use the default safe merge and restore-candidate flow unless explicit overwrite is required, and create a current snapshot before using --unsafe-overwrite.

Risk: restore-task-scripts.sh can change cron configuration and install packages.

Mitigation: Avoid restore-task-scripts.sh unless the operator intentionally wants those persistent changes and has reviewed the restored scripts and dependency list.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/sinoslug/skills/clawmerge)
- [Usage documentation](USAGE.md)

## Skill Output:

**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Guidance]

**Output Format:** [Markdown guidance with inline shell commands and file paths]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May recommend dry-run checks, archive inspection, staged restore candidates, and explicit confirmation before high-risk restore actions.]

## Skill Version(s):

4.0.2 (source: frontmatter, server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to clawmerge and adjacent AI workflows.