Install
openclaw skills install self-backupBackup OpenClaw workspace files like AGENTS.md, SOUL.md, scripts/, and configs to a GitHub repo, with token sanitization and version control.
openclaw skills install self-backupBackup critical OpenClaw workspace files to your GitHub repository for safe keeping and version control.
# Ubuntu/Debian
sudo apt install gh
# macOS
brew install gh
# Other platforms: https://cli.github.com/
gh auth login
Edit the configuration in the backup script or set environment variables:
# Set your repository URL (replace with your repo)
export BACKUP_REPO_URL="https://github.com/YOUR_USERNAME/YOUR_BACKUP_REPO.git"
# Or edit the script directly
nano scripts/backup.sh
# Create a private repository for your backups
gh repo create YOUR_USERNAME/openclaw-backup --private --description "OpenClaw workspace backup"
AGENTS.md - Workflow documentation and proceduresSOUL.md - Personal assistant personality and behaviorUSER.md - Personal profile and preferencesMEMORY.md - Long-term memory and important contextIDENTITY.md - Assistant identity and emojiTOOLS.md - Tool configuration and local notesAUTOMATION.md - Cron and scheduling documentationopenclaw.json - OpenClaw system settings (tokens sanitized for security)scripts/ directory - All automation scriptsmemory/ directory - Daily memory logs (last 30 days)skills/ directory - Local skill installations (metadata only)Files are organized in the backup repository as:
/
├── config/ # Core configuration files
├── scripts/ # Automation scripts
├── memory/ # Daily memory logs
├── skills/ # Skill configurations
└── backup-info.md # Backup metadata
scripts/setup.sh
scripts/backup.sh
scripts/backup.sh --force # Force push even with conflicts
scripts/backup.sh --dry-run # Show what would be backed up
Edit these variables in scripts/backup.sh:
# Your GitHub repository URL
REPO_URL="https://github.com/YOUR_USERNAME/YOUR_BACKUP_REPO.git"
# Workspace directory (usually auto-detected)
WORKSPACE_DIR="$HOME/.openclaw/workspace"
To backup specific files manually:
# Clone your backup repository
git clone https://github.com/YOUR_USERNAME/YOUR_BACKUP_REPO.git /tmp/backup
cd /tmp/backup
# Copy important files
cp ~/.openclaw/workspace/AGENTS.md config/
cp ~/.openclaw/workspace/SOUL.md config/
# ... etc
# Commit and push
git add .
git commit -m "Manual backup $(date)"
git push origin main
To restore from backup:
# Clone the backup
git clone https://github.com/YOUR_USERNAME/YOUR_BACKUP_REPO.git
# Copy files back to workspace
cp backup/config/* ~/.openclaw/workspace/
cp -r backup/scripts/* ~/.openclaw/workspace/scripts/
# ... etc
# Re-enter your actual tokens in openclaw.json
nano ~/.openclaw/openclaw.json
# Re-login to GitHub
gh auth logout
gh auth login
# Check repository exists and you have access
gh repo view YOUR_USERNAME/YOUR_BACKUP_REPO
# Set git identity if needed
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"