
yangyongzhen/dsh-session-export
30Last commit Aug 14, 2026
dsh-session-export DSH plugin
This plugin listens to the session/event stream and exports completed turns to Markdown files after a configurable debounce period. It ensures no data is lost by flushing unsaved sessions on process exit, supporting both interactive and headless modes.
How to install the dsh-session-export DSH plugin
dsh plugin --profile <web|tui|headless> add file:/path/to/dsh-session-exportThis source command needs manual review. Copying does not run it.
dsh-session-export DSH plugin data source
dsh-session-export DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-session-export DSH plugin can do
- Auto-exports session turns to Markdown files in $DSH_HOME/exports/
- Debounce mechanism to avoid frequent writes during active turns
- Flushes unsaved sessions on process exit (including headless one-time tasks)
- Modular rendering pipeline that other plugins can reuse via import
Where the dsh-session-export DSH plugin fits
- Reviewing agent conversation history for debugging or analysis
- Exporting sessions as blog posts or documentation
- Auditing agent behavior in headless automated tasks
- Sharing session logs with team members or compliance teams
Who the dsh-session-export DSH plugin is for
- DSH users who need persistent session logs for review
- Developers building plugins that rely on session export functionality
dsh-session-export DSH plugin limitations
- Only supports Markdown export format; no other output formats (e.g., JSON, HTML)
- Requires DSH environment and proper profile configuration (web, tui, or headless)
- Export is triggered by turn end events; manual export is not supported
- Default export directory is fixed to $DSH_HOME/exports/ unless overridden
dsh-session-export DSH plugin: from the repository README
Quoted from the yangyongzhen/dsh-session-export README, the upstream source of the dsh-session-export DSH plugin. Copyright remains with the original authors.
DeepSeek Harness 会话导出与复盘插件:把 agent 会话自动导出为 Markdown 文件,供复盘、写博客、审计使用。 - 监听 `session/event` 事件流,turn 结束并静默 `debounceMs` 后自动导出 - 输出 `$DSH_HOME/exports/session-<id>.md`(默认 `~/.dsh/exports/`) - 进程退出(含 headless 一次性任务)时同步 flush 未导出的会话,不丢记录 - 渲染纯函数模块化导出,其他插件可复用 ## 安装 ```sh # 本地 checkout 安装(推荐,免构建) dsh plugin --profile <web|tui|headless> add file:/path/to/dsh-session-export # 或从 Git 仓库直接安装 dsh plugin --profile <web|tui|headless> add https://gitcode.com/qq8864/dsh-session-export.git ``` ## 配置 通过 profile 的 `cordis.patch.yml` 或 `--patch` overlay 覆盖: ```yaml - id: session-export config: enabled: true # 总开关,false 关闭自动导出 outDir: ~/exports # 导出目录,默认 $DSH_HOME/exports debounceMs: 1000 # turn/end 后的静默等待(毫秒) maxResultChars: 2000 # 工具参数/结果的截断长度 includeInjected: false # true 时包含注入消息(上下文快照、skill 目录等) ``` ## 导出内容 ``` # 会话导出 - 会话 ID / 创建时间 / 工作目录 / Agent 预设 / 导出时间 - 模型(provider/model)与统计:turn/step/工具调用次数、token 消耗(含缓存读写)、耗时 ## Turn N / Step N.t 回合与步骤结构 ### 用户 / 目标 直接提示词与目标延续(注入消息默认过滤) #### 工具调用:name 工具名 + 参数 JSON #### 工具结果 返回内容(截断) ### 助手 模型文本 + 该步 token 明细 > Turn N 结束:完成 回合结束原因(完成/出
Read the full READMEThe repository declares no license. Check with the authors before using it.
dsh-session-export DSH plugin questions
How do I install the dsh-session-export plugin?
You can install it locally by running `dsh plugin --profile <web|tui|headless> add file:/path/to/dsh-session-export` after checking out the repository. Alternatively, use `dsh plugin --profile <web|tui|headless> add https://gitcode.com/qq8864/dsh-session-export.git` to install directly from Git. No separate build step is required for the local path approach.
Where are the exported Markdown files saved?
By default, files are saved to `$DSH_HOME/exports/` (with `$DSH_HOME` typically being `~/.dsh/`). You can override this by setting the `outDir` config option in your profile's `cordis.patch.yml` or via `--patch` overlay. The file naming pattern is `session-<id>.md`.
Can I export sessions manually without waiting for a turn end?
No, the plugin automatically exports upon turn end after a debounce period. Manual export is not supported. However, the plugin flushes all unsaved sessions on process exit, so if you stop the DSH process, any pending sessions will be written before shutdown.
How do I configure the debounce time and truncation length?
In your profile's `cordis.patch.yml` or via `--patch` overlay, add the `session-export` config block. For example: `config: { enabled: true, debounceMs: 1000, maxResultChars: 2000 }`. The `debounceMs` controls how long to wait after a turn ends before exporting; `maxResultChars` truncates tool parameters and results to that length.
Does the plugin work in headless mode?
Yes, it works in headless mode. The plugin flushes unsaved sessions on process exit, which is particularly useful for headless one-time tasks. After running a headless command like `dsh --profile headless 'Tell me about yourself'`, check the `$DSH_HOME/exports/` directory for the exported session file.