Zhuaxia
by @lovelcp
Export and import OpenClaw instances as portable .claw packages for backup, sharing, and migration. Use when: user wants to back up, share, migrate, or resto...
clawhub install zhuaxia๐ About This Skill
name: zhuaxia description: "Export and import OpenClaw instances as portable .claw packages for backup, sharing, and migration. Use when: user wants to back up, share, migrate, or restore their OpenClaw setup. Triggers: 'export claw', 'save my setup', 'backup my instance', 'import claw', 'load this claw', 'install this claw package', 'migrate openclaw', 'rollback', 'undo import'." metadata: { "openclaw": { "emoji": "๐ฆ", "requires": { "bins": ["node"] }, }, }
Zhuaxia (ๆ่พ) โ OpenClaw Instance Export/Import
Export and import entire OpenClaw instances as portable .claw packages. Sensitive data (API keys, tokens) is automatically stripped. Auto-backup before import, with rollback support.
CLI Reference
Save (Export)
node {baseDir}/scripts/clawctl.mjs save [options]
| Flag | Description | Default |
|------|-------------|---------|
| -o | Output file path | ./ |
| --source | OpenClaw state directory | ~/.openclaw |
| --description | Package description | (empty) |
| --include-memory | Include MEMORY.md | false |
Load (Import)
node {baseDir}/scripts/clawctl.mjs load [options]
Load automatically creates a backup before installing. This can be skipped with --no-backup.
| Flag | Description | Default |
|------|-------------|---------|
| --target | Target OpenClaw state dir | ~/.openclaw |
| --agent-name | Name for the imported agent | from manifest |
| --dry-run | Preview without installing | false |
| --no-backup | Skip auto-backup | false |
Backup
node {baseDir}/scripts/clawctl.mjs backup [--source ] [--label ]
Create a snapshot of current workspace + config. Stored in ~/.openclaw/.zhuaxia-backups/.
List Backups
node {baseDir}/scripts/clawctl.mjs backups [--source ]
Rollback
node {baseDir}/scripts/clawctl.mjs rollback [] [--target ]
Restore from a backup. If no given, uses the latest. Before restoring, a safety backup of the current state is created automatically.
AI Agent Behavior Guide
When the user triggers this skill, follow the intelligent workflows below instead of blindly running commands.
Export Workflow
When the user says things like "ๅฏผๅบ claw", "export my setup", "backup my openclaw":
Step 1 โ Gather context automatically
Before asking the user anything, silently gather:
# Check what's in the workspace
ls ~/.openclaw/workspace/Read identity to infer a good package name
cat ~/.openclaw/workspace/IDENTITY.md 2>/dev/null | head -20Check installed skills (these get recorded in the manifest)
clawhub list --workdir ~/.openclaw 2>/dev/nullCheck config exists
test -f ~/.openclaw/openclaw.json && echo "config exists" || echo "no config"
Step 2 โ Infer smart defaults, then confirm with user
Based on what you found:
user/x:v1. If unclear, ask.~/Desktop/.claw (easy to find and share). On Linux, use ~/.Present your plan concisely:
> I'll export your OpenClaw as user/x:v1 to ~/Desktop/x-v1.claw.
> Description: "An assistant named X with ..."
> Memory: not included
> Skills bundled: zhuaxia@0.3.0, custom-skill (2 skills from ~/.openclaw/skills/)
>
> Proceed?
Step 3 โ Execute and report
node {baseDir}/scripts/clawctl.mjs save -o --description ""
After success, tell the user: 1. The file location and size 2. How many files were included 3. How many credentials were stripped (reassure them it's safe to share) 4. How to transfer it: "Copy this file to another machine, then tell that machine's OpenClaw '่ฏทๅฎ่ฃ ่ฟไธช claw ๅ '"
Import Workflow
When the user says things like "ๅฏผๅ
ฅ claw", "install this claw", "load this package", or provides a .claw file path:
Step 1 โ Locate the .claw file
If the user didn't specify a path, search for it:
# Check common locations
ls ~/Desktop/*.claw ~/Downloads/*.claw /tmp/*.claw ~/*.claw 2>/dev/null
If multiple .claw files found, list them and ask which one. If none found, ask the user for the path.
Step 2 โ Preview first (always)
ALWAYS dry-run before installing:
node {baseDir}/scripts/clawctl.mjs load --dry-run
Present the preview to the user clearly:
Step 3 โ Analyze conflicts
Before installing, check what already exists:
# Check if workspace files would be overwritten
ls ~/.openclaw/workspace/
If existing files would be overwritten, WARN the user explicitly:
> The following files already exist and will be overwritten: > - IDENTITY.md > - SOUL.md > > Your current agent personality will be replaced. A backup will be created automatically so you can rollback if needed. Continue?
Step 4 โ Install (with auto-backup)
The load command automatically creates a backup before installing:
node {baseDir}/scripts/clawctl.mjs load
This will output something like:
Creating backup before install...
Backup created: 20260308-143022 (12 files)
Rollback with: clawctl rollback 20260308-143022
Tell the user the backup id and reassure them they can rollback at any time.
Step 5 โ Post-install intelligence
This is where AI adds the most value. The load command already handles:
~/.openclaw/skills/)After the load command completes, the agent should handle:
1. Skill gap check โ The load output shows "Additional skills referenced in config (not bundled, may be built-in)". For each:
- If it's a built-in OpenClaw skill (like coding-agent, github), it's already available โ no action needed.
- If it's a ClawHub skill, offer to install:
clawhub install --workdir ~/.openclaw
2. Config merge โ Read both ~/.openclaw/openclaw.json and ~/.openclaw/openclaw.imported.json. Identify what the imported config adds (new model providers, channel settings, skill configurations) vs what the current config already has. Present a summary:
> The imported config includes: > - Telegram channel config (needs bot token) > - Custom model provider "kimi-code" > - Skill config for "nano-banana-pro" > > Your current config already has: [list] > New items to merge: [list] > Shall I merge the non-sensitive settings?
If the user agrees, read both JSON files, merge intelligently (keep current credentials, add new non-sensitive settings), and write back to openclaw.json.
3. Credential checklist โ For each $CLAW_PLACEHOLDER in the imported config, tell the user exactly what they need to set:
> To complete the setup, you need to configure:
> - Telegram bot token: openclaw config set channels.telegram.botToken
> - Gateway auth token: openclaw config set gateway.auth.token
4. Verification โ After everything is done, do a quick health check:
# Verify workspace files are in place
ls ~/.openclaw/workspace/
# Verify skills are installed
ls ~/.openclaw/skills/
# Verify config is valid JSON
node -e "JSON.parse(require('fs').readFileSync(require('os').homedir()+'/.openclaw/openclaw.json','utf8')); console.log('Config OK')"
Rollback Workflow
When the user says "ๅๆป", "rollback", "undo import", "restore my old config":
Step 1 โ List available backups
node {baseDir}/scripts/clawctl.mjs backups
Show the user what's available with timestamps and labels.
Step 2 โ Confirm which backup to restore
If only one backup exists, confirm:
> Found 1 backup: 20260308-143022 (before-load:my-bot.claw, 12 files)
> Restore this? A safety backup of your current state will be created first.
If multiple, ask user to pick.
Step 3 โ Execute rollback
node {baseDir}/scripts/clawctl.mjs rollback
The rollback command automatically creates a safety backup of the current state before restoring, so the user can undo the undo if needed.
Step 4 โ Verify
ls ~/.openclaw/workspace/
Confirm the restored files match expectations.
Manual Backup Workflow
When the user says "ๅคไปฝไธไธๅฝๅ็ถๆ", "save a checkpoint", "backup before I try something":
node {baseDir}/scripts/clawctl.mjs backup --label "user description here"
Report the backup id so they can reference it later.
Edge Cases
curl -o /tmp/downloaded.claw , then proceed with import.rm -rf ~/.openclaw/.zhuaxia-backups/.What Gets Exported
$CLAW_PLACEHOLDER)~/.openclaw/skills/ (full files, auto-installed on import)What Does NOT Get Exported
--include-memory is specified)What Gets Backed Up (on load/rollback)
~/.openclaw/workspace/)~/.openclaw/openclaw.json)~/.openclaw/.zhuaxia-backups//