ShatterDusk
dsh-porter
DSH session data ops: cross-root migrate (cwd convert), inspect, repair, format convert. Zero dsh dependency.
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 16, 2026
- Updated
- Aug 16, 2026
Introduction
dsh-porter
DSH 会话数据运维 CLI:跨根迁移(含 workspace 归属同步)、体检、修复、格式转换。零 dsh 依赖。
DSH 会话文件不能直接复制迁移(cwd 路径编码写在数据里、格式严格、归属状态分离)——dsh-porter 处理这些。详见 docs/format.md。
Install
npm install -g dsh-porter
Requires Node >= 20.11.
Quick Start
# 体检数据根
dsh-porter inspect ~/.dsh
# 迁移预览 → 执行(Windows 根 → WSL 根)
dsh-porter migrate /mnt/c/Users/1/.dsh ~/.dsh --direction to-wsl --dry-run
dsh-porter migrate /mnt/c/Users/1/.dsh ~/.dsh --direction to-wsl
Commands
| Command | Description |
|---|---|
| `migrate --direction to-wsl | to-win |
| `inspect <session | root>` |
| `convert --format zstd | plain` |
repair <file> | 修复损坏会话(torn 截断/污染隔离) |
archive <src> <dst> | 归档:迁移 + 两阶段删源 |
所有命令支持 --json 与语义化退出码(0 成功 / 1 部分失败 / 2 用法 / 3 环境)。
Research
- docs/format.md — DSH 会话格式研究(帧结构 / header schema / 兼容约束;生态内首份公开文档)
Test
npm test
License
MIT