dsh-tokens-ci: Viewing tokens.ci Usage and Rankings in the DSH Setup

Preface

When using DeepSeek Harness (dsh) for daily development, token consumption and costs are often scattered across various clients. To check against the public leaderboard on tokens.ci, you would otherwise need to open a browser separately. If you wish to view daily usage, cost breakdowns, model distribution, and rankings without leaving the Harness, a dedicated visualization page within the settings panel is required.

Below is an introduction to the community plugin dsh-tokens-ci (Maintainer: winniesi). It mounts a dashboard page under Settings → Tokens.ci in DSH. The data is sourced from the public tokens.ci API, identical to the source of the Weekly Leaderboard. The plugin is categorized as a Client and is listed in the SkillHub Plugin Directory. Note that the directory site is a community ecosystem site and is not officially affiliated with DeepSeek or High-Flyer.

What is this

dsh-tokens-ci adds a Tokens.ci page to the DSH settings panel, displaying public statistics for your account on tokens.ci: daily tokens and costs, token composition, model share, reporting client distribution, as well as leaderboard rankings and site-wide share.

The host side proxies requests to tokens.ci (due to CORS restrictions in the browser, the API cannot be pulled directly); the client side uses React to register into settings.section, with styling following DSH’s --dsw-* theme. It requires dsh version >= 0.2.0-rc.1 and < 0.3.0-0, and Node >= 18. License: MIT, current package version: 1.0.0.

Prerequisite: Submit usage to tokens.ci first

This page displays public data for your GitHub account on tokens.ci. If there are no records there yet, the page will be empty. You must first use the Tokens CLI to aggregate usage from various AI coding clients on your local machine (including DeepSeek Harness; official documentation states support for approximately 55 clients). It only submits aggregated numbers (tokens, model name, timestamps; no prompts, completions, or file content are sent).

macOS (Homebrew):

brew install owo-network/brew/tokens

Linux (Pre-compiled binary):

curl -fsSL https://tokens.ci/install.sh | sh

After installation, it is recommended to run the following commands in order:

tokens login      # Log in with GitHub
tokens status     # View submitted content
tokens serve      # Continuously submit in the background

On macOS, you can use brew services start tokens instead of tokens serve. Due to server-side caching after submission, please wait a moment before refreshing in DSH to view the data.

Installation and Activation

The client side declares platform: web, similar to DSH’s built-in settings pages, making it applicable to both desktop and web clients. Before installing, please review the GitHub repository source code and the MIT license yourself. The plugin runs with the permissions of the current dsh process and will read local Git configuration, gh, etc., to infer the GitHub username.

Desktop App

Do not use the global CLI’s dsh plugin --profile desktop (this profile is exclusive to the Electron app). Inside the application:

Settings → Plugins (or Built-in plugins in the English interface) → Add plugin:

  • Git repository: github:winniesi/dsh-tokens-ci; or
  • Local directory: Absolute path to the local repository (for local development; simply reload the page after making changes)

After the installation prompt “Installed; it loads at the next start.” appears, restart the application.

Command Line (web and other profiles)

# Install from GitHub (pinned to the current pushed commit)
dsh plugin --profile web add github:winniesi/dsh-tokens-ci

# Install from local directory (for development)
dsh plugin --profile web add /path/to/dsh-tokens-ci

Reload the browser page after installation. To uninstall:

dsh plugin --profile web remove dsh-tokens-ci

Page Capabilities and Typical Usage

After installation and restart (or reload), open Settings → Tokens.ci in DSH.

Section Content
Identity Bar Avatar, GitHub name, statistics window date, today’s figures, period Week / Month / All time, refresh
Daily Usage Daily bar chart within the window; switchable between Token / Cost; keyboard ← → Home End to view by day
Summary Figures Total tokens, cost, active days, message count, etc.
Leaderboard Rank, lead ratio, share of total site tokens
Token Composition Ratios for cache read/write, input, output, reasoning, etc.
Models Sortable by cost or by Token (the two ratios may differ significantly)
Clients Share of reporting tools (e.g., zcode, dsh, pi, etc.)

If there is no available account on the first run, the page provides a GitHub username input box; you can also Switch Account in the footer. The username is saved in $DSH_HOME/dsh-tokens-ci/settings.json (permissions 0600).

Optional: Pin Account or Default Period

Edit $DSH_HOME/profiles/web/cordis.patch.yml (do not modify files bundled with the app), for example:

- id: tokens-ci
  config:
    username: your-github-handle   # Pinned account; input box will not show on page if set
    period: month                  # Default period on open: week | month | all

Restart dsh after making changes. Account resolution priority: config.username → Page saved name → Git [github] user → gh api user → Git [user] name.

Use Cases and Notes

Suitable for: Users who are already using or plan to use tokens.ci and Tokens CLI to aggregate usage, and wish to view trends, models, and leaderboards in one stop within DSH settings without frequently switching to a browser.

Notes:

  1. Data depends on the tokens.ci public API and your account’s reporting; if the CLI is not logged in or tokens serve is not running, the page will be empty or lagging.
  2. The month period on the leaderboard refers to a natural calendar month, while month on the personal homepage refers to a rolling 30 days; the plugin will label “Leaderboard statistics follow natural calendar months” when the windows are inconsistent.
  3. modelUsage[].percentage represents the cost share upstream; the plugin also calculates token share for sorting purposes.
  4. Host-side changes (e.g., index.js) require a dsh restart; changes to client.js only require a page reload.
  5. The authentication check requires at least two social links filled in under Social accounts on your GitHub profile. tokens.ci refreshes daily at 03:20 UTC; this is unrelated to ranking.

Conclusion

dsh-tokens-ci brings tokens.ci usage and leaderboards into the DSH settings page, provided you have already submitted aggregated data to tokens.ci using Tokens CLI. Installation methods are subject to the README: on Desktop, use the built-in plugin manager to add github:winniesi/dsh-tokens-ci and restart; for the Web profile, use dsh plugin --profile web add github:winniesi/dsh-tokens-ci and reload the page.

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

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

Xiaoye