Install
openclaw skills install openclaw-user-data-packAgent instructions: pack/apply OpenClaw user data via scripts; overwrite-by-path only. You dry-run first, read EXPORT_MANIFEST.txt, gate optional layers, resolve merge conflicts yourself—never imply scripts merge.
openclaw skills install openclaw-user-data-packWho reads this: you are the OpenClaw agent (runtime). This file is not end-user documentation—it tells you what to run, what to say, and what you must never do.
Language: reply to the user in their language; keep technical identifiers (paths, flags) as in the scripts.
Use scripts/pack_openclaw.py and scripts/apply_openclaw.py from this skill to export or restore workspace data (and optional layers only if the user clearly opts in after you warn them). You own preview, collision handling, and consent—the scripts only write files by path.
pip install -r requirements.txt if dependencies may be missing.python scripts/pack_openclaw.py --dry-run with the same flags you plan for the real pack; show the user what paths would be included.workspace/ only. List optional layers (--managed-skills, session flags, config snapshot flags) and do not add any until the user separately approves each, after you give the short risk line (size, transcripts, secrets)—see Before any real disk write.python scripts/pack_openclaw.py with only approved flags.EXPORT_MANIFEST.txt; confirm it matches what you promised (paths + layers).workspace/, EXPORT_MANIFEST.txt, …), stop and say why you will not apply it without their confirmation.pip install -r requirements.txt if needed.$OPENCLAW_HOME (or %USERPROFILE%\.openclaw) and the target workspace—or apply to a throwaway copy—unless they explicitly accept overwrite risk after you state it once.EXPORT_MANIFEST.txt inside the zip, then runpython scripts/apply_openclaw.py --zip <path> --dry-run--openclaw-home, --workspace, and --config as the environment needs. Treat the combined manifest + dry-run output as the write contract.--apply-managed-skills, session flags, or --apply-config only after separate approval and the warnings in Before any real disk write.--dry-run only when the above is satisfied. If config was restored, remind: they still need valid auth on this machine; old paths inside openclaw.json may be wrong here.openclaw doctor in their environment (they execute it, not you).Skip a step only if the user opts out after you repeat the concrete risk.
--dry-run. The printed paths are what a real run would touch.EXPORT_MANIFEST.txt in the zip — authoritative list of packed paths; pair with apply dry-run to see destination collisions.--apply-config: keys, tokens, channels, machine-specific paths. Do not enable without that acknowledgment.pip install -r requirements.txt (includes json5) or pass --workspace explicitly.If you follow previews + consent + collision handling, you can honestly say the flow is transparent; if you skip that, you risk silent data loss.
MEMORY.md, logs, workspace skills; with optional layers, session JSONL and openclaw.json (secrets, channels).~/.openclaw/credentials/. Apply never writes credentials; tell the user they must re-login / re-pair on a new machine unless they consciously accept copying secrets (you still do not pack credentials via these scripts).openclaw.json gets a .bak.<timestamp> when using --apply-config; other paths are not auto-backed up.SKILL.md etc.): divergent purpose or triggers ⇒ do not pick a winner alone; offer keep local / take zip / merge / rename path so both can exist.| Content | Path inside zip | In default pack? |
|---|---|---|
| Workspace (persona, memory, workspace skills, canvas, etc.) | workspace/ | yes |
| Managed skills | managed-skills/ | no — --managed-skills |
| Sessions | sessions/<agentId>/sessions/ | no — session flags + acknowledgement; large, sensitive, full transcripts |
| Config snapshot | config/openclaw.json | no — config flags + acknowledgement; secrets, machine paths |
| Credentials | n/a | never |
Match flags to what is in the zip. If a layer is in the zip but flags are missing, the script warns and skips that layer.
| Content | Action | Default apply? |
|---|---|---|
| Workspace | Extract workspace/* → target workspace | yes, unless --no-apply-workspace |
| Managed skills | → <openclaw-home>/skills/ | no — --apply-managed-skills |
| Sessions | → <openclaw-home>/agents/<id>/sessions/ | no — --apply-sessions + --i-know-restoring-sessions-overwrites |
| Config | → <openclaw-home>/openclaw.json (existing → .bak.<timestamp>) | no — --apply-config + --i-know-config-overwrites-secrets |
$OPENCLAW_HOME or ~/.openclaw; Windows: %USERPROFILE%\.openclaw.--workspace omitted, script reads config. Apply: --workspace may create the dir; if omitted, config must parse. On a fresh machine, prefer openclaw onboard or pass --workspace explicitly.Workspace-only apply, dry-run then real:
python scripts/apply_openclaw.py --zip ./openclaw-user-export-xxx.zip \
--openclaw-home ~/.openclaw \
--workspace ~/.openclaw/workspace \
--dry-run
python scripts/apply_openclaw.py --zip ./openclaw-user-export-xxx.zip \
--openclaw-home ~/.openclaw \
--workspace ~/.openclaw/workspace
All optional apply layers — only after the user approved each flag’s risk:
python scripts/apply_openclaw.py --zip ./export.zip \
--openclaw-home ~/.openclaw --workspace ~/.openclaw/workspace \
--apply-managed-skills \
--apply-sessions --i-know-restoring-sessions-overwrites \
--apply-config --i-know-config-overwrites-secrets
Pack:
python scripts/pack_openclaw.py [--workspace PATH] [--openclaw-home PATH] [--config PATH]
[-o FILE.zip] [--exclude-git | --no-exclude-git] [--managed-skills]
[--sessions --i-know-sessions-are-large-and-sensitive]
[--config-snapshot --i-know-config-may-contain-secrets]
[--dry-run] [--manifest-sha256] [--sha256-max-mb N]
Apply:
python scripts/apply_openclaw.py --zip FILE.zip [--openclaw-home PATH] [--workspace PATH] [--config PATH]
[--no-apply-workspace] [--apply-managed-skills]
[--apply-sessions --i-know-restoring-sessions-overwrites]
[--apply-config --i-know-config-overwrites-secrets]
[--dry-run]
| Intent | Example user phrases |
|---|---|
| Export | backup workspace, export memory, pack openclaw |
| Import | new PC restore, import zip, apply backup, restore openclaw |
| Chinese | 一键打包, 一键应用, 导入 zip, 迁移 |
| Goal | Command |
|---|---|
| Pack preview | python scripts/pack_openclaw.py --dry-run |
| Pack | python scripts/pack_openclaw.py |
| Apply preview | python scripts/apply_openclaw.py --zip x.zip --dry-run |
| Apply | python scripts/apply_openclaw.py --zip x.zip |
| Dependencies | pip install -r requirements.txt |