Introduction

If you are working with dsh’s Web sidebar, you often need to check the balance, daily spending, and daily tokens of a specific AI platform; manually checking the platform backend is quite scattered. The problem dsh-deepseek-balance-widget solves is specific: placing DeepSeek and the addable MiMo (Xiaomi) balance information into the dsh Web sidebar and refreshing automatically every 30 seconds.

Below, the plugin is introduced in the order of features, installation, configuration, and updates.

What is this

dsh-deepseek-balance-widget is a dsh plugin maintained by crazy-L118 for displaying AI balances in the dsh Web sidebar. It comes with DeepSeek built-in and allows adding MiMo (Xiaomi), with an MIT license.

From package.json, we can see:

  • Requires Node.js >=18
  • Declares dsh client platform as web
  • Injects @deepseek-ai/dsh-client-runtime
  • Optional peerDependency is @deepseek-ai/cordis ^4.0.1

Core Features

Sidebar Entry

The sidebar entry displays current platform information in real-time:

  • Balance
  • Today’s spending
  • Today’s tokens

The values synchronize with the platform switched inside the details popup, and automatically refresh every 30 seconds.

Details Popup

The details popup can manage added platforms:

  • Display current platform
  • Support switching added platforms
  • Support removing added platforms
  • Support adding MiMo or DeepSeek

DeepSeek Details

DeepSeek details display:

  • Balance
  • Cumulative spending
  • Today’s spending
  • Today’s tokens
  • This month’s consumption
  • Time badge: 09-12 / 14-18 GMT+8 on weekdays are busy hours, weekends are fully idle

MiMo Details

MiMo details display:

  • Balance
  • Cumulative spending
  • Today’s spending / Today’s tokens
  • This month’s consumption
  • Daily consumption table

Usage Statistics

DeepSeek’s usage statistics can be configured with DEEPSEEK_PLATFORM_TOKEN. When not configured, only the balance is displayed.

MiMo’s balance and usage are queried using login cookies and automatically calculate spending amounts based on official unit prices.

AI-guided Configuration

The popup provides an “AI Help Me Configure” entry point where you can copy the prompt with one click, allowing AI to guide the retrieval of credentials and write them into the plugin.

MiMo supports two methods:

  • AI guide wizard
  • Manually paste Cookie / cURL and automatically extract Cookie

Data Storage

Credentials are stored locally:

~/.dsh/ai-balances.json

Data is stored locally only and is not distributed with the plugin or uploaded.

Versions and Updates

The current version is displayed at the bottom of the popup, and one-click automatic updates are supported. If an update fails, an error details panel will be displayed, guiding you to install it manually on GitHub.

The interface language automatically switches between Chinese / English based on dsh settings.

Installation and Enablement

First, ensure dsh is installed and dsh web is available. The plugin requires Node.js >=18.

Execute the following command to install:

dsh plugin --profile web add dsh-deepseek-balance-widget@2.4.2

This command pulls and installs from npm, and dsh automatically registers it to dsh.profile.bundles.

After installation, you need to restart dsh web completely. Refreshing the browser page is ineffective.

It is recommended to hardcode the version number @2.4.2 in the installation command; do not use @latest to avoid the local pnpm/npm cache or mirror sources resolving to an old version.

Typical Usage

Using Built-in DeepSeek

The plugin automatically creates a DeepSeek entry on first use and reads the local DEEPSEEK_API_KEY.

Adding MiMo

Open the balance popup, click “+ Add”, then click “AI Help Me Configure”, and send the prompt to the agent.

You can also tell the AI directly:

帮我配置 dsh-deepseek-balance-widget

MiMo can also be manually pasted with Cookie / cURL, and the plugin will automatically extract the Cookie.

Configuring DeepSeek Usage Statistics

DeepSeek usage statistics can be configured with DEEPSEEK_PLATFORM_TOKEN. When not configured, only the balance is displayed.

You can also tell the AI directly:

帮我配置用量统计

Updating the Plugin

Installed users can click “Update” at the bottom of the balance popup, and the plugin will automatically pull and install the highest version from npm. The popup update skips the latest tag and directly installs the highest semver version on npm.

For a forced update via command line, you can execute:

dsh plugin --profile web add dsh-deepseek-balance-widget@2.4.2

For manual updates, you can enter the plugin directory:

cd ~/.dsh/profiles/web
npm install dsh-deepseek-balance-widget@2.4.2

If the environment prompts to use pnpm, you can run pnpm add as prompted.

If the update fails due to the Agent host blocking file deletion via NODE_OPTIONS injection, you can run the update command in a regular terminal, or execute first:

set NODE_OPTIONS=

and then retry.

Uninstalling the Plugin

dsh plugin --profile web rm dsh-deepseek-balance-widget

Applicable Scenarios and Notes

This plugin is suitable for scenarios where you already use dsh and dsh web and need to check the balance, spending, and tokens of DeepSeek or MiMo (Xiaomi).

Please note before use:

  • DeepSeek required credential is DEEPSEEK_API_KEY
  • DeepSeek usage statistics optional config is DEEPSEEK_PLATFORM_TOKEN
  • MiMo requires login Cookie, which can be guided by AI
  • Credentials are stored locally at ~/.dsh/ai-balances.json and are not distributed with the plugin or uploaded
  • The plugin runs with the current dsh process permissions; check the source code and license before installing
  • After installing or updating, you must restart dsh web completely; refreshing the browser page is ineffective
  • The directory page is an independent site and does not represent the official DeepSeek / Huanfang app store

Links

  • Directory page: https://www.skillhub.cn/plugins/crazy-L118/dsh-deepseek-balance-widget
  • GitHub: https://github.com/crazy-L118/dsh-deepseek-balance-widget