@clawmover/cli
v0.1.0
Published
Backup, restore, and migrate OpenClaw data
Maintainers
Readme
@clawmover/cli
Command-line tool for OpenClaw data backup and recovery.
Features
- 🔄 Auto Backup: Backup OpenClaw data to remote servers
- 📥 Data Recovery: Quickly restore data from server to local
- 🔒 Data Encryption: All backup data encrypted with data-secret-key
- ⚡ Incremental Backup: Restic-based incremental backup saves storage
- 🏷️ Tag Management: Organize and filter backups with tags
- ⚖️ Conflict Handling: Multiple strategies for file conflicts
- 📊 Progress Display: Real-time backup and restore progress
- 🔍 Detailed Logs: Complete operation log records
Installation
npm install -g @clawmover/cliOr install from source:
git clone https://github.com/clawmover/clawmover-cli.git
cd clawmover-cli
npm install
npm run build
npm linkConfiguration
The tool automatically reads OpenClaw config file. You can also override via command-line options:
# Show config file path
openclaw config fileUsage
Backup Data
Basic backup command:
clawmover backupSpecify instance ID and key:
clawmover backup --instance-id your-instance-id --data-secret-key your-secret-keyAdvanced options:
clawmover backup \
--instance-id your-instance-id \
--data-secret-key your-secret-key \
--tags production,daily \
--conflict-strategy smart \
--skip-temp \
--skip-cache \
--log-level debugOptions:
--instance-id <id>: Instance ID (override config file)--data-secret-key <key>: Data secret key (override config file)--tags <tags>: Comma-separated tag list--conflict-strategy <strategy>: Conflict strategy (smart|interactive|overwrite), default: smart--skip-temp: Skip temporary files--skip-cache: Skip cache files--storage-path <path>: Custom storage path--log-level <level>: Log level (debug|info|warn|error)
Restore Data
Basic restore command:
clawmover restoreSpecify snapshot ID:
clawmover restore --snapshot-id abc123Filter by tags:
clawmover restore --tags core,imessage-dbAdvanced options:
clawmover restore \
--instance-id your-instance-id \
--data-secret-key your-secret-key \
--snapshot-id abc123 \
--tags core \
--conflict-strategy interactive \
--target-path /tmp/restore \
--log-level infoOptions:
--instance-id <id>: Instance ID (override config file)--data-secret-key <key>: Data secret key (override config file)--snapshot-id <id>: Snapshot ID to restore (default: latest)--tags <tags>: Comma-separated tags to filter snapshots--conflict-strategy <strategy>: Conflict strategy (smart|interactive|overwrite), default: smart--target-path <path>: Target directory for restoration--log-level <level>: Log level (debug|info|warn|error)
Conflict Handling Strategies
Smart (Recommended)
- Config files: Ask user for decision
- Database: Auto backup old version
- Attachments: Rename local file
- Regular files: Compare modification time, keep newer
Interactive
Ask user for each conflict:
- Backup existing file and overwrite
- Rename existing file
- Skip this file
- Overwrite directly
Overwrite
Overwrite all conflicting files without backup
Backup Plan
The tool automatically generates backup plan with these data types:
Core Data (Required)
- OpenClaw core config and data
- Tag:
core
iMessage Database (Optional)
- If
imessageDbis configured - Tags:
imessage-db,core
- If
iMessage Attachments (Optional)
- If
imessageAttachmentsis configured - Tags:
imessage-attachments,core
- If
Sandbox Data (Optional)
- Sandbox environment data
- Tag:
sandbox
Cache Data (Optional)
- Application cache
- Tag:
cache
Temporary Files (Optional)
- Temporary files
- Tag:
temp
Tag System
Use tags to organize and filter backups:
# Create backup with tags
clawmover backup --tags production,daily
# Restore specific tagged data
clawmover restore --tags production
# List all backups for an instance
clawmover list --instance-id your-instance-idAuto-added tags:
instance:<instanceId>: Instance IDdate:<YYYY-MM-DD>: Backup date
Logging and Debugging
Set log level:
# Verbose debug info
clawmover backup --log-level debug
# Errors only
clawmover backup --log-level errorLog file is saved to ./logs/clawmover.log by default.
Development
Project Structure
@clawmover/cli/
├── src/
│ ├── commands/ # Command execution layer
│ ├── services/ # Core service layer
│ ├── integrations/ # External integration layer
│ ├── system/ # System service layer
│ ├── types/ # Type definitions
│ ├── utils/ # Utility functions
│ └── index.ts # Entry point
├── tests/ # Test files
├── package.json
├── tsconfig.json
└── README.mdBuild
npm run buildTest
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverageCode Quality
# Lint
npm run lint
# Auto fix
npm run lint:fix
# Format code
npm run formatTroubleshooting
Backup Failed
- Check network connection
- Verify
data-secret-keyis correct - Check log file for detailed error info
Restore Failed
- Confirm snapshot ID exists
- Check target directory permissions
- Verify
data-secret-keymatches the backup
OpenClaw Config Not Found
Run this command to check config file location:
openclaw config fileLicense
MIT
Support
For issues or suggestions, visit:
- GitHub Issues: https://github.com/clawmover/clawmover-cli/issues
- Documentation: https://github.com/clawmover/clawmover-cli#readme
