Back up your OpenClaw workspace to Box.com with JWT authentication.
ClawBox is a ClawHub skill that automatically backs up your OpenClaw workspace files to Box.com using secure JWT authentication. Never lose your AI agent's memory, configurations, or custom scripts again.
- π Secure JWT authentication - No passwords or API keys to manage
- π Timestamped backups - Each backup creates a dated folder for easy versioning
- βοΈ Configurable - Choose which files and directories to back up
- π€ Automation-ready - Perfect for cron jobs and scheduled backups
- π Progress reporting - See exactly what was backed up and any failures
- π‘οΈ Safe defaults - Backs up essential OpenClaw files out of the box
clawhub install clawbox- Box.com account (free tier works)
- Box CLI installed
- OpenClaw workspace you want to back up
- Go to Box Developer Console
- Create New App β Custom App β Server Authentication (with JWT)
- App name: "OpenClaw Backup" (or whatever you prefer)
- Configuration tab:
- β Enable "Write all files and folders" scope
- Click "Generate a public/private keypair" and download the JSON config file
- Authorization tab:
- Submit for approval or auto-approve if you're an admin
# Install Box CLI (macOS)
brew install box/box-cli/box
# Authorize with your JWT config file
box configure:environments:add --config-file-path /path/to/your/box_config.json --name defaultCreate your config file:
mkdir -p ~/.clawbox
cat > ~/.clawbox/config.json << 'EOF'
{
"box_folder_id": "YOUR_BOX_FOLDER_ID",
"workspace_path": "/Users/yourusername/.openclaw/workspace",
"backup_files": [
"AGENTS.md",
"SOUL.md",
"USER.md",
"IDENTITY.md",
"TOOLS.md",
"HEARTBEAT.md",
"MEMORY.md"
],
"backup_directories": [
"memory",
"scripts"
]
}
EOFTo get your Box folder ID:
- Create a folder on Box.com for your backups (e.g., "OpenClaw Backups")
- Open the folder in your browser
- Copy the folder ID from the URL:
box.com/folder/FOLDER_ID_HERE - Replace
YOUR_BOX_FOLDER_IDin the config above
cd ~/.openclaw/skills/clawbox
./scripts/box-backup.shYou should see output like:
π¦ Starting ClawBox backup to Box.com β 2024-12-17_1430
π Workspace: /Users/yourusername/.openclaw/workspace
π Created backup folder: 2024-12-17_1430 (ID: 123456789)
β
AGENTS.md
β
SOUL.md
β
USER.md
β
memory/2024-12-16.md
β
memory/2024-12-17.md
β
scripts/my-script.sh
π Backup complete: 6 uploaded, 0 failed
π Box.com backup folder: 2024-12-17_1430
./scripts/box-backup.sh./scripts/box-backup.sh --quietSet up automated backups with cron:
# Edit your crontab
crontab -e
# Add one of these lines:
# Daily backup at 2 AM
0 2 * * * /Users/yourusername/.openclaw/skills/clawbox/scripts/box-backup.sh --quiet
# Every 6 hours
0 */6 * * * /Users/yourusername/.openclaw/skills/clawbox/scripts/box-backup.sh --quiet
# Weekly backup on Sundays at 3 AM
0 3 * * 0 /Users/yourusername/.openclaw/skills/clawbox/scripts/box-backup.sh --quiet{
"box_folder_id": "123456789",
"workspace_path": "/Users/username/.openclaw/workspace",
"backup_files": [
"AGENTS.md",
"SOUL.md",
"USER.md",
"IDENTITY.md",
"TOOLS.md",
"HEARTBEAT.md",
"MEMORY.md",
"custom-file.md"
],
"backup_directories": [
"memory",
"scripts",
"skills"
]
}You can override config settings with environment variables:
CLAWBOX_BOX_FOLDER_ID- Target Box folder IDCLAWBOX_WORKSPACE_PATH- OpenClaw workspace pathCLAWBOX_CONFIG_PATH- Config file location (default:~/.clawbox/config.json)
Example:
CLAWBOX_BOX_FOLDER_ID=987654321 ./scripts/box-backup.shBy default, ClawBox backs up:
Core Files:
AGENTS.md- Your agent's configuration and behaviorSOUL.md- Your agent's personality and identityUSER.md- Information about you for personalizationTOOLS.md- Local tool configurations and notesMEMORY.md- Your agent's long-term memoryHEARTBEAT.md- Proactive task configurationIDENTITY.md- Additional identity configuration
Directories:
memory/- Daily memory files and contextscripts/- Custom automation scripts
Each backup creates a timestamped folder on Box.com, so you can easily browse backup history and restore specific versions.
β "Failed to create subfolder on Box"
- Check that your
box_folder_idis correct - Verify your Box app has "Write all files and folders" permission
- Test Box CLI:
box folders:get YOUR_FOLDER_ID
β "box: command not found"
- Install Box CLI:
brew install box/box-cli/box - Or download from GitHub releases
β "Unauthorized" or "Invalid JWT"
- Re-run Box CLI setup:
box configure:environments:add --config-file-path /path/to/config.json - Check that your Box app is approved in Developer Console
- Verify the JWT config file is downloaded correctly
β "jq: command not found"
- Install jq for JSON parsing:
brew install jq
β "Config file not found"
- Create config file at
~/.clawbox/config.json(see setup instructions) - Or set
CLAWBOX_CONFIG_PATHenvironment variable
β "Workspace directory not found"
- Update
workspace_pathin your config file - Check that OpenClaw is installed and the workspace exists
-
Test Box CLI connection:
box folders:get YOUR_FOLDER_ID
-
Test ClawBox with dry run:
# Check what would be backed up (won't actually upload) ./scripts/box-backup.sh --quiet 2>&1 | grep "β \|β\|β οΈ"
-
Verify backup on Box.com:
- Log into Box.com
- Navigate to your backup folder
- Look for timestamped folders with your files
- No credentials stored: ClawBox doesn't store any Box.com credentials - they're managed securely by Box CLI
- Local configuration only: Your config file only contains non-sensitive folder IDs and file paths
- JWT authentication: Uses Box's secure JWT standard for server-to-server authentication
- No network exposure: Runs locally on your machine, only uploads to your Box account
MIT License - see LICENSE for details.
Issues and pull requests welcome! This is an open-source ClawHub skill.
Made with β€οΈ for the OpenClaw community