%USERPROFILE%\.openclaw\workspace\skills或者在 shell下执行打开自定义skills技能目录
cd ~/.openclaw/workspace/skills
explorer .2.正常打包目录:
# 打包技能目录
Compress-Archive -Path "$env:USERPROFILE\.openclaw\workspace\skills" -DestinationPath "skills_backup.zip"3.在新电脑上解压到相同位置
Expand-Archive -Path "skills_backup.zip" -DestinationPath "$env:USERPROFILE\.openclaw\workspace\" -Force4.重启 OpenClaw
openclaw gateway restart后续,如果需要覆盖打包:
# 加上 -Force 参数覆盖
Compress-Archive -Path "$env:USERPROFILE\.openclaw\workspace\skills" -DestinationPath "skills_backup.zip" -Force后续,如果需要追加更新打包:
# -Update 追加更新
Compress-Archive -Path "$env:USERPROFILE\.openclaw\workspace\skills" -DestinationPath "skills_backup.zip" -Update例如以下安装的自定义技能:
| 技能名称 | 说明 |
|---|---|
| excel-xlsx | Excel / XLSX 文件处理 |
| github | GitHub CLI 交互 |
| obsidian | Obsidian 笔记库操作 |
| playwright | 浏览器自动化 |
| self-improving | 自我改进代理 |
| summarize | URL/文件摘要 |
| superpowers-mode | 超能力模式 |
| 技能 | 需要安装的工具 |
|---|---|
| github | gh CLI |
| obsidian | obsidian-cli |
| excel-xlsx | Python + openpyxl |
| playwright | Playwright 浏览器 |
| summarize | summarize CLI |
| weather | 无(纯 API) |
以上自定义技能,虽然恢复技能了,但是依赖环境还需要安装,一键安装脚本如下:
# 检查所有依赖是否安装
gh --version # GitHub CLI
python --version # Python
pip show openpyxl # openpyxl
playwright --version # Playwright# 创建安装脚本
$deps = @(
"winget install GitHub.cli --accept-source-agreements --accept-package-agreements",
"winget install Python.Python.3.12 --accept-source-agreements --accept-package-agreements",
"pip install openpyxl pandas xlsxwriter playwright",
"playwright install chromium",
"npm install -g obsidian-cli"
)
foreach ($cmd in $deps) {
Write-Host "Installing: $cmd" -ForegroundColor Cyan
Invoke-Expression $cmd
}
Write-Host "`n✅ All dependencies installed!" -ForegroundColor Green✅ 可以备份的(配置/数据)
| 依赖 | 可备份内容 | 备份路径 |
|---|---|---|
| gh CLI | 登录配置、别名 | ~/.config/gh/ |
| Python pip | 已安装包列表 | pip freeze > requirements.txt |
| npm 全局包 | 已安装包列表 | npm list -g --depth=0 |
| Playwright | 浏览器缓存 | ~/.cache/ms-playwright/ |
❌ 建议重新安装的(程序本身)
| 依赖 | 原因 |
|---|---|
| Python | 涉及系统路径、环境变量、注册表 |
| gh CLI | 涉及系统 PATH |
| npm 全局包 | 涉及 Node.js 版本、系统路径 |
原创文章,作者:开心电脑网,如若转载,请注明出处。