Clawdbot Update Skill
Comprehensive backup, update, and restore workflow for Clawdbot installations.
Repository
- - GitHub: https://github.com/clawdbot/clawdbot
- Upstream: INLINECODE0
- Local Clone:
~/code/clawdbot (default)
Description
This skill provides a complete, modular update workflow for Clawdbot with dynamic workspace detection:
- - Configuration files
- Agent states and sessions
- Credentials and auth tokens
- All agent workspaces (auto-detected from config)
- Cron jobs and sandboxes
- Git repository state
Key Features
✅ Dynamic Workspace Detection - Reads workspace paths from config
✅ Multi-Agent Support - Handles multiple agents automatically
✅ Safe Rollback - Full restore capability
✅ Git Integration - Tracks versions and remotes
✅ Validation - Pre/post checks included
✅ Dry Run - Preview before backup
Files
- -
config.json - Skill configuration (repo URLs, paths) - INLINECODE3 - Dry run preview (no changes)
- INLINECODE4 - Dynamic full backup script
- INLINECODE5 - Dynamic restore script
- INLINECODE6 - Pre/post update validation
- INLINECODE7 - Check for available updates
- INLINECODE8 - Step-by-step update checklist
- INLINECODE9 - Quick command reference
- INLINECODE10 - This file
- INLINECODE11 - Quick start guide
Dynamic Features
Both backup and restore scripts now:
- - Read workspace paths from INLINECODE12
- Support any number of agents
- Handle missing workspaces gracefully
- Generate safe filenames from agent IDs
When to Use
Trigger this skill when asked to:
- - "update clawdbot"
- "upgrade to latest version"
- "backup clawdbot before update"
- "restore clawdbot from backup"
- "rollback clawdbot update"
Usage
1. Preview Backup (Dry Run)
CODEBLOCK0
Shows:
- - What files would be backed up
- Estimated backup size
- Workspace detection results
- Disk space availability
- Files that would be skipped
No files are created or modified!
2. Create Full Backup
CODEBLOCK1
Backs up:
- -
~/.clawdbot/clawdbot.json (config) - INLINECODE14 (session state)
- INLINECODE15 (multi-agent state)
- INLINECODE16 (auth tokens)
- INLINECODE17 (scheduled jobs)
- INLINECODE18 (sandbox state)
- All agent workspaces (dynamically detected!)
- Git commit and status
Output: INLINECODE19
3. Update Clawdbot
Follow the checklist:
CODEBLOCK2
Key steps:
- 1. Create backup
- Stop gateway
- Pull latest code
- Adjust config for breaking changes
- Run doctor
- Test functionality
- Start gateway as daemon
4. Restore from Backup
CODEBLOCK3
Restores:
- - All configuration
- All state files
- All workspaces
- Optionally: git version
Important Notes
Multi-Agent Setup
This skill is designed for multi-agent setups with:
- - Multiple agents with separate workspaces
- Sandbox configurations
- Provider routing (WhatsApp/Telegram/Discord/Slack/etc.)
Breaking Changes in v2026.1.8
CRITICAL:
- - DM Lockdown: DMs now default to
pairing policy instead of open - Groups:
telegram.groups and whatsapp.groups are now allowlists - Sandbox: Default scope changed to
"agent" from implicit - Timestamps: Now UTC format in agent envelopes
Backup Validation
After backup, always verify:
CODEBLOCK4
Should contain:
- - ✅ INLINECODE24
- ✅ INLINECODE25
- ✅
workspace-*.tar.gz (one per agent)
Config Changes Required
Example: Switch WhatsApp to pairing:
CODEBLOCK5
Example: Set explicit sandbox scope:
CODEBLOCK6
Workflow
Standard Update Flow
CODEBLOCK7
Rollback Flow
CODEBLOCK8
Testing After Update
Functionality Tests
- - [ ] Provider DMs work (check pairing policy)
- [ ] Group mentions respond
- [ ] Typing indicators work
- [ ] Agent routing works
- [ ] Sandbox isolation works
- [ ] Tool restrictions enforced
New Features
CODEBLOCK9
Monitoring
CODEBLOCK10
Troubleshooting
Common Issues
Gateway won't start:
CODEBLOCK11
Auth errors:
CODEBLOCK12
Sandbox issues:
CODEBLOCK13
Emergency Restore
If something goes wrong:
CODEBLOCK14
Installation
Via ClawdHub
CODEBLOCK15
Manual
CODEBLOCK16
License
MIT - see LICENSE
Author
Pascal Schott (@pasogott)
Contribution for Clawdbot
https://github.com/clawdbot/clawdbot
Clawdbot 更新技能
Clawdbot 安装的完整备份、更新和恢复工作流程。
仓库
- - GitHub: https://github.com/clawdbot/clawdbot
- 上游: origin/main
- 本地克隆: ~/code/clawdbot (默认)
描述
该技能为 Clawdbot 提供了一个完整、模块化的更新工作流程,具备动态工作区检测功能:
- - 配置文件
- 代理状态和会话
- 凭据和认证令牌
- 所有代理工作区(从配置中自动检测)
- 定时任务和沙箱
- Git 仓库状态
主要特性
✅ 动态工作区检测 - 从配置中读取工作区路径
✅ 多代理支持 - 自动处理多个代理
✅ 安全回滚 - 完整的恢复能力
✅ Git 集成 - 追踪版本和远程仓库
✅ 验证 - 包含前后检查
✅ 预演模式 - 备份前预览
文件
- - config.json - 技能配置(仓库 URL、路径)
- backup-clawdbot-dryrun.sh - 预演预览(无更改)
- backup-clawdbot-full.sh - 动态完整备份脚本
- restore-clawdbot.sh - 动态恢复脚本
- validate-setup.sh - 更新前后验证
- check-upstream.sh - 检查可用更新
- UPDATECHECKLIST.md - 逐步更新检查清单
- QUICKREFERENCE.md - 快速命令参考
- SKILL.md - 本文件
- README.md - 快速入门指南
动态特性
备份和恢复脚本现在均:
- - 从 ~/.clawdbot/clawdbot.json 读取工作区路径
- 支持任意数量的代理
- 优雅处理缺失的工作区
- 从代理 ID 生成安全的文件名
使用时机
当被要求执行以下操作时触发此技能:
- - 更新 clawdbot
- 升级到最新版本
- 更新前备份 clawdbot
- 从备份恢复 clawdbot
- 回滚 clawdbot 更新
用法
1. 预览备份(预演)
bash
~/.skills/clawdbot-update/backup-clawdbot-dryrun.sh
显示:
- - 将备份哪些文件
- 预估备份大小
- 工作区检测结果
- 磁盘空间可用性
- 将跳过的文件
不会创建或修改任何文件!
2. 创建完整备份
bash
~/.skills/clawdbot-update/backup-clawdbot-full.sh
备份:
- - ~/.clawdbot/clawdbot.json(配置)
- ~/.clawdbot/sessions/(会话状态)
- ~/.clawdbot/agents/(多代理状态)
- ~/.clawdbot/credentials/(认证令牌)
- ~/.clawdbot/cron/(定时任务)
- ~/.clawdbot/sandboxes/(沙箱状态)
- 所有代理工作区(动态检测!)
- Git 提交和状态
输出: ~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS/
3. 更新 Clawdbot
按照检查清单操作:
bash
cat ~/.skills/clawdbot-update/UPDATE_CHECKLIST.md
关键步骤:
- 1. 创建备份
- 停止网关
- 拉取最新代码
- 调整配置以适配破坏性变更
- 运行诊断工具
- 测试功能
- 以守护进程方式启动网关
4. 从备份恢复
bash
~/.skills/clawdbot-update/restore-clawdbot.sh ~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS
恢复:
- - 所有配置
- 所有状态文件
- 所有工作区
- 可选:Git 版本
重要说明
多代理设置
该技能专为多代理设置设计,支持:
- - 多个具有独立工作区的代理
- 沙箱配置
- 提供商路由(WhatsApp/Telegram/Discord/Slack 等)
v2026.1.8 中的破坏性变更
关键:
- - DM 锁定:私信现在默认采用 pairing 策略而非开放
- 群组:telegram.groups 和 whatsapp.groups 现为允许列表
- 沙箱:默认作用域从隐式更改为 agent
- 时间戳:代理信封中现为 UTC 格式
备份验证
备份后,始终验证:
bash
BACKUP_DIR=~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS
cat $BACKUPDIR/BACKUPINFO.txt
ls -lh $BACKUP_DIR
应包含:
- - ✅ clawdbot.json
- ✅ credentials.tar.gz
- ✅ workspace-*.tar.gz(每个代理一个)
需要更改的配置
示例:将 WhatsApp 切换为配对模式:
bash
jq .whatsapp.dmPolicy = pairing ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.json
示例:设置显式沙箱作用域:
bash
jq .agent.sandbox.scope = agent ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.json
工作流程
标准更新流程
bash
1. 检查更新
~/.skills/clawdbot-update/check-upstream.sh
2. 验证当前设置
~/.skills/clawdbot-update/validate-setup.sh
3. 预演
~/.skills/clawdbot-update/backup-clawdbot-dryrun.sh
4. 备份
~/.skills/clawdbot-update/backup-clawdbot-full.sh
5. 停止网关
cd ~/code/clawdbot
pnpm clawdbot gateway stop
6. 更新代码
git checkout main
git pull --rebase origin main
pnpm install
pnpm build
7. 运行诊断工具
pnpm clawdbot doctor --yes
8. 测试
pnpm clawdbot gateway start # 前台运行用于测试
9. 部署
pnpm clawdbot gateway stop
pnpm clawdbot gateway start --daemon
回滚流程
bash
快速回滚
~/.skills/clawdbot-update/restore-clawdbot.sh
手动回滚
cd ~/code/clawdbot
git checkout
pnpm install && pnpm build
cp /clawdbot.json ~/.clawdbot/
pnpm clawdbot gateway restart
更新后测试
功能测试
- - [ ] 提供商私信正常工作(检查配对策略)
- [ ] 群组提及响应正常
- [ ] 输入指示器正常工作
- [ ] 代理路由正常工作
- [ ] 沙箱隔离正常工作
- [ ] 工具限制已生效
新功能
bash
pnpm clawdbot agents list
pnpm clawdbot logs --tail 50
pnpm clawdbot providers list --usage
pnpm clawdbot skills list
监控
bash
实时日志
pnpm clawdbot logs --follow
或 Web UI
open http://localhost:3001/logs
检查状态
pnpm clawdbot status
pnpm clawdbot gateway status
故障排除
常见问题
网关无法启动:
bash
pnpm clawdbot logs --grep error
pnpm clawdbot doctor
认证错误:
bash
OAuth 配置文件可能需要重新登录
pnpm clawdbot providers login
沙箱问题:
bash
检查沙箱配置
jq .agent.sandbox ~/.clawdbot/clawdbot.json
检查每个代理的沙箱
jq .routing.agents[] | {name, sandbox} ~/.clawdbot/clawdbot.json
紧急恢复
如果出现问题:
bash
1. 停止网关
pnpm clawdbot gateway stop
2. 完全恢复
LATEST_BACKUP=$(ls -t ~/.