jasper-configguard

TotalClaw 作者 totalclaw v1.0.0

OpenClaw 的安全配置更改具有自动回滚功能。修补前进行备份,重启后进行运行状况检查,出现故障时自动回滚。命令:patch、restore、list、diff、validate、doctor。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~emberdesire-jasper-configguard
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~emberdesire-jasper-configguard/file -o emberdesire-jasper-configguard.md
# Jasper ConfigGuard v1.0.0

Safe config changes for OpenClaw with automatic rollback. Never brick your gateway again.

## Setup

```bash
npm install -g jasper-configguard
```

## Usage

### Apply a config change safely

```bash
jasper-configguard patch '{"gateway":{"bind":"tailnet"}}'
```

The tool will:
1. Back up your current config
2. Apply the patch (deep merge)
3. Restart the gateway
4. Wait for health check
5. **Auto-rollback** if gateway fails

### Preview changes

```bash
jasper-configguard patch --dry-run '{"agents":{"defaults":{"model":{"primary":"opus"}}}}'
```

### Restore from backup

```bash
jasper-configguard restore
```

### List backups

```bash
jasper-configguard list
```

### Check health

```bash
jasper-configguard doctor
```

## Agent Integration

Use from your agent to safely modify OpenClaw config:

```bash
# Safe model switch
jasper-configguard patch '{"agents":{"defaults":{"model":{"primary":"anthropic/claude-opus-4-5"}}}}'

# Enable a plugin safely
jasper-configguard patch '{"plugins":{"entries":{"my-plugin":{"enabled":true}}}}'

# If something breaks, restore
jasper-configguard restore
```

## API

```javascript
const { ConfigGuard } = require('jasper-configguard');
const guard = new ConfigGuard();

// Safe patch
const result = await guard.patch({ gateway: { bind: 'tailnet' } });
if (!result.success) console.log('Rolled back:', result.error);

// Dry run
const preview = guard.dryRun({ agents: { defaults: { model: { primary: 'opus' } } } });
console.log(preview.diff);
```

---

## 中文说明

# Jasper ConfigGuard v1.0.0

为 OpenClaw 提供具备自动回滚功能的安全配置更改。再也不会把你的网关弄崩。

## 安装设置

```bash
npm install -g jasper-configguard
```

## 用法

### 安全地应用配置更改

```bash
jasper-configguard patch '{"gateway":{"bind":"tailnet"}}'
```

该工具会:
1. 备份你当前的配置
2. 应用补丁(深度合并)
3. 重启网关
4. 等待健康检查
5. 如果网关失败,则**自动回滚**

### 预览更改

```bash
jasper-configguard patch --dry-run '{"agents":{"defaults":{"model":{"primary":"opus"}}}}'
```

### 从备份恢复

```bash
jasper-configguard restore
```

### 列出备份

```bash
jasper-configguard list
```

### 检查健康状态

```bash
jasper-configguard doctor
```

## 代理集成

在你的代理中使用它来安全地修改 OpenClaw 配置:

```bash
# 安全切换模型
jasper-configguard patch '{"agents":{"defaults":{"model":{"primary":"anthropic/claude-opus-4-5"}}}}'

# 安全地启用插件
jasper-configguard patch '{"plugins":{"entries":{"my-plugin":{"enabled":true}}}}'

# 如果出现问题,进行恢复
jasper-configguard restore
```

## API

```javascript
const { ConfigGuard } = require('jasper-configguard');
const guard = new ConfigGuard();

// Safe patch
const result = await guard.patch({ gateway: { bind: 'tailnet' } });
if (!result.success) console.log('Rolled back:', result.error);

// Dry run
const preview = guard.dryRun({ agents: { defaults: { model: { primary: 'opus' } } } });
console.log(preview.diff);
```