Yihong89/dsh-plugins--packages-usage-report ↗★ 2
dsh-usage-report
DeepSeek Harness plugin: per-session token usage and estimated cost report (/usage command + usage_report tool), priced from the DeepSeek pricing table.
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-usage-report
A DeepSeek Harness plugin that reports the current session's token usage and estimated cost. One host-plane plugin row registers:
- the
usageReportsession-projection unit — folds the provider-reported usage of every model request (uncached input, cache-read, cache-write, output) attributed to the model named by the nearestrequest/header, and prices each sample with the configured price table; - the
/usagehuman command — prints the report as a table; - the
usage_reportmodel tool — returns the same report as canonical JSON, so the agent itself can check budget mid-task.
Costs are estimates, not billing records: they multiply the provider's reported token buckets by the price table below. The token buckets are exact provider numbers; the prices are configuration.
Install
Requirements: a DSH profile with the tools, commands, and
sessionProjections services (the web and headless profiles provide all
three via dsh-base).
# 1. make the plugin available to your profile (installs from this GitHub repo)
dsh plugin --profile web add -w 'github:Yihong89/dsh-plugins#main&path:packages/usage-report'
# 2. activate it in the profile's patch layer
# add to ~/.dsh/profiles/web/cordis.patch.yml:
#
# - insert:
# - id: usage-report
# name: 'dsh-usage-report'
# 3. restart the profile (e.g. restart the `dsh web` process)
The package commits its built lib/, so the install needs no build-script
permission. A profile patch is a pnpm workspace root, hence the -w flag.
Usage
/usage (human)
Type /usage in a chat. Example output:
Session usage report
model uncached-input cache-read cache-write output requests est. cost
deepseek-v4-flash 1,234 5,678 12 8,901 14 $0.012345
Total 1,234 5,678 12 8,901 14 $0.012345
usage_report (model tool)
The model can call it mid-task ("how much have we spent?") and receives the same numbers as canonical JSON: