Who 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).If the zip is not clearly from a trusted source or from this skill’s pack layout ( workspace/, EXPORT_MANIFEST.txt, …), stop and say why you will not apply it without their confirmation.
Run pip install -r requirements.txt if needed.
Tell the user to back up $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.
You read EXPORT_MANIFEST.txt inside the zip, then run
python scripts/apply_openclaw.py --zip <path> --dry-run
with --openclaw-home, --workspace, and --config as the environment needs. Treat the combined manifest + dry-run output as the write contract.
Walk the user through which paths would be created/overwritten. For overlaps on memory / persona / skills, follow Merge and conflicts (your work; not in scripts)— do not run non–dry-run apply on a live workspace until conflicts are resolved or the user explicitly chooses full replace for that subtree.
Add --apply-managed-skills, session flags, or --apply-config only after separate approval and the warnings in Before any real disk write.
Run apply without --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.
Optionally suggest they run 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.ContentPath inside zipIn default pack?Workspace (persona, memory, workspace skills, canvas, etc.)workspace/yesManaged skillsmanaged-skills/no — --managed-skillsSessionssessions/<agentId>/sessions/no — session flags + acknowledgement; large, sensitive, full transcriptsConfig snapshotconfig/openclaw.jsonno — config flags + acknowledgement; secrets, machine pathsCredentialsn/anever
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.
ContentActionDefault apply?WorkspaceExtract workspace/* → target workspaceyes, unless --no-apply-workspaceManaged skills→ <openclaw-home>/skills/no — --apply-managed-skillsSessions→ <openclaw-home>/agents/<id>/sessions/no — --apply-sessions + --i-know-restoring-sessions-overwritesConfig→ <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:
bash
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:
bash
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:
text
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:
text
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]
IntentExample user phrasesExportbackup workspace, export memory, pack openclawImportnew PC restore, import zip, apply backup, restore openclawChinese一键打包, 一键应用, 导入 zip, 迁移
GoalCommandPack previewpython scripts/pack_openclaw.py --dry-runPackpython scripts/pack_openclaw.pyApply previewpython scripts/apply_openclaw.py --zip x.zip --dry-runApplypython scripts/apply_openclaw.py --zip x.zipDependenciespip install -r requirements.txt