Plakar Restore Workflows
This skill covers restore operations only. Triggering snapshots is handled
automatically by the openclaw-plugin-plakar plugin — you do not need to run
plakar backup manually.
When to offer restore
Offer to restore from a Plakar snapshot when the user says anything like:
- - "undo that", "roll back", "revert to before", "restore my files"
- "something went wrong, can we go back"
- "the last tool call broke things"
Prerequisites
- -
plakar must be in INLINECODE2 - The store path is available in plugin config as INLINECODE3
- Always pass
-no-agent to avoid requiring a running plakar agent daemon
CLI syntax (v1.0.6+)
All commands use the form:
CODEBLOCK0
List all snapshots
CODEBLOCK1
Output: snapshot ID, timestamp, size, path. Present the list to the user and
ask which snapshot to restore from.
Inspect a snapshot's contents
CODEBLOCK2
Use this to confirm the snapshot contains the expected state before restoring.
Diff two snapshots
CODEBLOCK3
Use this to show the user what changed between two points in time.
Restore a snapshot
Restore all files to the original paths:
CODEBLOCK4
Restore to a specific directory:
CODEBLOCK5
Restore a specific path within a snapshot:
CODEBLOCK6
Always confirm with the user before running a restore — it overwrites live files.
Example agent interaction
User: "The last edit broke my config file, can you undo it?"
- 1. Run
plakar -no-agent at <store> ls and show the most recent snapshots - Ask: "Should I restore from snapshot
<id> taken at <timestamp>?" - On confirmation: INLINECODE8
- Confirm the restore completed and invite the user to verify the file
Plakar 恢复工作流
本技能仅涵盖恢复操作。快照的触发由 openclaw-plugin-plakar 插件自动处理——您无需手动运行 plakar backup。
何时提供恢复服务
当用户说出类似以下内容时,提供从 Plakar 快照恢复的服务:
- - 撤销那个、回滚、恢复到之前、恢复我的文件
- 出问题了,我们能回到之前吗
- 上次的工具调用搞坏了东西
前提条件
- - plakar 必须在 $PATH 中
- 存储路径在插件配置中可用,配置项为 plakar.store
- 始终传递 -no-agent 参数,以避免需要运行中的 plakar 代理守护进程
CLI 语法(v1.0.6+)
所有命令均使用以下格式:
plakar -no-agent at [options]
列出所有快照
bash
plakar -no-agent at ls
输出:快照 ID、时间戳、大小、路径。将列表呈现给用户,并询问要从哪个快照恢复。
检查快照内容
bash
plakar -no-agent at ls
plakar -no-agent at ls -recursive :/path
在恢复前使用此命令确认快照包含预期的状态。
比较两个快照
bash
plakar -no-agent at diff
plakar -no-agent at diff -highlight :/file :/file
使用此命令向用户展示两个时间点之间的变化。
恢复快照
将所有文件恢复到原始路径:
bash
plakar -no-agent at restore
恢复到指定目录:
bash
plakar -no-agent at restore -to /tmp/restore-here
恢复快照中的特定路径:
bash
plakar -no-agent at restore -to /tmp/restore-here :/path/to/file
在运行恢复之前始终与用户确认——恢复操作会覆盖现有文件。
代理交互示例
用户:上次编辑搞坏了我的配置文件,你能撤销吗?
- 1. 运行 plakar -no-agent at ls 并显示最近的快照
- 询问:我应该从 时间戳的快照 恢复吗?
- 确认后:plakar -no-agent at restore -to
- 确认恢复完成,并邀请用户验证文件