hoshF/dsh-md-export ↗★ 0

dsh-md-export

DSH Web session-header button that exports the current conversation as clean Markdown through a native save dialog. 适合需要备份或分享对话的用户,支持通过系统保存窗口一键导出整场对话。

패키지
dsh-md-export
호환성
미검증
버전
1.7.2
라이선스
MIT
최근 업데이트
2026. 10. 4.

같은 패키지 이름의 다른 저장소

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hoshF/dsh-md-export

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:

RuleRationale
No H1 — the document starts at ## MetadataThe title lives in the filename. Pass h1=1 to add # Title.
Metadata as a bullet list, bold keys, backticked valuesModel 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 fencesExporting does not compress code or tool output whitespace.
References from assistant prose and search results, deduped by normalised URLRemove fragments, tracking parameters and trailing slashes; exclude loopback addresses and number by first appearance.
Document labels are EnglishUI 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.