dsh-artifacts
把 Markdown + JSON 渲染成自包含 HTML 文档/卡片/仪表盘/画廊(CLI + 内置 artifact_render 工具)。
安装
dsh plugin --profile web add dsh-artifacts
沙箱测试
这个插件还没测过。提交测试 →
README
dsh-artifacts
Claude-Artifacts-style rendering for DeepSeek Harness. Turn raw agent
output — Markdown + JSON — into beautiful, shareable, self-contained HTML
documents, cards, dashboards, and galleries. One command. Zero runtime
dependencies.



English | [中文](#中文)
Your agent produces Markdown and JSON all day. Most of it ends up as unstyled
terminal text that nobody shares. dsh-artifacts fixes that: the same content,
rendered as a polished, dependency-free HTML artifact you can open from disk,
attach to an email, or drop on any static host.
Live demo: https://zoahdev.github.io/dsh-artifacts/
Published on npm: dsh-artifacts
Why
- No design skills required. Pick a template + theme, get a finished page.
- Self-contained. All CSS is inlined — no external fonts, frameworks, or
tracking. The output works offline and forever.
- Works two ways. A CLI for you, and an
artifact_rendertool for the
agent itself.
- Zero runtime dependencies. Node ≥ 18 only; nothing to audit.
Quick start
# As a standalone CLI pnpm add -g dsh-artifacts # or: npm install -g dsh-artifacts dsh-artifacts notes.md --title "Release notes" --theme dark --out notes.html dsh-artifacts notes.md --serve 8080 # live preview # Or via npx without installing npx dsh-artifacts notes.md --theme paper --out notes.html
Install as a DeepSeek Harness plugin:
dsh plugin --profile web add dsh-artifacts # or, using the upstream CLI directly: pnpm dlx @deepseek-ai/dsh plugin --profile web add dsh-artifacts
Then the agent can call artifact_render from chat to write a styled report to
disk and hand you back the path.
Templates
Template · Use it for
doc · Prose, notes, reports, README-style content
card · A single shareable statement / hero card
dashboard · Metrics, bars, and tables from JSON
gallery · Image / item grids
All four templates, rendered from the same demo inputs in this repo:
<table>
<tr>
<td><img src="demo/preview-doc.png" alt="doc"></td>
<td><img src="demo/preview-dashboard.png" alt="dashboard"></td>
</tr>
<tr>
<td><img src="demo/preview-card.png" alt="card"></td>
<td><img src="demo/preview-gallery.png" alt="gallery"></td>
</tr>
</table>
Themes
Theme · Vibe
dark · GitHub-dark, default
light · Clean light UI
paper · Warm, editorial serif
terminal · Green-on-black monospace
brand · DeepSeek-blue
Examples
Document from Markdown:
dsh-artifacts demo/sample.md \ --title "Release notes" \ --subtitle "dsh-artifacts v0.1.0" \ --theme dark \ --out release-notes.html
Dashboard from JSON:
dsh-artifacts --data demo/metrics.json \ --title "Agent fleet dashboard" \ --template dashboard \ --theme brand \ --out dashboard.html
{
"metrics": [
{ "label": "Sessions", "value": 128, "delta": "+12" },
{ "label": "CI", "value": true }
],
"bars": [
{ "label": "Monday", "value": 8 },
{ "label": "Tuesday", "value": 14 }
],
"columns": ["tool", "calls", "median_ms"],
"rows": [["read_file", "412", "38"]]
}
Gallery from JSON:
dsh-artifacts --data gallery.json --template gallery --theme light
{ "items": [ { "title": "A", "image": "https://…/a.png", "tag": "new" } ] }
Vault export (Obsidian / VS Code / any folder of Markdown)
dsh-artifacts is not DSH-only. Point it at any folder of .md notes — an
Obsidian vault, a VS Code notes directory, blog drafts, or docs — and it
renders one self-contained HTML page per note plus a linked index.html:
dsh-artifacts vault ./my-notes --theme paper --out site # site/index.html + site/<note>.html
The first # heading of each note becomes its title; the first meaningful line
becomes the index excerpt. Ignored folders include node_modules, .git,
.obsidian, and .trash. Use --no-recursive for the top level only.
In-harness tool
artifact_render accepts:
Parameter · Type · Description
title · string · Document title
subtitle · string · Subtitle / byline
markdown · string · Markdown body
data · string · JSON for dashboard / gallery
template · string · doc / card / dashboard / gallery
theme · string · light / dark / paper / terminal / brand
out · string · Output path (defaults to a temp file)
It returns { path, bytes, title, template, theme }.
Library use
import { renderArtifact } from 'dsh-artifacts'
const { html } = renderArtifact({
title: 'Weekly report',
markdown: '# Shipped',
template: 'doc',
theme: 'dark',
})
What CI actually proves
`build → unit tests → pack → install the real tarball into a fresh project →
load the packed bundle → register artifact_render via apply() →
execute the real handler → assert a real HTML file + rendered output`.
In a second step, CI installs the packed plugin into a fresh DSH_HOME
profile, verifies it appears in --dump-config, boots the real dsh web
server, and asserts HTTP 200.
The smoke test also installs against an old @deepseek-ai/dsh-tools RC and
asserts the runtime guard rejects it loudly (instead of failing later).
Tested with
@deepseek-ai/dsh-tools^0.1.0-rc.6@deepseek-ai/cordis^4.0.1- Node ≥ 18 (CI runs Node 22)
The peer range is declared as a caret range (not a hard pin). At runtime the
plugin refuses to load if the resolved dsh-tools ve
…(truncated)
以上内容来自 npm 上的 README,我们只做格式化,不改内容。
版本
npm 上共发布:2,最后更新 2026-08-16