openclaw-backup
v1.0.0
Published
Backup & restore your entire ~/.openclaw directory to a private GitHub repo
Maintainers
Readme
openclaw-backup
Backup & restore your entire ~/.openclaw directory to a private GitHub repo.
One command to save everything. One command to restore it on a new machine.
What gets backed up
~/.openclaw/
├── workspace/ # SOUL.md, MEMORY.md, USER.md, skills/, memory/
├── agents/ # Agent configs, models
├── kube/ # Kubeconfig (all clusters)
├── credentials/ # Stored credentials
├── extensions/ # Plugins (Zalo, etc.)
├── openclaw.json # Main config (API keys, bot tokens)
└── ... # Everything elseInstall & Use
# Set your GitHub token
export GITHUB_TOKEN=ghp_xxxx
# Backup (auto-creates private repo if needed)
npx openclaw-backup backup --repo myuser/openclaw-backup
# Restore on new machine
npx openclaw-backup restore --repo myuser/openclaw-backup
# Check status
npx openclaw-backup status --repo myuser/openclaw-backupEnvironment Variables
| Variable | Description |
|----------|-------------|
| GITHUB_TOKEN | GitHub personal access token (required) |
| OPENCLAW_BACKUP_REPO | Default repo (skip --repo flag) |
| OPENCLAW_HOME | Override ~/.openclaw path |
Safety
- Refuses to push to public repos (checks via GitHub API)
- Auto-creates private repo if it doesn't exist
- Uses staging directory — never modifies your workspace during backup
- Excludes:
media/inbound,logs,.git(re-downloadable / runtime)
Restore on fresh machine
# 1. Install Node.js 18+
# 2. Set token
export GITHUB_TOKEN=ghp_xxxx
# 3. Restore
npx openclaw-backup restore --repo myuser/openclaw-backup
# 4. Set kubeconfig
export KUBECONFIG=~/.openclaw/kube/config
# 5. Verify
kubectl config get-contextsPublish to npm
# Login to npm
npm login
# Publish (public package, free)
npm publish
# Now anyone can use:
npx openclaw-backup backup --repo myuser/openclaw-backupTo update:
# Bump version
npm version patch
# Publish
npm publishLicense
MIT
