When using DeepSeek Harness (DSH) locally, conversation records are saved in disk files. If you need to back up, share, or migrate these history records, manually organizing them can be cumbersome. The following introduces the dsh-session-export plugin, which provides a set of standard commands to list local sessions and export any session as Markdown or JSON.

Features

The plugin provides two core tool commands:

  1. session_list
    Lists all local sessions. The returned result includes the session title, ID, working directory, creation time, and size. It supports filtering by keywords.

  2. session_export
    Exports a specified session. Output formats support Markdown (including user/assistant messages, tool calls and results, and the reasoning process) or JSON (structured data). It supports directly specifying an output path; if none is specified, it returns the full text by default.

Data Storage and Dependencies
- Session data is sourced from $DSH_HOME/sessions (the default path is ~/.dsh/sessions).
- The plugin supports exporting zstd-compressed logs (.l.zstd) and plain-text logs (.l).
- Titles are automatically read from DSH’s session/title record; if no title exists, it falls back to the first user message.
- The dependency is peer-only and is loaded with the DSH host, so no additional runtime installation is required.

Installation and Enabling

Run the following command in your terminal to install the plugin into the specified profile:

dsh plugin --profile web add dsh-session-export

After installation, the plugin is automatically added to the profile’s dsh.profile.bundles configuration. After running the install command, you need to restart or reload the DSH configuration for the new tool to take effect.

Typical Usage

Once the plugin is active, you can operate it through natural-language instructions or by directly invoking the command-line tools.

  • List all local sessions:
    Invoke the session_list command.

  • Export a session as Markdown and save it to a file:
    Invoke the session_export command, specifying the session ID and output path.

  • Export a session as JSON:
    Invoke session_export and set the format=json parameter.

Use Cases and Notes

Use Cases
- Backup: Periodically export local sessions to prevent accidental data loss.
- Sharing and review: Use exported Markdown documents for documentation sharing or review analysis.
- Structured migration: Export data in JSON format to make secondary processing or import into knowledge bases easier.

Notes
- The plugin is implemented in pure Node with zero third-party runtime dependencies.
- The plugin runs with DSH host permissions and involves local file-system access, so ensure the source code is secure.
- This plugin is an open-source project under the MIT license.

Summary

dsh-session-export provides DSH users with a standardized session-export capability. By using the two tools session_list and session_export, you can conveniently convert local conversation history into Markdown or JSON format, meeting the needs of backup, sharing, and migration.