dsh-receipt: Turn DSH sessions into shareable battle report cards

Preface

When using DeepSeek Harness (DSH) for long sessions, the common ways to explain afterwards—“how long did this take, how many tool calls were made, how many tokens were consumed”—are either manual screenshots or jotting down notes based on memory. The former is hard to read, and the latter lacks a source of truth. DSH records sessions as local JSONL logs; if we can aggregate these same logs into standardized metrics and export them as cards ready to paste into chats or social platforms, the cost of sharing becomes much lower. Below is an introduction to the community plugin dsh-receipt (maintainer: louisyeaaah, category: Client).

What is this

dsh-receipt performs read-only statistics on DSH session logs to generate summaries of usage and behavior for a single instance or a specific time period: duration, turns, steps, tool calls, files involved, tokens, etc. By default, it redacts sensitive data and has zero npm dependencies. Output can be terminal text, --json, or a 1080×1350 SVG/PNG card. The repository is not published to npm, so the command line must use the GitHub path. Once installed into DSH, it can also be invoked via plugin tools and in-session commands. It shares the same src/ statistics and rendering logic with the CLI, ensuring consistent calculation criteria.

Core Features

Single Session Report

Aggregates data for a specified session (defaults to the latest one):

  • Project name (path segment after redaction), model, session ID prefix
  • Duration (time difference between the first and last event)
  • Turns (user inputs, deduplicated via turn/start), Steps (model responses, deduplicated via step/start)
  • Number of tool calls and usage ranking grouped by tool name
  • Files involved (basename extracted from tool arguments, deduplicated across names)
  • Tokens: Input (new), Output, Cache Read (listed separately, not merged into input)
  • Context compaction: count of compaction/prune and number of tokens pruned

Periodic Report

Uses --since to combine multiple sessions within a window into a single summary (e.g., the last 7 days). The output provides both the Time Span (wall clock time) and the Total Session Duration (sum of the differences between the first and last events of each session, including idle time; parallel sessions may be double-counted); files involved are a deduplicated union across sessions. Can be filtered by --project.

Cards and Language

--svg and --png generate sharing cards; --lang zh|en and --theme dark|light control the copy and color scheme. PNG relies on local Chrome/Chromium/Edge to rasterize the SVG; if no browser is available, SVG can still be used.

Redaction and Optional Disclosure

Default redaction: Project paths retain only the last segment, files only basename and count, and session IDs display only the first 8 characters; conversation content is not included. Full paths require explicit --show-paths.

Invocation within Plugin

Once installed as a DSH plugin, you can request reports directly within the session without leaving the application:

dsh_receipt()                                  # Current session
dsh_receipt({ scope: 'period', since: '7d' })  # Summary for the last 7 days
dsh_receipt({ out: '/tmp/card.svg' })          # Write card to file
/dsh-receipt period 7d en out:/tmp/card.svg    # In-session command

The plugin only reads session logs; it performs no write operations other than writing cards when you specify out. Official @deepseek-ai/* packages are listed as peerDependencies and provided by DSH.

Differences from Similar Tools (README Self-Description)

The community already has projects focusing on Markdown/HTML reports, daily/weekly summaries, and handover documents (such as dsh-receipts, dsh-report-studio). The maintainer explains that this repository differs mainly in: output is primarily PNG/SVG images, facilitating direct posting; and dual entry points with consistent criteria: CLI (bin/receipt.mjs) and plugin tool (dsh_receipt()). If a complete reporting system and HTML archiving are needed, the README suggests prioritizing similar tools with more comprehensive features.

The package name dsh-receipt on npm (deronendless/dsh-receipt) is a different project (saves JSON/Markdown credentials per turn) and is unrelated to this repository; do not use npx dsh-receipt.

Installation and Activation

DSH plugin installation command (from source material):

dsh plugin --profile <profile> add github:louisyeaaah/dsh-receipt

Before installation, it is recommended to review the GitHub repository source code and MIT license yourself. The plugin runs under the permissions of the current DSH process and reads session files under ~/.dsh/sessions/ only; enabling it implies trust in its parsing logic and redaction behavior.

Runtime environment: Node ≥ 22 (uses built-in zlib), with no node_modules dependencies.

Typical Usage

Command Line (npx GitHub Path)

The README emphasizes not to use npx dsh-receipt, but rather:

npx github:louisyeaaah/dsh-receipt              # Latest session, text report
npx github:louisyeaaah/dsh-receipt --png receipt.png   # 1080×1350 PNG card
npx github:louisyeaaah/dsh-receipt --list              # List recent sessions

Periodic summary examples:

npx github:louisyeaaah/dsh-receipt --since 7d
npx github:louisyeaaah/dsh-receipt --since 30d --project dsh-plugin
npx github:louisyeaaah/dsh-receipt --since 7d --png week.png

Other common options: --json for machine-readable output; --show-paths to disable path redaction; --price-in, --price-out, --price-cache (price per million tokens in USD) are only used to estimate costs if you provide the unit prices yourself; there is no built-in price list within the tool.

Data Source

Session file paths look like:

~/.dsh/sessions/<project>/session-<id>/session.v4.jsonl.zstd

Each line is a JSON event; the tool decompresses frame-by-frame for the multi-frame zstd append-write format (the README explains the pitfalls of Node’s single-frame decompression and self-testing coverage).

Use Cases and Notes

Suitable for: People who need to turn real session statistics into shareable images or short text (e.g., build in public, internal usage sync); users who want the CLI and in-session plugin to share the same criteria.

Notes:

  • Only supports DSH session.v4 format; upstream changes require plugin updates.
  • Duration includes idle time; sessions left open across days will appear very long. In periodic reports, “Total Duration” and “Time Span” coexist to avoid misinterpretation.
  • PNG depends on a local browser; for limitations and metric definitions, see the “Limitations” and “Metric Definitions” tables in the repository README.
  • The community directory SkillHub Plugin Page has no official affiliation with DeepSeek or Quantwai; the DSH ecosystem philosophy is “everything is a plugin,” so installation of third-party plugins requires your own assessment.

Conclusion

dsh-receipt transforms DSH session logs into reports or cards with default redaction and verifiable sources. It is zero-dependency, primarily read-only, and suitable for quickly displaying development intensity and token usage for a single session or a time window. For details and sample output, see GitHub: louisyeaaah/dsh-receipt, Directory Entry: SkillHub · dsh-receipt.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye