dsh-md-export
将当前会话导出为干净的Markdown 适合需要备份或分享对话的用户,支持通过系统保存窗口一键导出整场对话。
同名套件的其他儲存庫
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hoshF/dsh-md-export說明文件
閱讀完整 README ↗Usage
In the app
Select Export MD in the session header, choose a location in the system
save dialog, and save. The button label follows the app's language setting:
Export MD in English and 导出 MD in Chinese.
The suggested filename is the conversation title. You can rename it in the dialog; the completion toast reports the filename that was written. Only one export can run at a time.
CLI
node bin/dsh-md-export.mjs # newest session
node bin/dsh-md-export.mjs # a specific session
node bin/dsh-md-export.mjs --list # list sessions
node bin/dsh-md-export.mjs --all -o out.md # tool calls, thinking, injected, system
Defaults to ~/dsh-transcripts/.md. --stdout prints instead.
--list lists every session. -o / --out requires a path; use ./-name.md
for a filename beginning with -. Invalid output arguments fail before any file is written.
For a standalone note, use --h1 to include the conversation title in the document:
node bin/dsh-md-export.mjs --h1 -o notes.md
HTTP
GET /api/md-export?sessionId=[&tools=1][&reasoning=1][&injected=1][&system=1][&h1=1]
GET /api/md-export?meta=1&sessionId= # lightweight JSON metadata
POST /api/md-export {"sessionId":"…","tools":true,…}
The response is text/markdown; charset=utf-8 with a Content-Disposition
header (ASCII fallback plus RFC 5987 filename*) and an X-Dsh-Filename header
carrying the true filename for the client to read.
Output format
Follows the AfterChat / ChatFormat conversation-export convention:
| Rule | Rationale |
|---|---|
No H1 — the document starts at ## Metadata | The title lives in the filename. Pass h1=1 to add # Title. |
| Metadata as a bullet list, bold keys, backticked values | Model and session values remain easy to scan. |
### 🧑💻 User / ### 🤖 Assistant, no turn numbers, no --- | Role headings carry the structure. |
| Demote message headings outside code fences | # Heading → **Heading**, preserving the document outline. |
| Preserve blank lines in message bodies and tool fences | Exporting does not compress code or tool output whitespace. |
| References from assistant prose and search results, deduped by normalised URL | Remove fragments, tracking parameters and trailing slashes; exclude loopback addresses and number by first appearance. |
| Document labels are English | UI copy is localised separately. |
Thinking (reasoning=1) folds into the same assistant message as
#### 🤔 Thought Process + #### 💡 Response. Tool calls (tools=1) appear in
collapsible details. Both options are off by default.
Bare links exclude sentence-ending punctuation; explicit Markdown link targets
retain their punctuation. Mixed bare and Markdown links share the same appearance order.