How to use dsh-undo-plugin
Provides undo/rollback system for DSH: automatic snapshots of configuration and plugin code; one-click undo via WebUI, chat interface, and offline tool; safe mode and GUI fallback when DSH fails to start.
This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.
This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.
Quick start
dsh-undo-plugin
— source: plugin_wiki.wiki_content
Install & verify
dsh plugin --profile web add github:lire1131/dsh-undo-plugin
Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.
— source: plugins.install
Key points
- 配置目录:默认
$DSH_HOME/profiles/<当前 profile>(DSH_HOME 默认 ~/.dsh;此前硬编码web——非 web profile 下快照读错、监听错、恢复写错位置); - 快照仓库:默认
<快照根>/<当前 profile>/{auto,manual}(按 profile 隔离);作用域目录不存在而旧版平铺目录存在时自动回退平铺,旧快照不会"隐身"; - 归属标识:快照 manifest 记录
profile字段,undo_list显示当前 profile。 -
- id: dsh-undo-savepoint
- 撤销:头部「撤销」按钮 /
Ctrl+Alt+Z/ 对 AI 说"撤销上一步"。
— source: plugin_wiki.readme_en (fallback readme_raw)
FAQ
Don't see the header button after installing the plugin?
Restart DSH is required after installation to reach steady state. It installs to web profile by default, please confirm the command line includes dsh plugin --profile web add .... On multi-profile machines, if using other profiles, change --profile to the corresponding name, otherwise the plugin will write to web profile's snapshot library.
Will undo lose the current changes?
No. Each undo/rollback first saves the current state as a 'pre-restore' file, so even if you undo by mistake you can use redo to restore it; it only gets auto-cleaned when redo is consumed by new real changes.
Will snapshots contain secrets? Is exporting ZIP safe?
The default sensitive mode is 'masked': .env / .credentials.yaml values are replaced with placeholders when entering snapshots, with real values stored in local vault (restored only during local rollback). Exported ZIP in masked mode contains no real secrets; if switching to 'plaintext' mode or exporting old snapshots, the exported file will carry real values with a prominent warning.
Can it still be used if DSH won't start at all?
Yes. The installation directory's tools\ contains offline CLI (dsh-undo-savepoint.ps1) and GUI window (dsh-undo-savepoint-gui.ps1), which can be used even when DSH process is not running. In the most extreme case, you can first enable 'safe mode' to keep only the undo plugin, then restart DSH and it will definitely start up.
What needs to be done for cross-machine snapshot migration?
Click 'Export' on A machine's snapshot panel to get ZIP; first install all plugins used by A on B machine, then import the ZIP. The plugin performs cross-machine pre-check during restore, missing plugins will be explicitly warned, and uninstalled plugin directories will not be written to.
Does undo involving plugin code changes require restart?
Yes. When undo/rollback involves cordis.patch.yml, profile/package.json or plugin code, the report will show 'effective after restarting DSH'; pure .env or configuration value changes generally do not require restart.
Will automatic snapshots pile up infinitely?
No. You can configure the number of auto-save points to retain (default 20) and pre-restore files to retain (default 10) in settings; they will be auto-cleaned when exceeding the limit. Manually saved snapshots are never auto-cleared.
Should I include #master in the install command?
The current install command is dsh plugin --profile web add github:lire1131/dsh-undo-plugin, DSH will pull the default branch. If you want to lock a version, you can explicitly add #master or a tag.
— source: plugin_wiki.faq_json
Compatibility
- DSH: >=0.0.1(peer: @deepseek-ai/dsh-tools)
- Node: >=20.0.0
- Platforms: Windows, macOS, Linux
— source: plugin_wiki.compatibility_json
Pitfalls
Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.
— source: general rule