Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

git-backup

v1.0.0

Backup OpenClaw workspace files (docs, memory, skills) to a private Git repo (Gitee/GitHub/GitLab) for data safety and migration.

0· 385· 1 versions· 1 current· 1 all-time· Updated 3h ago· MIT-0

Git Backup

Backup OpenClaw agent workspace to Git repository for data safety and migration capability.

Author: 徐琛 (nicolasxu93@163.com)
License: Apache 2.0

⚠️ 使用前必读

使用此技能前,你需要准备:

信息如何获取
Git 平台 TokenGitee: https://gitee.com/profile/personal_access_tokens<br>GitHub: https://github.com/settings/tokens<br>GitLab: https://gitlab.com/-/profile/personal_access_tokens
Git 用户名你的 Git 平台用户名
Agent 名称你的 agent 标识符(用于仓库命名)

Token 权限要求:

  • projects / repo - 创建和管理仓库
  • user_info / read:user - 读取用户信息

Quick Start

1. 创建仓库

# Gitee
curl -X POST "https://gitee.com/api/v5/user/repos" \
  -H "Content-Type: application/json" \
  -d '{
    "access_token": "YOUR_TOKEN",
    "name": "openclaw-agent-YOUR_AGENT_NAME",
    "description": "OpenClaw Agent Backup",
    "private": true,
    "auto_init": true
  }'

# GitHub (使用 gh cli)
gh repo create openclaw-agent-YOUR_AGENT_NAME --private --description "OpenClaw Agent Backup"

2. 执行备份

export GITEE_TOKEN="your_token_here"
export GITEE_REPO="https://gitee.com/YOUR_USERNAME/openclaw-agent-YOUR_AGENT_NAME.git"
export AGENT_NAME="your_agent_name"

./scripts/backup-to-gitee.sh "Backup message"

3. 配置自动备份(可选)

在你的 HEARTBEAT.md 中添加:

### 文件变更检测与备份
- 检查核心文件变更时自动备份
- 脚本: /path/to/git-backup/scripts/watch-and-backup.sh

备份内容

类型文件
核心文档AGENTS.md, SOUL.md, IDENTITY.md, USER.md, MEMORY.md, TOOLS.md, HEARTBEAT.md
记忆memory/ 目录
技能skills/ 目录

不备份: 数据库、任务脚本、临时文件、.env、密钥等

脚本说明

脚本用途
setup-gitee.sh初始化配置(创建仓库、保存配置)
backup-to-gitee.sh执行备份
create-repo.sh快速创建仓库工具
watch-and-backup.sh文件变更监控(用于心跳检测)

环境变量

变量必需说明
GITEE_TOKENGit 平台的 Personal Access Token
GITEE_REPO仓库 URL
AGENT_NAMEAgent 标识符
WORKSPACE_DIR工作区路径,默认 ~/.openclaw/workspace

安全提示

  1. 不要将 Token 提交到公开仓库
  2. 使用环境变量或配置文件存储敏感信息
  3. 定期轮换 Token
  4. 使用私有仓库备份敏感数据

支持的平台

  • ✅ Gitee(默认)
  • ✅ GitHub(修改 API 端点即可)
  • ✅ GitLab(修改 API 端点即可)
  • ✅ 自建 Git 服务器

Version tags

latestvk97ce9te9mg7fxdzqbnk2q51w182fsq8