名称: jasper-configguard
版本: 1.0.0
描述: 为 OpenClaw 提供安全的配置变更与自动回滚。在应用补丁前备份,重启后执行健康检查,失败时自动回滚。支持命令:patch、restore、list、diff、validate、doctor。
为 OpenClaw 提供安全的配置变更与自动回滚。从此告别网关配置损坏。
npm install -g jasper-configguard
jasper-configguard patch '{"gateway":{"bind":"tailnet"}}'
工具将执行以下步骤:
1. 备份当前配置
2. 应用补丁(深度合并)
3. 重启网关
4. 等待健康检查
5. 若网关异常,自动回滚
jasper-configguard patch --dry-run '{"agents":{"defaults":{"model":{"primary":"opus"}}}}'
jasper-configguard restore
jasper-configguard list
jasper-configguard doctor
在您的 Agent 中安全地修改 OpenClaw 配置:
# 安全切换模型
jasper-configguard patch '{"agents":{"defaults":{"model":{"primary":"anthropic/claude-opus-4-5"}}}}'
# 安全启用插件
jasper-configguard patch '{"plugins":{"entries":{"my-plugin":{"enabled":true}}}}'
# 若出现问题,立即恢复
jasper-configguard restore
const { ConfigGuard } = require('jasper-configguard');
const guard = new ConfigGuard();
// 安全应用补丁
const result = await guard.patch({ gateway: { bind: 'tailnet' } });
if (!result.success) console.log('已回滚:', result.error);
// 干运行(预览)
const preview = guard.dryRun({ agents: { defaults: { model: { primary: 'opus' } } } });
console.log(preview.diff);