Search

PythonReactSEOPDF
OpenClaw

self-upgrade

OpenClaw 自我迭代升级技能。使用场景:配置自动修复、技能更新、依赖安装、版本检查、问题预防性修复。支持安全模式(需用户确认)和自动模式(低风险操作自动执行)。

fffdz0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install fffdz/tianyi-self-upgrade

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

Self-Upgrade 技能

OpenClaw 系统的自我维护和升级能力。

核心原则

安全分级
风险等级 操作类型 执行策略
低风险 日志清理、状态检查、配置格式化 自动执行
中风险 配置字段更新、技能包安装 需用户确认
高风险 服务重启、文件删除、版本升级 必须用户明确授权
升级策略
  1. 向后兼容优先: 保留旧配置字段(标记 deprecated)而非直接删除
  2. 可回滚: 重大变更前自动备份
  3. 渐进式: 分步执行,每步验证后再继续

核心流程

1. 版本检查
# 检查当前版本
openclaw --version

# 检查配置版本
$config = Get-Content ~\.openclaw\openclaw.json | ConvertFrom-Json
$config.meta.lastTouchedVersion
2. 配置迁移

检测并迁移废弃字段:

# 示例:authToken → auth.token
if ($config.gateway.authToken) {
    $config.gateway.auth = @{ token = $config.gateway.authToken }
    $config.gateway.PSObject.Properties.Remove('authToken')
}
3. 依赖检查
# 检查必要技能
$requiredSkills = @('healthcheck', 'skill-creator', 'auto-diagnostic')
foreach ($skill in $requiredSkills) {
    if (-not (Test-Path "skills\$skill\SKILL.md")) {
        Write-Host "[MISSING] Skill: $skill"
    }
}

# 检查 npm 包版本
npm list -g openclaw
4. 自动修复

运行内置诊断:

openclaw doctor --fix
5. 备份与回滚
# 备份配置
$backupPath = "~\.openclaw\backups\openclaw-$(Get-Date -Format 'yyyyMMdd-HHmmss').json"
Copy-Item ~\.openclaw\openclaw.json $backupPath

# 回滚命令
Copy-Item $backupPath ~\.openclaw\openclaw.json

脚本工具

scripts/self-upgrade.ps1
param(
    [switch]$Auto,      # 自动模式(低风险操作)
    [switch]$DryRun,    # 仅预览,不执行
    [string]$BackupDir = "~\.openclaw\backups"
)

$ErrorActionPreference = "Stop"
$ConfigPath = "~\.openclaw\openclaw.json"

# 1. 创建备份
if (-not $DryRun) {
    if (-not (Test-Path $BackupDir)) {
        New-Item -ItemType Directory -Path $BackupDir | Out-Null
    }...

Source information

Source
github
Repository
openclaw/skills
Path
skills/fffdz/tianyi-self-upgrade
Version
—
Commit
d2e492d72a9f0c2fe9415dd58aa163762091ac41
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# Self-Upgrade 技能

OpenClaw 系统的自我维护和升级能力。

## 核心原则

### 安全分级

| 风险等级 | 操作类型 | 执行策略 |
|----------|----------|----------|
| **低风险** | 日志清理、状态检查、配置格式化 | 自动执行 |
| **中风险** | 配置字段更新、技能包安装 | 需用户确认 |
| **高风险** | 服务重启、文件删除、版本升级 | 必须用户明确授权 |

### 升级策略

1. **向后兼容优先**: 保留旧配置字段(标记 deprecated)而非直接删除
2. **可回滚**: 重大变更前自动备份
3. **渐进式**: 分步执行,每步验证后再继续

---

## 核心流程

### 1. 版本检查

```powershell
# 检查当前版本
openclaw --version

# 检查配置版本
$config = Get-Content ~\.openclaw\openclaw.json | ConvertFrom-Json
$config.meta.lastTouchedVersion
```

### 2. 配置迁移

检测并迁移废弃字段:

```powershell
# 示例:authToken → auth.token
if ($config.gateway.authToken) {
    $config.gateway.auth = @{ token = $config.gateway.authToken }
    $config.gateway.PSObject.Properties.Remove('authToken')
}
```

### 3. 依赖检查

```powershell
# 检查必要技能
$requiredSkills = @('healthcheck', 'skill-creator', 'auto-diagnostic')
foreach ($skill in $requiredSkills) {
    if (-not (Test-Path "skills\$skill\SKILL.md")) {
        Write-Host "[MISSING] Skill: $skill"
    }
}

# 检查 npm 包版本
npm list -g openclaw
```

### 4. 自动修复

运行内置诊断:

```powershell
openclaw doctor --fix
```

### 5. 备份与回滚

```powershell
# 备份配置
$backupPath = "~\.openclaw\backups\openclaw-$(Get-Date -Format 'yyyyMMdd-HHmmss').json"
Copy-Item ~\.openclaw\openclaw.json $backupPath

# 回滚命令
Copy-Item $backupPath ~\.openclaw\openclaw.json
```

---

## 脚本工具

### scripts/self-upgrade.ps1

```powershell
param(
    [switch]$Auto,      # 自动模式(低风险操作)
    [switch]$DryRun,    # 仅预览,不执行
    [string]$BackupDir = "~\.openclaw\backups"
)

$ErrorActionPreference = "Stop"
$ConfigPath = "~\.openclaw\openclaw.json"

# 1. 创建备份
if (-not $DryRun) {
    if (-not (Test-Path $BackupDir)) {
        New-Item -ItemType Directory -Path $BackupDir | Out-Null
    }...

Related skills

OpenClaw

13-Day Sprint Method

galizki

Productivity system based on Maya calendar with 13 natural tones for project management and personal development

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.