← Back to Skills Marketplace
coreyleung-art

帮助其他OpenClaw实例通过GitHub仓库实现记忆同步

by coreyleung-art · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1831
Downloads
6
Stars
5
Active Installs
1
Versions
Install in OpenClaw
/install cross-device-sync
Description
通过GitHub私有仓库自动同步OpenClaw记忆文件,实现多设备间数据的双向更新与冲突处理。
README (SKILL.md)

Cross-Device Sync Skill

通过GitHub仓库实现OpenClaw跨设备记忆同步的技能。

描述

这个技能允许用户轻松地在多个设备之间同步OpenClaw的记忆文件。通过GitHub作为中央存储库,用户可以在不同的设备上访问相同的数据。

功能

  • 自动创建跨设备同步所需的脚本
  • 配置GitHub仓库访问
  • 设置双向同步机制
  • 提供冲突处理机制
  • 自动化定时同步选项

安装

npx clawhub install cross-device-sync

使用方法

1. 初始化设置

// 设置跨设备同步
await setup_cross_device_sync({
  repoUrl: "https://github.com/username/repository.git",
  token: "your_github_personal_access_token"
});

2. 立即同步

// 立即执行同步
await sync_now();

3. 检查状态

// 检查同步状态
await check_sync_status();

详细说明

setup_cross_device_sync

此函数会引导用户完成整个设置过程:

  1. 验证GitHub仓库访问权限
  2. 克隆或更新本地仓库
  3. 创建双向同步脚本
  4. 配置OpenClaw使用同步目录
  5. 创建配置文档

sync_now

此函数执行即时双向同步:

  1. 从GitHub拉取最新更改
  2. 将本地更改合并到工作区
  3. 将本地更改推送到GitHub

check_sync_status

此函数检查同步系统的状态:

  1. 验证GitHub仓库连接
  2. 检查同步脚本是否存在
  3. 检查仓库状态
  4. 报告配置信息

安全注意事项

  • 请确保GitHub仓库是私有的以保护敏感数据
  • 妥善保管Personal Access Token
  • 定期轮换访问令牌
  • 检查同步日志以确保没有异常活动

故障排除

如果遇到同步问题:

  1. 检查网络连接
  2. 验证GitHub认证信息
  3. 查看同步日志
  4. 确认仓库权限

维护

  • 定期检查同步日志
  • 清理旧的备份文件
  • 验证数据一致性
  • 更新访问令牌
Usage Guidance
这个技能的目的(用 GitHub 同步 OpenClaw 记忆)与代码总体一致,但存在安全和实现问题 you should consider before installing: - 敏感凭证暴露:代码会把 GitHub token 直接内联进 git clone/push 命令,这会把 token 暴露给进程列表、shell 历史或 .git/config。不要在真实私人数据或长期有效 token 上运行当前实现。 - 使用更安全的替代方案:优先使用 SSH deploy key、受限 scope 的短期 PAT,或让程序使用系统的凭据管理/Git credential helper 或 GIT_ASKPASS,而不要把 token 放在命令行中。 - 在受控仓库和测试环境中先试验:先在空的、非敏感、私人或测试仓库上验证行为,确认脚本是否按预期工作并且不会泄露敏感内容。 - 修复脚本插值错误:当前生成的 bash 脚本包含字面量 ${this.workspaceDir} 与 ${this.githubRepoPath},需要在生成时把 Node 的实际路径值写入脚本(去掉反斜杠转义),否则脚本会失败或产生不良行为。 - 加密/最小化上传的数据:如果记忆包含敏感信息,应在上传前加密或对数据进行过滤;并确保仓库为私有仓库。 - 密钥轮换与日志审计:只授予最低权限,定期轮换 token,并检查 push/pull 日志以发现异常访问。 如果你不熟悉这些改动或无法检查/修复代码,建议不要在生产或包含敏感记忆的环境中启用此技能。若希望我帮忙,我可以: - 指出并给出具体的代码改写建议(如何安全地使用 Git 凭证、如何正确插入路径到生成脚本), - 给出在本地安全测试步骤清单,或提供一个改造版示例(使用 SSH 或 credential helper 而非内联 token)。
Capability Analysis
Type: OpenClaw Skill Name: cross-device-sync Version: 1.0.0 This skill is classified as suspicious due to its extensive use of `child_process.exec` to run powerful shell commands, including `git`, `rsync`, `cp`, and `rm -rf`, as seen in `index.js`. It generates and writes executable shell scripts (`bidirectional_sync.sh`, `upload_to_github.sh`) to the user's file system, which then perform file system modifications and Git operations. While these actions are aligned with the stated purpose of a 'cross-device sync' skill, the broad capabilities, direct handling of a GitHub Personal Access Token (PAT) for authentication, and the use of `rm -rf` (even if scoped to backups) present significant security risks if the skill were to be compromised or misused. There is no clear evidence of intentional malicious behavior like data exfiltration to unauthorized endpoints or covert persistence, but the high-risk capabilities warrant a 'suspicious' classification.
Capability Assessment
Purpose & Capability
技能声明通过 GitHub 在多设备间同步记忆,这与代码中执行的 git clone / pull / push、创建同步脚本、写入本地工作区等行为一致. 然而 SKILL metadata 未声明需要任何环境变量或凭证,而运行时(SKILL.md 与 index.js)确实要求提供 GitHub Personal Access Token —— 这是元数据与实现之间的不一致。
Instruction Scope
运行时指令和代码确实会在本地写入脚本和配置、执行 git pull/push、创建备份并可建议设置定时任务。实现中存在两个严重问题:1) validateRepoAccess 将 token 内联到 git clone 的 URL(通过字符串替换),这会把敏感 token 暴露在命令行/进程列表和可能的仓库配置中;2) 生成的 Bash 脚本字符串使用了转义形式 "\${this.workspaceDir}",导致脚本中会包含字面量 ${this.workspaceDir} / ${this.githubRepoPath},脚本很可能无法按预期使用(实现错误)。此外,SKILL.md/代码未强制说明如何安全地输入或存储 token(例如使用系统凭据管理或短期作用域 token)。
Install Mechanism
没有远程下载或不受信任的 install URL;项目是包含代码文件的包(package.json),没有自动从外部 URL 拉取可疑二进制。唯一依赖为 fs-extra。总体安装机制风险较低,但要注意代码会写文件并调用 shell 命令。
Credentials
请求并使用 GitHub Personal Access Token 与目的(访问私有仓库以同步数据)相称,但仓库元数据没有声明任何 required.env(不一致)。更重要的是,token 在实现中会被直接嵌入到 git 命令字符串中,存在明显的泄露风险(命令行可见、可能留在 .git/config 或 shell 日志)。建议使用更安全的方式(SSH deploy key、受限 scope 的 PAT、系统凭据存储或 GIT_ASKPASS 机制)。
Persistence & Privilege
技能没有设置 always:true,也不修改其他技能配置。唯一的持久行为是写入用户工作区目录(创建同步脚本、配置文档、备份目录)并建议添加定时任务,但它并不自动注册 crontab 或持久化到 agent 配置之外。
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cross-device-sync
  3. After installation, invoke the skill by name or use /cross-device-sync
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of Cross-Device Sync Skill. - Enables seamless synchronization of OpenClaw memory files across multiple devices using a GitHub repository. - Automates setup with script generation, GitHub access configuration, and bidirectional sync. - Provides conflict management and automated scheduled sync options. - Includes commands for setup, manual sync, and status checks. - Features security guidance and troubleshooting steps for safe and reliable usage.
Metadata
Slug cross-device-sync
Version 1.0.0
License
All-time Installs 7
Active Installs 5
Total Versions 1
Frequently Asked Questions

What is 帮助其他OpenClaw实例通过GitHub仓库实现记忆同步?

通过GitHub私有仓库自动同步OpenClaw记忆文件,实现多设备间数据的双向更新与冲突处理。 It is an AI Agent Skill for Claude Code / OpenClaw, with 1831 downloads so far.

How do I install 帮助其他OpenClaw实例通过GitHub仓库实现记忆同步?

Run "/install cross-device-sync" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 帮助其他OpenClaw实例通过GitHub仓库实现记忆同步 free?

Yes, 帮助其他OpenClaw实例通过GitHub仓库实现记忆同步 is completely free (open-source). You can download, install and use it at no cost.

Which platforms does 帮助其他OpenClaw实例通过GitHub仓库实现记忆同步 support?

帮助其他OpenClaw实例通过GitHub仓库实现记忆同步 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 帮助其他OpenClaw实例通过GitHub仓库实现记忆同步?

It is built and maintained by coreyleung-art (@coreyleung-art); the current version is v1.0.0.

💬 Comments