
Clawdbot Skill Update
- 11 installs
- 638 repo stars
- Updated March 7, 2026
- sundial-org/awesome-openclaw-skills
Helps with ai & agent building tasks during AI-assisted development.
About
clawdbot-skill-update is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- clawdbot-skill-update
- AI & Agent Building
- AI-coding skill
Clawdbot Skill Update by the numbers
- 11 all-time installs (skills.sh)
- Ranked #11,758 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sundial-org/awesome-openclaw-skills --skill clawdbot-skill-updateAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 11 |
|---|---|
| repo stars | ★ 638 |
| Last updated | March 7, 2026 |
| Repository | sundial-org/awesome-openclaw-skills ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Clawdbot Update Skill
Comprehensive backup, update, and restore workflow for Clawdbot installations.
Repository
- GitHub: https://github.com/clawdbot/clawdbot
- Upstream:
origin/main - 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)backup-clawdbot-dryrun.sh- Dry run preview (no changes)backup-clawdbot-full.sh- Dynamic full backup scriptrestore-clawdbot.sh- Dynamic restore scriptvalidate-setup.sh- Pre/post update validationcheck-upstream.sh- Check for available updatesUPDATE_CHECKLIST.md- Step-by-step update checklistQUICK_REFERENCE.md- Quick command referenceSKILL.md- This fileREADME.md- Quick start guide
Dynamic Features
Both backup and restore scripts now:
- Read workspace paths from
~/.clawdbot/clawdbot.json - 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)
~/.skills/clawdbot-update/backup-clawdbot-dryrun.shShows:
- 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
~/.skills/clawdbot-update/backup-clawdbot-full.shBacks up:
~/.clawdbot/clawdbot.json(config)~/.clawdbot/sessions/(session state)~/.clawdbot/agents/(multi-agent state)~/.clawdbot/credentials/(auth tokens)~/.clawdbot/cron/(scheduled jobs)~/.clawdbot/sandboxes/(sandbox state)- All agent workspaces (dynamically detected!)
- Git commit and status
Output: ~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS/
3. Update Clawdbot
Follow the checklist:
cat ~/.skills/clawdbot-update/UPDATE_CHECKLIST.mdKey steps: 1. Create backup 2. Stop gateway 3. Pull latest code 4. Adjust config for breaking changes 5. Run doctor 6. Test functionality 7. Start gateway as daemon
4. Restore from Backup
~/.skills/clawdbot-update/restore-clawdbot.sh ~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSSRestores:
- 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
pairingpolicy instead of open - Groups:
telegram.groupsandwhatsapp.groupsare now allowlists - Sandbox: Default scope changed to
"agent"from implicit - Timestamps: Now UTC format in agent envelopes
Backup Validation
After backup, always verify:
BACKUP_DIR=~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS
cat "$BACKUP_DIR/BACKUP_INFO.txt"
ls -lh "$BACKUP_DIR"Should contain:
- ✅
clawdbot.json - ✅
credentials.tar.gz - ✅
workspace-*.tar.gz(one per agent)
Config Changes Required
Example: Switch WhatsApp to pairing:
jq '.whatsapp.dmPolicy = "pairing"' ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.jsonExample: Set explicit sandbox scope:
jq '.agent.sandbox.scope = "agent"' ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.jsonWorkflow
Standard Update Flow
# 1. Check for updates
~/.skills/clawdbot-update/check-upstream.sh
# 2. Validate current setup
~/.skills/clawdbot-update/validate-setup.sh
# 3. Dry run
~/.skills/clawdbot-update/backup-clawdbot-dryrun.sh
# 4. Backup
~/.skills/clawdbot-update/backup-clawdbot-full.sh
# 5. Stop gateway
cd ~/code/clawdbot
pnpm clawdbot gateway stop
# 6. Update code
git checkout main
git pull --rebase origin main
pnpm install
pnpm build
# 7. Run doctor
pnpm clawdbot doctor --yes
# 8. Test
pnpm clawdbot gateway start # foreground for testing
# 9. Deploy
pnpm clawdbot gateway stop
pnpm clawdbot gateway start --daemonRollback Flow
# Quick rollback
~/.skills/clawdbot-update/restore-clawdbot.sh <backup-dir>
# Manual rollback
cd ~/code/clawdbot
git checkout <old-commit>
pnpm install && pnpm build
cp <backup-dir>/clawdbot.json ~/.clawdbot/
pnpm clawdbot gateway restartTesting 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
pnpm clawdbot agents list
pnpm clawdbot logs --tail 50
pnpm clawdbot providers list --usage
pnpm clawdbot skills listMonitoring
# Live logs
pnpm clawdbot logs --follow
# Or Web UI
open http://localhost:3001/logs
# Check status
pnpm clawdbot status
pnpm clawdbot gateway statusTroubleshooting
Common Issues
Gateway won't start:
pnpm clawdbot logs --grep error
pnpm clawdbot doctorAuth errors:
# OAuth profiles might need re-login
pnpm clawdbot providers login <provider>Sandbox issues:
# Check sandbox config
jq '.agent.sandbox' ~/.clawdbot/clawdbot.json
# Check per-agent sandbox
jq '.routing.agents[] | {name, sandbox}' ~/.clawdbot/clawdbot.jsonEmergency Restore
If something goes wrong:
# 1. Stop gateway
pnpm clawdbot gateway stop
# 2. Full restore
LATEST_BACKUP=$(ls -t ~/.clawdbot-backups/ | head -1)
~/.skills/clawdbot-update/restore-clawdbot.sh ~/.clawdbot-backups/$LATEST_BACKUP
# 3. Restart
pnpm clawdbot gateway startInstallation
Via ClawdHub
clawdbot skills install clawdbot-updateManual
git clone <repo-url> ~/.skills/clawdbot-update
chmod +x ~/.skills/clawdbot-update/*.shLicense
MIT - see LICENSE
Author
Pascal Schott (@pasogott)
Contribution for Clawdbot https://github.com/clawdbot/clawdbot
#!/bin/bash
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
echo -e "${CYAN}🔍 Clawdbot Backup Dry Run${NC}"
echo -e "${CYAN}===========================${NC}"
echo ""
echo -e "${YELLOW}This is a DRY RUN - no files will be created or modified${NC}"
echo ""
# Config check
if [ ! -f ~/.clawdbot/clawdbot.json ]; then
echo -e "${RED}❌ Config file not found: ~/.clawdbot/clawdbot.json${NC}"
exit 1
fi
# What backup directory would be created
BACKUP_DIR=~/.clawdbot-backups/pre-update-$(date +%Y%m%d-%H%M%S)
echo -e "${BLUE}📁 Would create backup at:${NC}"
echo " $BACKUP_DIR"
echo ""
# Config analysis
echo -e "${YELLOW}📋 Configuration Analysis${NC}"
CONFIG_SIZE=$(du -h ~/.clawdbot/clawdbot.json | cut -f1)
echo -e "${GREEN}✓${NC} Config file: ~/.clawdbot/clawdbot.json ($CONFIG_SIZE)"
BACKUP_COUNT=$(find ~/.clawdbot -maxdepth 1 -name "*.backup*" -o -name "*.json.*" 2>/dev/null | wc -l | tr -d ' ')
if [ "$BACKUP_COUNT" -gt 0 ]; then
echo -e "${GREEN}✓${NC} Found $BACKUP_COUNT additional backup files"
fi
# Sessions check
echo ""
echo -e "${YELLOW}💾 Sessions Analysis${NC}"
if [ -d ~/.clawdbot/sessions ]; then
SESSION_COUNT=$(find ~/.clawdbot/sessions -type f -name "*.jsonl" 2>/dev/null | wc -l | tr -d ' ')
SESSION_SIZE=$(du -sh ~/.clawdbot/sessions 2>/dev/null | cut -f1)
echo -e "${GREEN}✓${NC} Sessions directory exists"
echo " Files: $SESSION_COUNT session files"
echo " Size: $SESSION_SIZE"
echo -e "${CYAN}→${NC} Would create: sessions.tar.gz"
else
echo -e "${BLUE}ℹ${NC} No sessions directory (would skip)"
fi
# Agents check
echo ""
echo -e "${YELLOW}🤖 Agents Analysis${NC}"
if [ -d ~/.clawdbot/agents ]; then
AGENT_DIRS=$(find ~/.clawdbot/agents -maxdepth 1 -type d | tail -n +2 | wc -l | tr -d ' ')
AGENT_SIZE=$(du -sh ~/.clawdbot/agents 2>/dev/null | cut -f1)
echo -e "${GREEN}✓${NC} Agents directory exists"
echo " Agents: $AGENT_DIRS"
echo " Size: $AGENT_SIZE"
echo -e "${CYAN}→${NC} Would create: agents.tar.gz"
# List agent directories
for agent_dir in ~/.clawdbot/agents/*/; do
if [ -d "$agent_dir" ]; then
agent_name=$(basename "$agent_dir")
agent_size=$(du -sh "$agent_dir" 2>/dev/null | cut -f1)
echo " - $agent_name ($agent_size)"
fi
done
else
echo -e "${BLUE}ℹ${NC} No agents directory (would skip)"
fi
# Credentials check
echo ""
echo -e "${YELLOW}🔐 Credentials Analysis${NC}"
if [ -d ~/.clawdbot/credentials ]; then
CRED_COUNT=$(find ~/.clawdbot/credentials -type f 2>/dev/null | wc -l | tr -d ' ')
CRED_SIZE=$(du -sh ~/.clawdbot/credentials 2>/dev/null | cut -f1)
echo -e "${GREEN}✓${NC} Credentials directory exists"
echo " Files: $CRED_COUNT credential files"
echo " Size: $CRED_SIZE"
echo -e "${CYAN}→${NC} Would create: credentials.tar.gz"
else
echo -e "${RED}⚠${NC} No credentials directory!"
echo -e "${CYAN}→${NC} Would skip credentials backup"
fi
# Cron check
echo ""
echo -e "${YELLOW}⏰ Cron Analysis${NC}"
if [ -d ~/.clawdbot/cron ]; then
CRON_COUNT=$(find ~/.clawdbot/cron -type f 2>/dev/null | wc -l | tr -d ' ')
CRON_SIZE=$(du -sh ~/.clawdbot/cron 2>/dev/null | cut -f1)
echo -e "${GREEN}✓${NC} Cron directory exists"
echo " Jobs: $CRON_COUNT cron files"
echo " Size: $CRON_SIZE"
echo -e "${CYAN}→${NC} Would create: cron.tar.gz"
else
echo -e "${BLUE}ℹ${NC} No cron directory (would skip)"
fi
# Sandboxes check
echo ""
echo -e "${YELLOW}📦 Sandboxes Analysis${NC}"
if [ -d ~/.clawdbot/sandboxes ]; then
SANDBOX_COUNT=$(find ~/.clawdbot/sandboxes -maxdepth 1 -type d 2>/dev/null | tail -n +2 | wc -l | tr -d ' ')
SANDBOX_SIZE=$(du -sh ~/.clawdbot/sandboxes 2>/dev/null | cut -f1)
echo -e "${GREEN}✓${NC} Sandboxes directory exists"
echo " Sandboxes: $SANDBOX_COUNT"
echo " Size: $SANDBOX_SIZE"
echo -e "${CYAN}→${NC} Would create: sandboxes.tar.gz"
else
echo -e "${BLUE}ℹ${NC} No sandboxes directory (would skip)"
fi
# Workspaces analysis (DYNAMIC!)
echo ""
echo -e "${YELLOW}🏠 Workspaces Analysis (Dynamic Detection)${NC}"
# Read workspaces from config
WORKSPACE_DATA=$(jq -r '.routing.agents // {} | to_entries[] | "\(.key)|\(.value.workspace // "none")|\(.value.name // .key)"' ~/.clawdbot/clawdbot.json)
if [ -z "$WORKSPACE_DATA" ]; then
echo -e "${BLUE}ℹ${NC} No agents configured in routing.agents"
else
WORKSPACE_COUNT=0
TOTAL_SIZE=0
echo -e "${BLUE}Detected workspaces from config:${NC}"
echo ""
while IFS='|' read -r agent_id workspace agent_name; do
echo -e " ${CYAN}Agent:${NC} $agent_id"
echo -e " ${CYAN}Name:${NC} $agent_name"
echo -e " ${CYAN}Path:${NC} $workspace"
if [ "$workspace" = "none" ]; then
echo -e " ${YELLOW}Status:${NC} No workspace configured"
echo -e " ${CYAN}→${NC} Would skip"
elif [ ! -d "$workspace" ]; then
echo -e " ${RED}Status:${NC} Directory not found!"
echo -e " ${CYAN}→${NC} Would skip with warning"
else
SIZE=$(du -sh "$workspace" 2>/dev/null | cut -f1)
FILE_COUNT=$(find "$workspace" -type f 2>/dev/null | wc -l | tr -d ' ')
echo -e " ${GREEN}Status:${NC} Ready to backup"
echo -e " ${CYAN}Size:${NC} $SIZE"
echo -e " ${CYAN}Files:${NC} $FILE_COUNT"
SAFE_NAME=$(echo "$agent_id" | tr '/' '_' | tr ' ' '-')
echo -e " ${CYAN}→${NC} Would create: workspace-${SAFE_NAME}.tar.gz"
WORKSPACE_COUNT=$((WORKSPACE_COUNT+1))
fi
echo ""
done <<< "$WORKSPACE_DATA"
echo -e "${GREEN}✓${NC} Would backup $WORKSPACE_COUNT workspace(s)"
fi
# Git state check
echo ""
echo -e "${YELLOW}🔧 Git Repository Analysis${NC}"
if [ -d ~/code/clawdbot/.git ]; then
cd ~/code/clawdbot
CURRENT_COMMIT=$(git log -1 --oneline)
CURRENT_BRANCH=$(git branch --show-current)
UNCOMMITTED=$(git status --short | wc -l | tr -d ' ')
echo -e "${GREEN}✓${NC} Git repository found"
echo " Branch: $CURRENT_BRANCH"
echo " Commit: $CURRENT_COMMIT"
echo " Uncommitted changes: $UNCOMMITTED"
echo -e "${CYAN}→${NC} Would create: git-version.txt, git-status.txt, git-remotes.txt"
else
echo -e "${YELLOW}⚠${NC} Git repository not found at ~/code/clawdbot"
echo -e "${CYAN}→${NC} Would skip git state backup"
fi
# Calculate total size
echo ""
echo -e "${YELLOW}📊 Backup Size Estimation${NC}"
TOTAL_SIZE=0
[ -d ~/.clawdbot/sessions ] && TOTAL_SIZE=$((TOTAL_SIZE + $(du -sk ~/.clawdbot/sessions 2>/dev/null | cut -f1)))
[ -d ~/.clawdbot/agents ] && TOTAL_SIZE=$((TOTAL_SIZE + $(du -sk ~/.clawdbot/agents 2>/dev/null | cut -f1)))
[ -d ~/.clawdbot/credentials ] && TOTAL_SIZE=$((TOTAL_SIZE + $(du -sk ~/.clawdbot/credentials 2>/dev/null | cut -f1)))
[ -d ~/.clawdbot/cron ] && TOTAL_SIZE=$((TOTAL_SIZE + $(du -sk ~/.clawdbot/cron 2>/dev/null | cut -f1)))
[ -d ~/.clawdbot/sandboxes ] && TOTAL_SIZE=$((TOTAL_SIZE + $(du -sk ~/.clawdbot/sandboxes 2>/dev/null | cut -f1)))
# Add workspaces
if [ -n "$WORKSPACE_DATA" ]; then
while IFS='|' read -r agent_id workspace agent_name; do
if [ "$workspace" != "none" ] && [ -d "$workspace" ]; then
WS_SIZE=$(du -sk "$workspace" 2>/dev/null | cut -f1)
TOTAL_SIZE=$((TOTAL_SIZE + WS_SIZE))
fi
done <<< "$WORKSPACE_DATA"
fi
# Convert to human readable
if [ $TOTAL_SIZE -gt 1048576 ]; then
TOTAL_HUMAN="$(echo "scale=1; $TOTAL_SIZE/1048576" | bc)G"
elif [ $TOTAL_SIZE -gt 1024 ]; then
TOTAL_HUMAN="$(echo "scale=1; $TOTAL_SIZE/1024" | bc)M"
else
TOTAL_HUMAN="${TOTAL_SIZE}K"
fi
echo " Estimated backup size: ~$TOTAL_HUMAN (uncompressed)"
echo " Compressed size: ~$(echo "scale=1; $TOTAL_SIZE*0.3/1024" | bc)M (estimated 70% compression)"
# Check disk space
echo ""
echo -e "${YELLOW}💿 Disk Space Check${NC}"
BACKUP_PARENT=$(dirname ~/.clawdbot-backups)
DISK_AVAIL=$(df -h "$BACKUP_PARENT" 2>/dev/null | tail -1 | awk '{print $4}')
DISK_USED=$(df -h "$BACKUP_PARENT" 2>/dev/null | tail -1 | awk '{print $5}')
echo " Available space: $DISK_AVAIL"
echo " Disk usage: $DISK_USED"
if [ -d ~/.clawdbot-backups ]; then
EXISTING_BACKUPS=$(find ~/.clawdbot-backups -maxdepth 1 -type d 2>/dev/null | tail -n +2 | wc -l | tr -d ' ')
BACKUPS_SIZE=$(du -sh ~/.clawdbot-backups 2>/dev/null | cut -f1)
echo " Existing backups: $EXISTING_BACKUPS ($BACKUPS_SIZE total)"
fi
# Summary
echo ""
echo -e "${BLUE}════════════════════════════════════════${NC}"
echo -e "${CYAN}📋 Backup Summary${NC}"
echo -e "${BLUE}════════════════════════════════════════${NC}"
echo ""
FILES_TO_CREATE=0
FILES_TO_SKIP=0
echo -e "${GREEN}Files that would be created:${NC}"
[ -f ~/.clawdbot/clawdbot.json ] && echo " ✓ clawdbot.json" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
[ -d ~/.clawdbot/sessions ] && echo " ✓ sessions.tar.gz" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
[ -d ~/.clawdbot/agents ] && echo " ✓ agents.tar.gz" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
[ -d ~/.clawdbot/credentials ] && echo " ✓ credentials.tar.gz" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
[ -d ~/.clawdbot/cron ] && echo " ✓ cron.tar.gz" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
[ -d ~/.clawdbot/sandboxes ] && echo " ✓ sandboxes.tar.gz" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
# Workspace files
if [ -n "$WORKSPACE_DATA" ]; then
while IFS='|' read -r agent_id workspace agent_name; do
if [ "$workspace" != "none" ] && [ -d "$workspace" ]; then
SAFE_NAME=$(echo "$agent_id" | tr '/' '_' | tr ' ' '-')
echo " ✓ workspace-${SAFE_NAME}.tar.gz"
FILES_TO_CREATE=$((FILES_TO_CREATE+1))
fi
done <<< "$WORKSPACE_DATA"
fi
[ -d ~/code/clawdbot/.git ] && echo " ✓ git-version.txt" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
[ -d ~/code/clawdbot/.git ] && echo " ✓ git-status.txt" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
[ -d ~/code/clawdbot/.git ] && echo " ✓ git-remotes.txt" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
echo " ✓ BACKUP_INFO.txt" && FILES_TO_CREATE=$((FILES_TO_CREATE+1))
echo ""
echo -e "${YELLOW}Files that would be skipped:${NC}"
[ ! -d ~/.clawdbot/sessions ] && echo " ⊘ sessions.tar.gz (no directory)" && FILES_TO_SKIP=$((FILES_TO_SKIP+1))
[ ! -d ~/.clawdbot/agents ] && echo " ⊘ agents.tar.gz (no directory)" && FILES_TO_SKIP=$((FILES_TO_SKIP+1))
[ ! -d ~/.clawdbot/credentials ] && echo " ⊘ credentials.tar.gz (no directory)" && FILES_TO_SKIP=$((FILES_TO_SKIP+1))
[ ! -d ~/.clawdbot/cron ] && echo " ⊘ cron.tar.gz (no directory)" && FILES_TO_SKIP=$((FILES_TO_SKIP+1))
[ ! -d ~/.clawdbot/sandboxes ] && echo " ⊘ sandboxes.tar.gz (no directory)" && FILES_TO_SKIP=$((FILES_TO_SKIP+1))
[ ! -d ~/code/clawdbot/.git ] && echo " ⊘ git-*.txt (no repository)" && FILES_TO_SKIP=$((FILES_TO_SKIP+1))
if [ "$FILES_TO_SKIP" -eq 0 ]; then
echo " (none - all sources available)"
fi
echo ""
echo -e "${CYAN}Total:${NC} $FILES_TO_CREATE files would be created, $FILES_TO_SKIP skipped"
echo -e "${CYAN}Location:${NC} $BACKUP_DIR"
echo -e "${CYAN}Estimated size:${NC} ~$TOTAL_HUMAN"
echo ""
echo -e "${GREEN}✨ Dry run complete!${NC}"
echo ""
echo -e "${YELLOW}💡 To perform the actual backup:${NC}"
echo " ~/.skills/clawdbot-update/backup-clawdbot-full.sh"
echo ""
#!/bin/bash
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}🚀 Clawdbot Full Backup Script${NC}"
echo -e "${BLUE}================================${NC}"
echo ""
# Config check
if [ ! -f ~/.clawdbot/clawdbot.json ]; then
echo -e "${RED}❌ Config file not found: ~/.clawdbot/clawdbot.json${NC}"
exit 1
fi
# Backup Directory
BACKUP_DIR=~/.clawdbot-backups/pre-update-$(date +%Y%m%d-%H%M%S)
mkdir -p "$BACKUP_DIR"
echo -e "${GREEN}📁 Backup Directory: $BACKUP_DIR${NC}"
echo ""
# 1. Config Backup
echo -e "${YELLOW}📋 Backing up configuration...${NC}"
cp ~/.clawdbot/clawdbot.json "$BACKUP_DIR/clawdbot.json"
echo -e "${GREEN}✅ Config backed up${NC}"
# Copy all backup files
cp ~/.clawdbot/*.backup* "$BACKUP_DIR/" 2>/dev/null || true
cp ~/.clawdbot/*.json.* "$BACKUP_DIR/" 2>/dev/null || true
# 2. Sessions
echo ""
echo -e "${YELLOW}💾 Backing up sessions...${NC}"
if [ -d ~/.clawdbot/sessions ]; then
tar -czf "$BACKUP_DIR/sessions.tar.gz" -C ~/.clawdbot sessions/
echo -e "${GREEN}✅ Sessions backed up${NC}"
else
echo -e "${BLUE}ℹ️ No sessions directory${NC}"
fi
# 3. Agents State
echo ""
echo -e "${YELLOW}🤖 Backing up agents...${NC}"
if [ -d ~/.clawdbot/agents ]; then
tar -czf "$BACKUP_DIR/agents.tar.gz" -C ~/.clawdbot agents/
echo -e "${GREEN}✅ Agents backed up${NC}"
else
echo -e "${BLUE}ℹ️ No agents directory${NC}"
fi
# 4. Credentials
echo ""
echo -e "${YELLOW}🔐 Backing up credentials...${NC}"
if [ -d ~/.clawdbot/credentials ]; then
tar -czf "$BACKUP_DIR/credentials.tar.gz" -C ~/.clawdbot credentials/
echo -e "${GREEN}✅ Credentials backed up${NC}"
else
echo -e "${RED}⚠️ No credentials directory!${NC}"
fi
# 5. Cron
echo ""
echo -e "${YELLOW}⏰ Backing up cron jobs...${NC}"
if [ -d ~/.clawdbot/cron ]; then
tar -czf "$BACKUP_DIR/cron.tar.gz" -C ~/.clawdbot cron/
echo -e "${GREEN}✅ Cron jobs backed up${NC}"
else
echo -e "${BLUE}ℹ️ No cron directory${NC}"
fi
# 6. Sandboxes
echo ""
echo -e "${YELLOW}📦 Backing up sandboxes...${NC}"
if [ -d ~/.clawdbot/sandboxes ]; then
tar -czf "$BACKUP_DIR/sandboxes.tar.gz" -C ~/.clawdbot sandboxes/
echo -e "${GREEN}✅ Sandboxes backed up${NC}"
else
echo -e "${BLUE}ℹ️ No sandboxes directory${NC}"
fi
# 7. Workspaces (DYNAMIC!)
echo ""
echo -e "${YELLOW}🏠 Backing up workspaces (reading from config)...${NC}"
# Read workspaces from config
WORKSPACE_DATA=$(jq -r '.routing.agents // {} | to_entries[] | "\(.key)|\(.value.workspace // "none")|\(.value.name // .key)"' ~/.clawdbot/clawdbot.json)
if [ -z "$WORKSPACE_DATA" ]; then
echo -e "${BLUE}ℹ️ No agents configured${NC}"
else
WORKSPACE_COUNT=0
WORKSPACE_SIZES=""
while IFS='|' read -r agent_id workspace agent_name; do
if [ "$workspace" != "none" ] && [ -d "$workspace" ]; then
echo -e " 📦 Backing up ${BLUE}$agent_id${NC} ($agent_name)..."
echo " Path: $workspace"
# Create safe filename (replace / with _)
SAFE_NAME=$(echo "$agent_id" | tr '/' '_' | tr ' ' '-')
tar -czf "$BACKUP_DIR/workspace-${SAFE_NAME}.tar.gz" -C "$workspace" . 2>/dev/null
SIZE=$(du -sh "$workspace" 2>/dev/null | cut -f1)
echo -e " ${GREEN}✅ Backed up ($SIZE)${NC}"
WORKSPACE_COUNT=$((WORKSPACE_COUNT+1))
WORKSPACE_SIZES="${WORKSPACE_SIZES}\n - $agent_id: $workspace ($SIZE)"
elif [ "$workspace" = "none" ]; then
echo -e " ${YELLOW}⚠️${NC} Agent '$agent_id' has no workspace configured"
else
echo -e " ${RED}❌${NC} Agent '$agent_id' workspace not found: $workspace"
fi
done <<< "$WORKSPACE_DATA"
echo ""
echo -e "${GREEN}✅ Backed up $WORKSPACE_COUNT workspace(s)${NC}"
fi
# 8. Git State
echo ""
echo -e "${YELLOW}🔧 Backing up git state...${NC}"
if [ -d ~/code/clawdbot/.git ]; then
cd ~/code/clawdbot
git log -1 --oneline > "$BACKUP_DIR/git-version.txt"
git branch --show-current >> "$BACKUP_DIR/git-version.txt"
git status --short > "$BACKUP_DIR/git-status.txt"
git remote -v > "$BACKUP_DIR/git-remotes.txt"
echo -e "${GREEN}✅ Git state saved${NC}"
else
echo -e "${YELLOW}⚠️ Git repository not found${NC}"
fi
# 9. Backup Info
echo ""
echo -e "${YELLOW}📝 Creating backup info...${NC}"
# Generate workspace list for restore instructions
RESTORE_WORKSPACES=""
if [ -n "$WORKSPACE_DATA" ]; then
while IFS='|' read -r agent_id workspace agent_name; do
if [ "$workspace" != "none" ] && [ -d "$workspace" ]; then
SAFE_NAME=$(echo "$agent_id" | tr '/' '_' | tr ' ' '-')
RESTORE_WORKSPACES="${RESTORE_WORKSPACES} tar -xzf \$BACKUP_DIR/workspace-${SAFE_NAME}.tar.gz -C $workspace\n"
fi
done <<< "$WORKSPACE_DATA"
fi
cat > "$BACKUP_DIR/BACKUP_INFO.txt" << EOF
Clawdbot Full Backup
====================
Date: $(date)
Backup Location: $BACKUP_DIR
Git Information:
----------------
$(cat "$BACKUP_DIR/git-version.txt" 2>/dev/null || echo "Not available")
Repository: https://github.com/clawdbot/clawdbot
Contents:
---------
$(ls -lh "$BACKUP_DIR" | tail -n +2)
Workspace Information:
---------------------$(echo -e "$WORKSPACE_SIZES")
Agents Configuration:
--------------------
$(jq -r '.routing.agents // {} | to_entries[] | " - \(.key): \(.value.name // .key)"' ~/.clawdbot/clawdbot.json)
Restore Instructions:
---------------------
1. Stop Gateway:
cd ~/code/clawdbot
pnpm clawdbot gateway stop
2. Restore Config:
cp $BACKUP_DIR/clawdbot.json ~/.clawdbot/clawdbot.json
3. Restore State:
tar -xzf $BACKUP_DIR/sessions.tar.gz -C ~/.clawdbot 2>/dev/null || true
tar -xzf $BACKUP_DIR/agents.tar.gz -C ~/.clawdbot 2>/dev/null || true
tar -xzf $BACKUP_DIR/credentials.tar.gz -C ~/.clawdbot 2>/dev/null || true
tar -xzf $BACKUP_DIR/cron.tar.gz -C ~/.clawdbot 2>/dev/null || true
tar -xzf $BACKUP_DIR/sandboxes.tar.gz -C ~/.clawdbot 2>/dev/null || true
4. Restore Workspaces:
$(echo -e "$RESTORE_WORKSPACES")
5. Restore Git (optional):
cd ~/code/clawdbot
git checkout <commit from git-version.txt>
pnpm install
pnpm build
6. Start Gateway:
pnpm clawdbot gateway start
Quick Restore:
--------------
Use the restore script:
~/.skills/clawdbot-update/restore-clawdbot.sh $BACKUP_DIR
EOF
# 10. Summary
echo ""
echo -e "${BLUE}════════════════════════════════════════${NC}"
echo -e "${GREEN}✨ Backup Complete!${NC}"
echo -e "${BLUE}════════════════════════════════════════${NC}"
echo ""
echo -e "${YELLOW}📊 Backup Statistics:${NC}"
echo "Total Size: $(du -sh "$BACKUP_DIR" | cut -f1)"
echo "Location: $BACKUP_DIR"
echo ""
# Validation
echo -e "${YELLOW}🔍 Validation:${NC}"
[ -f "$BACKUP_DIR/clawdbot.json" ] && echo -e "${GREEN}✅${NC} Config" || echo -e "${RED}❌${NC} Config"
[ -f "$BACKUP_DIR/credentials.tar.gz" ] && echo -e "${GREEN}✅${NC} Credentials" || echo -e "${YELLOW}⚠️${NC} Credentials"
# Count workspace backups
WORKSPACE_BACKUP_COUNT=$(find "$BACKUP_DIR" -name "workspace-*.tar.gz" 2>/dev/null | wc -l | tr -d ' ')
if [ "$WORKSPACE_BACKUP_COUNT" -gt 0 ]; then
echo -e "${GREEN}✅${NC} Workspaces ($WORKSPACE_BACKUP_COUNT backed up)"
find "$BACKUP_DIR" -name "workspace-*.tar.gz" -exec basename {} \; | sed 's/^/ - /'
else
echo -e "${YELLOW}⚠️${NC} No workspaces backed up"
fi
echo ""
echo -e "${GREEN}📁 Backup saved to:${NC}"
echo -e "${BLUE}$BACKUP_DIR${NC}"
echo ""
echo -e "${YELLOW}💡 Next steps:${NC}"
echo "1. Review backup: cat $BACKUP_DIR/BACKUP_INFO.txt"
echo "2. Run validation: ~/.skills/clawdbot-update/validate-setup.sh"
echo "3. Proceed with update when ready"
echo ""
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}🔍 Clawdbot Upstream Check${NC}"
echo -e "${BLUE}==========================${NC}"
echo ""
# Check if repo exists
if [ ! -d ~/code/clawdbot/.git ]; then
echo -e "${RED}❌ Clawdbot repository not found at ~/code/clawdbot${NC}"
exit 1
fi
cd ~/code/clawdbot
# Current state
echo -e "${YELLOW}📍 Current State${NC}"
CURRENT_BRANCH=$(git branch --show-current)
CURRENT_COMMIT=$(git log -1 --oneline)
echo "Branch: $CURRENT_BRANCH"
echo "Commit: $CURRENT_COMMIT"
echo ""
# Fetch upstream
echo -e "${YELLOW}🌐 Fetching upstream...${NC}"
git fetch origin 2>&1 | grep -v "^From"
echo ""
# Check for updates
echo -e "${YELLOW}📊 Update Status${NC}"
BEHIND=$(git rev-list --count HEAD..origin/main 2>/dev/null || echo "0")
if [ "$BEHIND" = "0" ]; then
echo -e "${GREEN}✅ Up to date with upstream!${NC}"
echo ""
echo "Latest commit:"
git log origin/main -1 --oneline --decorate
else
echo -e "${YELLOW}⚠️ Behind upstream by $BEHIND commit(s)${NC}"
echo ""
echo -e "${BLUE}New commits:${NC}"
git log --oneline --decorate HEAD..origin/main | head -20
echo ""
echo -e "${YELLOW}Changes summary:${NC}"
git diff --stat HEAD..origin/main | tail -20
fi
echo ""
echo -e "${YELLOW}🏷️ Latest Tags${NC}"
git tag -l | grep "v2026" | tail -5
echo ""
echo -e "${YELLOW}📝 Recent Releases${NC}"
git log --tags --simplify-by-decoration --pretty="format:%ci %d" | head -3
echo ""
echo -e "${BLUE}════════════════════════════════════════${NC}"
if [ "$BEHIND" != "0" ]; then
echo -e "${YELLOW}💡 To update:${NC}"
echo " 1. Backup: ~/.skills/clawdbot-update/backup-clawdbot-full.sh"
echo " 2. Update: git pull --rebase origin main"
echo " 3. Build: pnpm install && pnpm build"
echo ""
echo "Or use the full checklist:"
echo " cat ~/.skills/clawdbot-update/UPDATE_CHECKLIST.md"
fi
echo ""
{
"name": "clawdbot-update",
"version": "1.0.0",
"description": "Comprehensive backup, update, and restore workflow for Clawdbot installations",
"repository": {
"type": "git",
"url": "https://github.com/clawdbot/clawdbot"
},
"upstream": {
"remote": "origin",
"url": "https://github.com/clawdbot/clawdbot",
"defaultBranch": "main"
},
"paths": {
"repo": "~/code/clawdbot",
"config": "~/.clawdbot/clawdbot.json",
"backups": "~/.clawdbot-backups",
"skills": "~/.skills/clawdbot-update"
},
"features": {
"dynamicWorkspaces": true,
"multiAgent": true,
"sandboxSupport": true,
"gitIntegration": true
},
"backup": {
"includes": [
"config",
"sessions",
"agents",
"credentials",
"cron",
"sandboxes",
"workspaces (dynamic from config)",
"git state"
]
}
}
{
"name": "@clawdbot/skill-update",
"version": "1.0.0",
"description": "Comprehensive backup, update, and restore workflow for Clawdbot with dynamic workspace detection",
"type": "module",
"keywords": [
"clawdbot",
"skill",
"backup",
"restore",
"update",
"multi-agent",
"workspace",
"git"
],
"repository": {
"type": "git",
"url": "https://github.com/clawdbot/clawdbot.git"
},
"bugs": {
"url": "https://github.com/clawdbot/clawdbot/issues"
},
"homepage": "https://clawdhub.com",
"license": "MIT",
"author": {
"name": "Pascal Schott",
"github": "pasogott"
},
"files": [
"*.sh",
"*.md",
"*.json",
"!package.json"
],
"scripts": {
"dryrun": "./backup-clawdbot-dryrun.sh",
"backup": "./backup-clawdbot-full.sh",
"restore": "./restore-clawdbot.sh",
"validate": "./validate-setup.sh",
"check": "./check-upstream.sh"
},
"clawdbot": {
"type": "skill",
"category": "system",
"tags": [
"backup",
"update",
"restore",
"multi-agent",
"maintenance"
],
"requirements": {
"bash": ">=4.0",
"jq": ">=1.6",
"tar": "*",
"git": "*"
},
"features": {
"dynamicWorkspaces": true,
"multiAgent": true,
"dryRun": true,
"gitIntegration": true,
"validation": true
}
},
"engines": {
"node": ">=18.0.0"
}
}
Publishing Guide for Clawdbot Update Skill
Pre-Publication Checklist
- [x] Remove personal data (paths, agent names, etc.)
- [x] Set author to pasogott
- [x] MIT License included
- [x] Dynamic workspace detection (no hardcoded paths)
- [x] Generic examples in documentation
- [x] All scripts executable
- [x] package.json configured
- [x] .clawdhub.json configured
- [x] README with installation instructions
Files Ready for Publication
/tmp/clawdbot-update-publish/
├── backup-clawdbot-dryrun.sh # Dry run preview
├── backup-clawdbot-full.sh # Full backup
├── restore-clawdbot.sh # Restore
├── validate-setup.sh # Validation
├── check-upstream.sh # Update checker
├── config.json # Skill config
├── package.json # npm metadata
├── .clawdhub.json # ClawdHub metadata
├── LICENSE # MIT License
├── README.md # Quick start
├── SKILL.md # Full documentation
├── UPDATE_CHECKLIST.md # Step-by-step guide
└── QUICK_REFERENCE.md # Command cheat sheetPublishing to npm
1. Prepare npm package
cd /tmp/clawdbot-update-publish
# Verify package.json
cat package.json
# Test installation locally
npm pack2. Publish to npm
# Login to npm (if not already)
npm login
# Publish (scoped package)
npm publish --access public3. Verify publication
# Check package page
open https://www.npmjs.com/package/@clawdbot/skill-update
# Test installation
npm install -g @clawdbot/skill-updatePublishing to ClawdHub
1. Create repository
# Option A: Create new repo
gh repo create pasogott/clawdbot-skill-update --public
# Option B: Fork Clawdbot repo and add as subdirectory
# Follow ClawdHub contribution guidelines2. Push to repository
cd /tmp/clawdbot-update-publish
# Initialize git
git init
git add .
git commit -m "Initial release: Clawdbot Update Skill v1.0.0
Features:
- Dynamic workspace detection
- Multi-agent support
- Dry run preview
- Full backup & restore
- Git integration
- Validation checks
Author: Pascal Schott (@pasogott)
License: MIT"
# Push to GitHub
git remote add origin https://github.com/pasogott/clawdbot-skill-update.git
git branch -M main
git push -u origin main3. Submit to ClawdHub
Visit https://clawdhub.com and follow submission process:
1. Navigate to "Submit Skill" 2. Provide repository URL 3. ClawdHub will read .clawdhub.json automatically 4. Review and submit
Installation Instructions for Users
Via ClawdHub (Recommended)
clawdbot skills install clawdbot-updateVia npm
npm install -g @clawdbot/skill-update
# Link to skills directory
ln -s /usr/local/lib/node_modules/@clawdbot/skill-update ~/.skills/clawdbot-updateManual Installation
git clone https://github.com/pasogott/clawdbot-skill-update.git ~/.skills/clawdbot-update
chmod +x ~/.skills/clawdbot-update/*.shPost-Publication
1. Create GitHub Release
# Tag release
git tag -a v1.0.0 -m "Release v1.0.0
Features:
- Dynamic workspace detection
- Multi-agent support
- Dry run preview
- Full backup & restore
- Git integration
- Validation checks"
git push origin v1.0.0
# Create release on GitHub
gh release create v1.0.0 \
--title "v1.0.0 - Initial Release" \
--notes "First public release of Clawdbot Update Skill"2. Announce
- Post on Clawdbot Discord/Community
- Tweet/share if applicable
- Add to Clawdbot skills documentation
3. Monitor
- Watch GitHub issues
- Respond to npm feedback
- Update documentation as needed
Version Bumping (Future)
Update version
# Edit package.json version
# Edit .clawdhub.json version
# Edit config.json version
# Commit
git commit -am "Bump version to 1.1.0"
# Tag
git tag v1.1.0
git push origin v1.1.0
# Publish
npm version patch # or minor, major
npm publishMaintenance Checklist
- [ ] Keep aligned with Clawdbot breaking changes
- [ ] Test with new Clawdbot releases
- [ ] Update documentation
- [ ] Respond to issues
- [ ] Add new features based on feedback
Repository Structure
clawdbot-skill-update/
├── .github/
│ └── workflows/
│ └── test.yml # CI/CD
├── backup-clawdbot-dryrun.sh
├── backup-clawdbot-full.sh
├── restore-clawdbot.sh
├── validate-setup.sh
├── check-upstream.sh
├── config.json
├── package.json
├── .clawdhub.json
├── LICENSE
├── README.md
├── SKILL.md
├── UPDATE_CHECKLIST.md
├── QUICK_REFERENCE.md
└── .gitignoreQuality Checks Before Release
- [ ] All scripts have shebang (
#!/bin/bash) - [ ] All scripts are executable (
chmod +x) - [ ] No hardcoded personal paths
- [ ] No sensitive data (keys, tokens, etc.)
- [ ] Documentation is clear and generic
- [ ] Examples use placeholder data
- [ ] License is properly attributed
- [ ] package.json is valid
- [ ] .clawdhub.json is valid
Contact
Author: Pascal Schott GitHub: @pasogott Issues: Report via GitHub Issues License: MIT
---
Ready to publish! 🚀
Clawdbot Update - Quick Reference Card
🚀 One-Liner Commands
# Dry run (preview backup)
~/.skills/clawdbot-update/backup-clawdbot-dryrun.sh
# Backup everything
~/.skills/clawdbot-update/backup-clawdbot-full.sh
# Show checklist
cat ~/.skills/clawdbot-update/UPDATE_CHECKLIST.md
# Restore from backup
~/.skills/clawdbot-update/restore-clawdbot.sh <backup-dir>
# List backups
ls -lth ~/.clawdbot-backups/
# View last backup
cat $(ls -td ~/.clawdbot-backups/*/ | head -1)/BACKUP_INFO.txt⚡ Emergency Rollback
# Stop gateway
cd ~/code/clawdbot && pnpm clawdbot gateway stop
# Restore latest backup
LATEST=$(ls -t ~/.clawdbot-backups/ | head -1)
~/.skills/clawdbot-update/restore-clawdbot.sh ~/.clawdbot-backups/$LATEST
# Start gateway
pnpm clawdbot gateway start🔧 Config Quick Fixes
# Switch to pairing (recommended)
jq '.whatsapp.dmPolicy = "pairing" | .telegram.dmPolicy = "pairing"' ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.json
# Set explicit sandbox scope
jq '.agent.sandbox.scope = "agent"' ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.json
# Set user timezone
jq '.agent.userTimezone = "America/New_York"' ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.json
# View current config
jq '.' ~/.clawdbot/clawdbot.json | less📊 Status Checks
# Gateway status
pnpm clawdbot gateway status
# Live logs
pnpm clawdbot logs --follow
# Agents
pnpm clawdbot agents list
# Providers with usage
pnpm clawdbot providers list --usage
# Full status
pnpm clawdbot status🧪 Test Commands
# New CLIs
pnpm clawdbot agents list
pnpm clawdbot logs --tail 50
pnpm clawdbot providers list --usage
pnpm clawdbot skills list
# Web UI
open http://localhost:3001/logs
# Check routing
jq '.routing.bindings' ~/.clawdbot/clawdbot.json🎯 Critical Checks
# DM policies
jq '.whatsapp.dmPolicy, .telegram.dmPolicy' ~/.clawdbot/clawdbot.json
# Groups config
jq '.telegram.groups, .whatsapp.groups' ~/.clawdbot/clawdbot.json
# Sandbox config
jq '.agent.sandbox' ~/.clawdbot/clawdbot.json
# Per-agent config
jq '.routing.agents[] | {name, workspace, sandbox}' ~/.clawdbot/clawdbot.json
# Workspaces list
jq -r '.routing.agents | to_entries[] | "\(.key): \(.value.workspace)"' ~/.clawdbot/clawdbot.json🔥 Troubleshooting
# Logs with errors
pnpm clawdbot logs --grep error
# Run doctor
pnpm clawdbot doctor --yes
# Restart gateway
pnpm clawdbot gateway restart
# Kill stuck processes
pkill -f "clawdbot gateway"
# Check gateway ports
lsof -i :3001 -i :3002📦 Update Flow (Copy-Paste)
# 0. Dry run (optional)
~/.skills/clawdbot-update/backup-clawdbot-dryrun.sh
# 1. Backup
~/.skills/clawdbot-update/backup-clawdbot-full.sh
# 2. Stop
cd ~/code/clawdbot && pnpm clawdbot gateway stop
# 3. Update
git checkout main
git pull --rebase origin main
pnpm install
pnpm build
# 4. Config (adjust as needed)
jq '.whatsapp.dmPolicy = "pairing"' ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.json
jq '.agent.sandbox.scope = "agent"' ~/.clawdbot/clawdbot.json | sponge ~/.clawdbot/clawdbot.json
# 5. Doctor
pnpm clawdbot doctor --yes
# 6. Start
pnpm clawdbot gateway start --daemon
# 7. Verify
pnpm clawdbot gateway status
pnpm clawdbot logs --tail 20🎓 Version Check
# Current version
cd ~/code/clawdbot && git log -1 --oneline
# Upstream version
git fetch origin && git log main..origin/main --oneline | head -5
# Check for updates
git fetch origin && git diff --stat main..origin/main💾 Workspace Checks
# List configured workspaces
jq -r '.routing.agents | to_entries[] | "\(.key): \(.value.workspace)"' ~/.clawdbot/clawdbot.json
# Check workspace sizes
du -sh ~/clawd*
# Check .clawdbot size
du -sh ~/.clawdbot
# Backup size
du -sh ~/.clawdbot-backups/🔐 Auth Check
# List credentials
ls -la ~/.clawdbot/credentials/
# Check auth profiles
jq '.models' ~/.clawdbot/clawdbot.json
# Provider login status
pnpm clawdbot providers list⏱️ Time Estimates
| Task | Time |
|---|---|
| Backup | 2-3 min |
| Update code | 3-5 min |
| Config changes | 5-10 min |
| Doctor | 2-3 min |
| Testing | 10-15 min |
| Total | 25-35 min |
📞 Emergency Contacts
Logs: ~/.clawdbot/logs/ Backups: ~/.clawdbot-backups/ Config: ~/.clawdbot/clawdbot.json Skill: ~/.skills/clawdbot-update/
---
Last Updated: 2026-01-08 Target Version: v2026.1.8 Repository: https://github.com/clawdbot/clawdbot
Clawdbot Update Skill
Complete modular backup, update, and restore workflow for Clawdbot installations.
Repository: https://github.com/clawdbot/clawdbot
Quick Start
# 0. Dry run (see what would be backed up)
~/.skills/clawdbot-skill-update/backup-clawdbot-dryrun.sh
# 1. Create backup
~/.skills/clawdbot-skill-update/backup-clawdbot-full.sh
# 2. Follow checklist
cat ~/.skills/clawdbot-skill-update/UPDATE_CHECKLIST.md
# 3. Restore if needed
~/.skills/clawdbot-skill-update/restore-clawdbot.sh <backup-dir>Files
| File | Purpose |
|---|---|
SKILL.md | Complete skill documentation |
backup-clawdbot-dryrun.sh | Dry run - preview backup without changes |
backup-clawdbot-full.sh | Full backup script |
restore-clawdbot.sh | Restore from backup |
validate-setup.sh | Validate configuration |
check-upstream.sh | Check for updates |
UPDATE_CHECKLIST.md | Step-by-step update guide |
QUICK_REFERENCE.md | Quick command reference |
METADATA.md | Skill metadata and architecture |
What Gets Backed Up
- ✅ Configuration (
~/.clawdbot/clawdbot.json) - ✅ Sessions state
- ✅ Agent states (multi-agent)
- ✅ Credentials & auth tokens
- ✅ Cron jobs
- ✅ Sandbox states
- ✅ All agent workspaces (dynamically detected from config!)
- ✅ Git repository state (commit, branch, remotes)
Dynamic Workspace Detection
The scripts automatically discover all agent workspaces from your config:
# Reads from config:
.routing.agents.{agentId}.workspace
# Creates backups:
workspace-{agentId}.tar.gzNo hardcoded paths! Works with any agent configuration.
Critical Changes in v2026.1.8
⚠️ DM Lockdown: DMs default to pairing (was open) ⚠️ Groups: Now allowlists (add "*" for allow-all) ⚠️ Sandbox: Default scope is "agent" (was "session") ⚠️ Timestamps: UTC format in envelopes
Backup Location
~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS/
├── clawdbot.json
├── sessions.tar.gz
├── agents.tar.gz
├── credentials.tar.gz
├── cron.tar.gz
├── sandboxes.tar.gz
├── workspace-*.tar.gz # Dynamically detected!
├── git-version.txt
├── git-status.txt
└── BACKUP_INFO.txtUsage Examples
Before Major Update
# Full backup with validation
~/.skills/clawdbot-update/backup-clawdbot-full.sh
# Review what was backed up
ls -lh ~/.clawdbot-backups/pre-update-*/After Update (if issues)
# Find latest backup
ls -t ~/.clawdbot-backups/ | head -1
# Restore
~/.skills/clawdbot-update/restore-clawdbot.sh ~/.clawdbot-backups/<dir>Check Backup Status
LATEST=$(ls -t ~/.clawdbot-backups/ | head -1)
cat ~/.clawdbot-backups/$LATEST/BACKUP_INFO.txtTesting After Update
# New CLI features
pnpm clawdbot agents list
pnpm clawdbot logs --tail 50
pnpm clawdbot providers list --usage
# Web UI
open http://localhost:3001/logs
# Verify routing
# Send messages to your configured providersInstallation
Via ClawdHub (Recommended)
# Install from ClawdHub
clawdhub install clawdbot-skill-update
# Make scripts executable (required after ClawdHub install)
chmod +x ~/.skills/clawdbot-skill-update/*.shVia Git
# Clone to your skills directory
git clone https://github.com/pasogott/clawdbot-skill-update.git ~/.skills/clawdbot-skill-update
# Make scripts executable
chmod +x ~/.skills/clawdbot-skill-update/*.shQuick Test
# Test with dry run
~/.skills/clawdbot-skill-update/backup-clawdbot-dryrun.shSupport
For issues, consult: 1. UPDATE_CHECKLIST.md for step-by-step guidance 2. SKILL.md for detailed troubleshooting 3. Clawdbot logs: pnpm clawdbot logs --follow 4. Run doctor: pnpm clawdbot doctor
License
MIT - see LICENSE
Author
Pascal Schott (@pasogott)
Contribution for Clawdbot Repository: https://github.com/clawdbot/clawdbot
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}🔄 Clawdbot Restore Script${NC}"
echo -e "${BLUE}===========================${NC}"
echo ""
# Check if backup directory is provided
if [ -z "$1" ]; then
echo -e "${YELLOW}📁 Available backups:${NC}"
if [ -d ~/.clawdbot-backups ]; then
ls -lth ~/.clawdbot-backups/ | grep "^d" | head -5
else
echo " No backups found"
fi
echo ""
echo -e "${RED}Usage: $0 <backup-directory>${NC}"
echo -e "${YELLOW}Example: $0 ~/.clawdbot-backups/pre-update-20260108-094500${NC}"
exit 1
fi
BACKUP_DIR="$1"
# Validate backup directory
if [ ! -d "$BACKUP_DIR" ]; then
echo -e "${RED}❌ Backup directory not found: $BACKUP_DIR${NC}"
exit 1
fi
echo -e "${GREEN}📁 Restoring from: $BACKUP_DIR${NC}"
echo ""
# Show backup info
if [ -f "$BACKUP_DIR/BACKUP_INFO.txt" ]; then
echo -e "${BLUE}📋 Backup Info:${NC}"
head -20 "$BACKUP_DIR/BACKUP_INFO.txt"
echo ""
fi
# Check if backed up config exists
if [ ! -f "$BACKUP_DIR/clawdbot.json" ]; then
echo -e "${RED}❌ Invalid backup: clawdbot.json not found!${NC}"
exit 1
fi
# Confirmation
echo -e "${YELLOW}⚠️ WARNING: This will overwrite current configuration and workspaces!${NC}"
echo -e "${YELLOW}Press ENTER to continue or Ctrl+C to cancel...${NC}"
read -r
# Stop Gateway
echo ""
echo -e "${YELLOW}🛑 Stopping gateway...${NC}"
if [ -d ~/code/clawdbot ]; then
cd ~/code/clawdbot
pnpm clawdbot gateway stop 2>/dev/null || echo "Gateway already stopped"
sleep 2
else
echo -e "${YELLOW}⚠️ Clawdbot repo not found, skipping gateway stop${NC}"
fi
# Restore Config
echo ""
echo -e "${YELLOW}📋 Restoring config...${NC}"
cp "$BACKUP_DIR/clawdbot.json" ~/.clawdbot/clawdbot.json
echo -e "${GREEN}✅ Config restored${NC}"
# Restore Sessions
echo ""
echo -e "${YELLOW}💾 Restoring sessions...${NC}"
if [ -f "$BACKUP_DIR/sessions.tar.gz" ]; then
rm -rf ~/.clawdbot/sessions
tar -xzf "$BACKUP_DIR/sessions.tar.gz" -C ~/.clawdbot
echo -e "${GREEN}✅ Sessions restored${NC}"
else
echo -e "${BLUE}ℹ️ No sessions backup${NC}"
fi
# Restore Agents
echo ""
echo -e "${YELLOW}🤖 Restoring agents...${NC}"
if [ -f "$BACKUP_DIR/agents.tar.gz" ]; then
rm -rf ~/.clawdbot/agents
tar -xzf "$BACKUP_DIR/agents.tar.gz" -C ~/.clawdbot
echo -e "${GREEN}✅ Agents restored${NC}"
else
echo -e "${BLUE}ℹ️ No agents backup${NC}"
fi
# Restore Credentials
echo ""
echo -e "${YELLOW}🔐 Restoring credentials...${NC}"
if [ -f "$BACKUP_DIR/credentials.tar.gz" ]; then
rm -rf ~/.clawdbot/credentials
tar -xzf "$BACKUP_DIR/credentials.tar.gz" -C ~/.clawdbot
echo -e "${GREEN}✅ Credentials restored${NC}"
else
echo -e "${YELLOW}⚠️ No credentials backup${NC}"
fi
# Restore Cron
echo ""
echo -e "${YELLOW}⏰ Restoring cron...${NC}"
if [ -f "$BACKUP_DIR/cron.tar.gz" ]; then
rm -rf ~/.clawdbot/cron
tar -xzf "$BACKUP_DIR/cron.tar.gz" -C ~/.clawdbot
echo -e "${GREEN}✅ Cron restored${NC}"
else
echo -e "${BLUE}ℹ️ No cron backup${NC}"
fi
# Restore Sandboxes
echo ""
echo -e "${YELLOW}📦 Restoring sandboxes...${NC}"
if [ -f "$BACKUP_DIR/sandboxes.tar.gz" ]; then
rm -rf ~/.clawdbot/sandboxes
tar -xzf "$BACKUP_DIR/sandboxes.tar.gz" -C ~/.clawdbot
echo -e "${GREEN}✅ Sandboxes restored${NC}"
else
echo -e "${BLUE}ℹ️ No sandboxes backup${NC}"
fi
# Restore Workspaces (DYNAMIC!)
echo ""
echo -e "${YELLOW}🏠 Restoring workspaces (reading from restored config)...${NC}"
# Read workspaces from restored config
WORKSPACE_DATA=$(jq -r '.routing.agents // {} | to_entries[] | "\(.key)|\(.value.workspace // "none")|\(.value.name // .key)"' ~/.clawdbot/clawdbot.json)
if [ -z "$WORKSPACE_DATA" ]; then
echo -e "${BLUE}ℹ️ No agents configured${NC}"
else
RESTORED_COUNT=0
while IFS='|' read -r agent_id workspace agent_name; do
if [ "$workspace" != "none" ]; then
SAFE_NAME=$(echo "$agent_id" | tr '/' '_' | tr ' ' '-')
BACKUP_FILE="$BACKUP_DIR/workspace-${SAFE_NAME}.tar.gz"
if [ -f "$BACKUP_FILE" ]; then
echo -e " 📦 Restoring ${BLUE}$agent_id${NC} ($agent_name)..."
echo " Path: $workspace"
# Create workspace directory if it doesn't exist
mkdir -p "$workspace"
# Extract backup
tar -xzf "$BACKUP_FILE" -C "$workspace"
SIZE=$(du -sh "$workspace" 2>/dev/null | cut -f1)
echo -e " ${GREEN}✅ Restored ($SIZE)${NC}"
RESTORED_COUNT=$((RESTORED_COUNT+1))
else
echo -e " ${YELLOW}⚠️${NC} No backup found for '$agent_id' (expected: $BACKUP_FILE)"
fi
fi
done <<< "$WORKSPACE_DATA"
echo ""
echo -e "${GREEN}✅ Restored $RESTORED_COUNT workspace(s)${NC}"
fi
# Restore Git (optional)
echo ""
echo -e "${YELLOW}🔧 Git restore...${NC}"
if [ -f "$BACKUP_DIR/git-version.txt" ]; then
GIT_COMMIT=$(head -1 "$BACKUP_DIR/git-version.txt" | awk '{print $1}')
echo "Backup was from: $GIT_COMMIT"
echo -e "${YELLOW}Restore git to this version? (y/N)${NC}"
read -r response
if [[ "$response" =~ ^[Yy]$ ]]; then
if [ -d ~/code/clawdbot ]; then
cd ~/code/clawdbot
git checkout "$GIT_COMMIT"
pnpm install
pnpm build
echo -e "${GREEN}✅ Git restored to $GIT_COMMIT${NC}"
else
echo -e "${RED}❌ Git repository not found${NC}"
fi
else
echo -e "${BLUE}ℹ️ Keeping current git version${NC}"
fi
fi
# Summary
echo ""
echo -e "${BLUE}════════════════════════════════════════${NC}"
echo -e "${GREEN}✨ Restore Complete!${NC}"
echo -e "${BLUE}════════════════════════════════════════${NC}"
echo ""
echo -e "${YELLOW}📊 Restored Components:${NC}"
[ -f ~/.clawdbot/clawdbot.json ] && echo -e "${GREEN}✅${NC} Configuration"
[ -d ~/.clawdbot/sessions ] && echo -e "${GREEN}✅${NC} Sessions"
[ -d ~/.clawdbot/agents ] && echo -e "${GREEN}✅${NC} Agents"
[ -d ~/.clawdbot/credentials ] && echo -e "${GREEN}✅${NC} Credentials"
[ -d ~/.clawdbot/cron ] && echo -e "${GREEN}✅${NC} Cron jobs"
[ -d ~/.clawdbot/sandboxes ] && echo -e "${GREEN}✅${NC} Sandboxes"
# Count restored workspaces
if [ -n "$WORKSPACE_DATA" ]; then
while IFS='|' read -r agent_id workspace agent_name; do
if [ "$workspace" != "none" ] && [ -d "$workspace" ]; then
SIZE=$(du -sh "$workspace" 2>/dev/null | cut -f1)
echo -e "${GREEN}✅${NC} Workspace: $agent_id ($SIZE)"
fi
done <<< "$WORKSPACE_DATA"
fi
echo ""
echo -e "${YELLOW}💡 Next steps:${NC}"
echo "1. Verify config: jq '.' ~/.clawdbot/clawdbot.json | less"
echo "2. Validate setup: ~/.skills/clawdbot-update/validate-setup.sh"
echo "3. Start gateway: cd ~/code/clawdbot && pnpm clawdbot gateway start"
echo "4. Check status: pnpm clawdbot gateway status"
echo ""
Testing Guide
Pre-Publication Testing
Before publishing, test all functionality locally:
1. Script Permissions
cd /tmp/clawdbot-update-publish
# Check all scripts are executable
ls -la *.sh
# If not, fix:
chmod +x *.sh2. Dry Run Test
# Test dry run (should show what would be backed up)
./backup-clawdbot-dryrun.sh
# Expected output:
# - Workspace detection
# - Size calculations
# - List of files that would be created
# - No actual files created3. Backup Test
# Create test backup
./backup-clawdbot-full.sh
# Verify backup created
ls -lh ~/.clawdbot-backups/
# Check backup contents
LATEST=$(ls -t ~/.clawdbot-backups/ | head -1)
ls -lh ~/.clawdbot-backups/$LATEST/
cat ~/.clawdbot-backups/$LATEST/BACKUP_INFO.txt4. Validation Test
# Test validation
./validate-setup.sh
# Expected output:
# - Config check
# - Workspace analysis
# - Credentials check
# - Git state5. Upstream Check Test
# Test upstream check
./check-upstream.sh
# Expected output:
# - Current state
# - Fetch upstream
# - Commit comparison6. Restore Test (Careful!)
# Only test if you have a backup
# This will overwrite current config!
# Create safety backup first
cp ~/.clawdbot/clawdbot.json ~/.clawdbot/clawdbot.json.test-backup
# Test restore (will ask for confirmation)
./restore-clawdbot.sh ~/.clawdbot-backups/<backup-dir>
# Restore safety backup
mv ~/.clawdbot/clawdbot.json.test-backup ~/.clawdbot/clawdbot.json7. Package Validation
cd /tmp/clawdbot-update-publish
# Validate package.json
npm run validate 2>/dev/null || cat package.json | jq '.'
# Check .clawdhub.json
cat .clawdhub.json | jq '.'
# Test npm pack
npm pack
# Inspect tarball
tar -tzf clawdbot-skill-update-1.0.0.tgz8. Documentation Check
# Check all documentation files exist
for file in README.md SKILL.md UPDATE_CHECKLIST.md QUICK_REFERENCE.md PUBLISH.md; do
if [ -f "$file" ]; then
echo "✓ $file exists ($(wc -l < $file) lines)"
else
echo "✗ $file missing!"
fi
done
# Check for broken links (manual review)
grep -r "](/" *.md9. Security Check
# Check for personal data
echo "Checking for personal data..."
grep -r "pascal\|/Users/pascal\|clawd-family\|cyberheld\|120363" . --include="*.sh" --include="*.md" --include="*.json" || echo "✓ No personal data found"
# Check for sensitive patterns
grep -r "sk-\|token\|password\|secret" . --include="*.sh" --include="*.md" --include="*.json" || echo "✓ No secrets found"10. Installation Test
# Test installation from tarball
mkdir -p /tmp/test-install
cd /tmp/test-install
# Extract
tar -xzf /tmp/clawdbot-update-publish/clawdbot-skill-update-1.0.0.tgz
cd package
# Make executable
chmod +x *.sh
# Test scripts
./backup-clawdbot-dryrun.sh
./validate-setup.sh
./check-upstream.shTesting Checklist
- [ ] All scripts are executable
- [ ] Dry run works without creating files
- [ ] Backup creates valid backup directory
- [ ] Backup includes all expected files
- [ ] Workspaces are detected dynamically
- [ ] Validation script runs without errors
- [ ] Upstream check connects to GitHub
- [ ] Restore works (tested safely)
- [ ] package.json is valid JSON
- [ ] .clawdhub.json is valid JSON
- [ ] No personal data in any file
- [ ] No secrets or tokens
- [ ] All documentation files present
- [ ] npm pack succeeds
- [ ] Installation from tarball works
Expected Test Results
Dry Run Output
🔍 Clawdbot Backup Dry Run
===========================
This is a DRY RUN - no files will be created or modified
📁 Would create backup at:
~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS
✓ Config file: ~/.clawdbot/clawdbot.json
✓ Detected workspaces from config
✓ Would backup X workspace(s)
✨ Dry run complete!Validation Output
🔍 Clawdbot Setup Validation
============================
✅ Config file exists
✅ Workspace(s) ready
✅ Credentials directory exists
✅ Git repository foundPackage Structure
package/
├── backup-clawdbot-dryrun.sh
├── backup-clawdbot-full.sh
├── restore-clawdbot.sh
├── validate-setup.sh
├── check-upstream.sh
├── config.json
├── README.md
├── SKILL.md
├── UPDATE_CHECKLIST.md
├── QUICK_REFERENCE.md
└── LICENSEPost-Test Cleanup
# Remove test installations
rm -rf /tmp/test-install
# Keep one test backup for reference
LATEST=$(ls -t ~/.clawdbot-backups/ | head -1)
echo "Test backup preserved: ~/.clawdbot-backups/$LATEST"
# Remove npm tarball
rm /tmp/clawdbot-update-publish/*.tgzReady for Publication?
If all tests pass: 1. Review PUBLISH.md 2. Create GitHub repository 3. Publish to npm 4. Submit to ClawdHub
Troubleshooting Tests
Script won't execute
chmod +x *.shBackup fails
# Check config exists
ls -la ~/.clawdbot/clawdbot.json
# Check permissions
ls -la ~/.clawdbot/Workspace detection fails
# Check config structure
jq '.routing.agents' ~/.clawdbot/clawdbot.jsonnpm pack fails
# Validate JSON
cat package.json | jq '.'
# Check required fields
jq '{name, version, author, license}' package.json---
Author: Pascal Schott (@pasogott) License: MIT
Clawdbot Update to v2026.1.8 - Checklist
✅ Pre-Update Checklist
- [ ] Backup created:
/tmp/backup-clawdbot-full.sh - [ ] Gateway stopped:
pnpm clawdbot gateway stop - [ ] Backup validated: All important files present
- [ ] Time window: 45-60 minutes planned
📦 Backup Locations
# Backup Script
~/.skills/clawdbot-update/backup-clawdbot-full.sh
# Restore Script
~/.skills/clawdbot-update/restore-clawdbot.sh
# Backup will be saved in:
~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS/🚀 Update Steps
1. Backup (10 min)
~/.skills/clawdbot-update/backup-clawdbot-dryrun.sh # Dry run first
~/.skills/clawdbot-update/backup-clawdbot-full.sh2. Update Code (5 min)
cd ~/code/clawdbot # Or your clawdbot path
git checkout main
git pull --rebase origin main
pnpm install
pnpm build3. Config Adjustments (10 min)
A) WhatsApp/Telegram dmPolicy (CRITICAL!)
# Check current policy
jq '.whatsapp.dmPolicy, .telegram.dmPolicy' ~/.clawdbot/clawdbot.json
# Option 1: Use pairing (recommended for security)
jq '.whatsapp.dmPolicy = "pairing" | .telegram.dmPolicy = "pairing"' ~/.clawdbot/clawdbot.json > /tmp/temp.json
mv /tmp/temp.json ~/.clawdbot/clawdbot.json
# Option 2: Keep allowlist (verify your allowFrom list!)
jq '.whatsapp.allowFrom, .telegram.allowFrom' ~/.clawdbot/clawdbot.jsonB) Sandbox Scope (set explicitly)
jq '.agent.sandbox.scope = "agent"' ~/.clawdbot/clawdbot.json > /tmp/temp.json
mv /tmp/temp.json ~/.clawdbot/clawdbot.jsonC) User Timezone (optional)
# Set your timezone for better timestamps
jq '.agent.userTimezone = "America/New_York"' ~/.clawdbot/clawdbot.json > /tmp/temp.json
mv /tmp/temp.json ~/.clawdbot/clawdbot.json4. Doctor (5 min)
cd ~/code/clawdbot
pnpm clawdbot gateway start # Foreground
# New terminal:
pnpm clawdbot doctor --yes5. Tests (10 min)
Provider Tests
- [ ] Test DM to bot → Works with pairing
- [ ] Test group mentions → Bot responds
- [ ] Test media upload → Works
Multi-Agent (if configured)
- [ ] Agent routing works correctly
- [ ] Sandbox isolation works
- [ ] Tool restrictions work
New Features
- [ ]
pnpm clawdbot agents list - [ ]
pnpm clawdbot logs --tail 50 - [ ]
pnpm clawdbot providers list --usage - [ ] Web UI Logs Tab: http://localhost:3001/logs
6. Production (5 min)
# Gateway as daemon
pnpm clawdbot gateway stop # If foreground
pnpm clawdbot gateway start --daemon
pnpm clawdbot gateway status🆘 Rollback
# Restore Script
~/.skills/clawdbot-update/restore-clawdbot.sh ~/.clawdbot-backups/pre-update-YYYYMMDD-HHMMSS
# Or manually:
cd ~/code/clawdbot
git checkout <old-commit>
pnpm install && pnpm build
cp ~/.clawdbot-backups/pre-update-*/clawdbot.json ~/.clawdbot/
pnpm clawdbot gateway restart⚠️ Breaking Changes Check
- [ ] DM Policy: Check pairing vs allowlist
- [ ] Groups: Verify allowlists (add
"*"for all) - [ ] Sandbox: Scope explicitly set
- [ ] Timestamps: Check if custom parsing needed
- [ ] Slash Commands: Authorization works
- [ ] Model Config: Doctor migrated
📊 Monitoring (24h)
Logs
pnpm clawdbot logs --follow
# Or: Web UI → http://localhost:3001/logsStatus
pnpm clawdbot status
pnpm clawdbot providers list --usage
pnpm clawdbot agents listWatch For
- [ ] No auth errors in logs
- [ ] Typing indicators work (not stuck)
- [ ] Sandbox containers run
- [ ] Sessions route correctly
📝 Configuration Examples
Multi-Agent Example
{
"routing": {
"agents": {
"main": {
"name": "Main Assistant",
"workspace": "~/clawd"
},
"work": {
"name": "Work Assistant",
"workspace": "~/clawd-work",
"sandbox": {
"mode": "all",
"scope": "agent"
}
}
}
}
}Provider DM Policies
{
"telegram": {
"dmPolicy": "pairing"
},
"whatsapp": {
"dmPolicy": "allowlist",
"allowFrom": ["+1234567890", "+9876543210"]
}
}🎯 Success Criteria
✅ Gateway runs stable ✅ Provider DMs + Groups work ✅ Multi-Agent routing works (if configured) ✅ Sandbox isolation works (if configured) ✅ No auth errors ✅ No stuck typing indicators ✅ New CLI tools work
📞 If Problems
1. Logs: pnpm clawdbot logs --grep error 2. Doctor: pnpm clawdbot doctor 3. Restart: pnpm clawdbot gateway restart 4. Rollback: Use restore script with backup directory
---
Backup Location: ~/.clawdbot-backups/pre-update-* Update Date: $(date) Target Version: v2026.1.8 Estimated Time: 45-60 minutes
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}🔍 Clawdbot Setup Validation${NC}"
echo -e "${BLUE}============================${NC}"
echo ""
# Check if config exists
echo -e "${YELLOW}📋 Configuration Check${NC}"
if [ -f ~/.clawdbot/clawdbot.json ]; then
echo -e "${GREEN}✅${NC} Config file exists"
CONFIG_SIZE=$(du -h ~/.clawdbot/clawdbot.json | cut -f1)
echo " Size: $CONFIG_SIZE"
else
echo -e "${RED}❌${NC} Config file missing!"
exit 1
fi
# Check critical config values
echo ""
echo -e "${YELLOW}🔧 Critical Config Values${NC}"
TELEGRAM_DM=$(jq -r '.telegram.dmPolicy // "not set"' ~/.clawdbot/clawdbot.json)
WHATSAPP_DM=$(jq -r '.whatsapp.dmPolicy // "not set"' ~/.clawdbot/clawdbot.json)
SANDBOX_SCOPE=$(jq -r '.agent.sandbox.scope // "not set"' ~/.clawdbot/clawdbot.json)
echo "Telegram dmPolicy: $TELEGRAM_DM"
[ "$TELEGRAM_DM" = "pairing" ] && echo -e "${GREEN} ✅ Secure (pairing)${NC}" || echo -e "${YELLOW} ⚠️ Not pairing${NC}"
echo "WhatsApp dmPolicy: $WHATSAPP_DM"
[ "$WHATSAPP_DM" = "pairing" ] && echo -e "${GREEN} ✅ Secure (pairing)${NC}" || echo -e "${YELLOW} ⚠️ Using: $WHATSAPP_DM${NC}"
echo "Sandbox scope: $SANDBOX_SCOPE"
[ "$SANDBOX_SCOPE" = "agent" ] && echo -e "${GREEN} ✅ Explicit agent scope${NC}" || echo -e "${YELLOW} ⚠️ Using: $SANDBOX_SCOPE${NC}"
# Check workspaces
echo ""
echo -e "${YELLOW}🏠 Workspace Check${NC}"
WORKSPACES=$(jq -r '.routing.agents | to_entries[] | "\(.key):\(.value.workspace)"' ~/.clawdbot/clawdbot.json)
while IFS=: read -r agent workspace; do
if [ -d "$workspace" ]; then
SIZE=$(du -sh "$workspace" 2>/dev/null | cut -f1)
echo -e "${GREEN}✅${NC} $agent: $workspace ($SIZE)"
else
echo -e "${RED}❌${NC} $agent: $workspace (missing!)"
fi
done <<< "$WORKSPACES"
# Check credentials
echo ""
echo -e "${YELLOW}🔐 Credentials Check${NC}"
if [ -d ~/.clawdbot/credentials ]; then
CRED_COUNT=$(find ~/.clawdbot/credentials -type f | wc -l | tr -d ' ')
echo -e "${GREEN}✅${NC} Credentials directory exists ($CRED_COUNT files)"
else
echo -e "${RED}❌${NC} Credentials directory missing!"
fi
# Check sessions
echo ""
echo -e "${YELLOW}💾 Sessions Check${NC}"
if [ -d ~/.clawdbot/sessions ]; then
SESSION_COUNT=$(find ~/.clawdbot/sessions -type f -name "*.jsonl" 2>/dev/null | wc -l | tr -d ' ')
echo -e "${GREEN}✅${NC} Sessions directory exists ($SESSION_COUNT session files)"
else
echo -e "${BLUE}ℹ️${NC} No sessions directory (normal for fresh install)"
fi
# Check agents
echo ""
echo -e "${YELLOW}🤖 Multi-Agent Setup${NC}"
if [ -d ~/.clawdbot/agents ]; then
AGENT_DIRS=$(find ~/.clawdbot/agents -maxdepth 1 -type d | tail -n +2 | wc -l | tr -d ' ')
echo -e "${GREEN}✅${NC} Agents directory exists ($AGENT_DIRS agents)"
# List agents
for agent_dir in ~/.clawdbot/agents/*/; do
if [ -d "$agent_dir" ]; then
agent_name=$(basename "$agent_dir")
echo " - $agent_name"
fi
done
else
echo -e "${BLUE}ℹ️${NC} No agents directory"
fi
# Check git repo
echo ""
echo -e "${YELLOW}🔧 Git Repository${NC}"
if [ -d ~/code/clawdbot/.git ]; then
cd ~/code/clawdbot
CURRENT_COMMIT=$(git log -1 --oneline)
CURRENT_BRANCH=$(git branch --show-current)
echo -e "${GREEN}✅${NC} Git repository exists"
echo " Branch: $CURRENT_BRANCH"
echo " Commit: $CURRENT_COMMIT"
# Check for uncommitted changes
if [ -n "$(git status --short)" ]; then
echo -e "${YELLOW} ⚠️ Uncommitted changes:${NC}"
git status --short | head -5
fi
else
echo -e "${RED}❌${NC} Git repository not found!"
fi
# Check clawdbot binary
echo ""
echo -e "${YELLOW}🔨 Clawdbot Binary${NC}"
CLAWDBOT_BIN=$(which clawdbot)
if [ -n "$CLAWDBOT_BIN" ]; then
echo -e "${GREEN}✅${NC} clawdbot found: $CLAWDBOT_BIN"
if [ -L "$CLAWDBOT_BIN" ]; then
TARGET=$(readlink "$CLAWDBOT_BIN")
echo " Symlink to: $TARGET"
fi
else
echo -e "${RED}❌${NC} clawdbot not in PATH!"
fi
# Check gateway status
echo ""
echo -e "${YELLOW}🚀 Gateway Status${NC}"
cd ~/code/clawdbot
GATEWAY_STATUS=$(pnpm clawdbot gateway status 2>&1)
if echo "$GATEWAY_STATUS" | grep -q "running"; then
echo -e "${GREEN}✅${NC} Gateway is running"
else
echo -e "${YELLOW}⚠️${NC} Gateway is not running"
fi
# Check recent backups
echo ""
echo -e "${YELLOW}💾 Recent Backups${NC}"
if [ -d ~/.clawdbot-backups ]; then
BACKUP_COUNT=$(find ~/.clawdbot-backups -maxdepth 1 -type d | tail -n +2 | wc -l | tr -d ' ')
echo -e "${GREEN}✅${NC} Backup directory exists ($BACKUP_COUNT backups)"
# Show 3 most recent
echo " Recent backups:"
ls -td ~/.clawdbot-backups/*/ 2>/dev/null | head -3 | while read backup; do
SIZE=$(du -sh "$backup" 2>/dev/null | cut -f1)
NAME=$(basename "$backup")
echo " - $NAME ($SIZE)"
done
else
echo -e "${BLUE}ℹ️${NC} No backups yet (run backup script first)"
fi
# Check disk space
echo ""
echo -e "${YELLOW}💿 Disk Space${NC}"
DISK_AVAIL=$(df -h ~ | tail -1 | awk '{print $4}')
echo "Available: $DISK_AVAIL"
# Summary
echo ""
echo -e "${BLUE}════════════════════════════════════════${NC}"
echo -e "${GREEN}📊 Summary${NC}"
echo -e "${BLUE}════════════════════════════════════════${NC}"
ISSUES=0
# Config
[ ! -f ~/.clawdbot/clawdbot.json ] && ISSUES=$((ISSUES+1))
# Workspaces
while IFS=: read -r agent workspace; do
[ ! -d "$workspace" ] && ISSUES=$((ISSUES+1))
done <<< "$WORKSPACES"
# Credentials
[ ! -d ~/.clawdbot/credentials ] && ISSUES=$((ISSUES+1))
# Git
[ ! -d ~/code/clawdbot/.git ] && ISSUES=$((ISSUES+1))
# Binary
[ -z "$CLAWDBOT_BIN" ] && ISSUES=$((ISSUES+1))
if [ $ISSUES -eq 0 ]; then
echo -e "${GREEN}✅ All checks passed! Setup looks good.${NC}"
echo ""
echo -e "${BLUE}💡 Ready to update:${NC}"
echo " ~/.skills/clawdbot-update/backup-clawdbot-full.sh"
else
echo -e "${YELLOW}⚠️ Found $ISSUES issue(s). Review output above.${NC}"
fi
echo ""