Install
openclaw skills install openclaw-config-manager-skill提供智能备份、恢复、迁移及Git版本控制,支持加密存储与权限管理的OpenClaw配置管理工具。
openclaw skills install openclaw-config-manager-skillOpenClaw配置管理Skill,提供完整的配置备份、恢复、迁移和版本控制功能。
clawhub install openclaw-config-manager
# 克隆仓库
git clone https://github.com/wisdom-wozoy/openclaw-config-manager.git
# 安装依赖
cd openclaw-config-manager
npm install
# 注册Skill
openclaw skills register ./openclaw-config-manager
/config git init --url https://github.com/your-username/your-repo
/config backup --git --message "初始配置备份"
/config restore --git --url https://github.com/your-username/your-repo
# 备份到Git
/config backup --git --message "备份说明"
# 备份到本地文件
/config backup --output ./backup-$(date +%Y%m%d).tar.gz
# 定时备份
/config backup --schedule "0 2 * * *" # 每天凌晨2点
# 从Git恢复
/config restore --git --url https://github.com/username/repo
# 从文件恢复
/config restore --input ./backup.tar.gz
# 恢复特定版本
/config restore --git --commit v1.0.0
# 迁移到新服务器
/config migrate --target ssh://user@new-server --env production
# 测试迁移
/config migrate --dry-run --target ssh://user@new-server
# 初始化Git仓库
/config git init --url <repository-url>
# 推送更新
/config git push --message "更新说明"
# 拉取更新
/config git pull
# 查看历史
/config git log --oneline
# 创建标签
/config git tag --name v1.0.0 --message "版本1.0.0"
# 加密敏感信息
/config secrets --encrypt --output ./secrets.enc
# 解密敏感信息
/config secrets --decrypt --input ./secrets.enc
# 轮换密钥
/config secrets --rotate
在 openclaw.json 中添加:
{
"skills": {
"openclaw-config-manager": {
"backup": {
"schedule": "0 2 * * *",
"retention": 30,
"include": ["agents", "workspaces", "config"],
"exclude": ["logs", "temp", "cache"]
},
"git": {
"repository": "https://github.com/username/repo.git",
"branch": "main",
"autoPush": true
},
"security": {
"encryption": "aes-256-gcm",
"keyRotation": 90
}
}
}
}
# Git认证
export OPENCLAW_GIT_TOKEN="your-github-token"
export OPENCLAW_GIT_SSH_KEY="~/.ssh/id_ed25519"
# 加密密钥
export OPENCLAW_ENCRYPTION_KEY="your-encryption-key"
# 备份存储
export OPENCLAW_BACKUP_PATH="/backups/openclaw"
# 设置定时备份
/config backup --schedule "0 2 * * *" --git --auto-push
# 手动触发备份
/config backup --now
# 1. 在源环境备份
/config backup --output ./migration.tar.gz
# 2. 传输到目标环境
scp ./migration.tar.gz user@new-server:/tmp/
# 3. 在目标环境恢复
/config restore --input /tmp/migration.tar.gz
# 1. 初始化团队仓库
/config git init --url https://github.com/team/openclaw-config
# 2. 添加团队成员
/config git collaborators --add user1@example.com --role admin
/config git collaborators --add user2@example.com --role maintainer
# 3. 设置分支保护
/config git protect --branch main --require-review --require-checks
# 1. 从最新备份恢复
/config restore --git --latest
# 2. 验证恢复
/config validate --full
# 3. 启动服务
openclaw gateway restart
# 启用增量备份
/config backup --incremental --git
# 查看备份差异
/config diff --commit1 HEAD~1 --commit2 HEAD
# 验证配置完整性
/config validate --full
# 检查配置语法
/config validate --syntax
# 测试配置功能
/config validate --test
# 监控配置变更
/config monitor --watch
# 设置变更告警
/config monitor --alert email --recipient admin@example.com
# 检查Git配置
/config git status
# 重新配置认证
/config git auth --token new-token
# 强制推送
/config git push --force
# 查看恢复日志
/config restore --log-level debug
# 尝试分步恢复
/config restore --step-by-step
# 使用备份验证
/config backup --verify
# 检查文件权限
/config validate --permissions
# 修复权限
/config fix --permissions
# 以管理员运行
sudo /config restore --input ./backup.tar.gz
# 启用详细日志
/config backup --verbose --debug
# 查看Skill状态
/config status --detailed
openclaw-config-manager/
├── SKILL.md # Skill说明文档
├── package.json # Skill配置
├── src/
│ ├── commands/ # 命令实现
│ │ ├── backup.js # 备份命令
│ │ ├── restore.js # 恢复命令
│ │ ├── migrate.js # 迁移命令
│ │ └── git.js # Git集成命令
│ ├── utils/ # 工具函数
│ │ ├── config.js # 配置处理
│ │ ├── security.js # 安全处理
│ │ └── validation.js # 验证工具
│ └── templates/ # 模板文件
│ ├── openclaw.json.template
│ └── secrets.env.template
├── scripts/ # 辅助脚本
│ ├── deploy.sh
│ ├── restore.sh
│ └── backup.sh
└── docs/ # 文档
├── README.md
├── QUICKSTART.md
└── API.md
// 添加新命令示例
module.exports = {
name: 'custom-command',
description: '自定义命令',
async execute(args, context) {
// 命令逻辑
}
};
MIT License