Introduction

The core design philosophy of DeepSeek Harness (DSH) is pluginization. In practical use, users often need to switch among multiple CLI tools and model providers, causing usage records, quota consumption, and subscription costs to be scattered across different places. The dsh-hub-oauth-gateway plugin is intended to provide a local-first unified hub that integrates historical records, cost estimation, quota monitoring, and OAuth login for coding subscriptions.

Core Features

This plugin mainly provides the following capabilities:

  • Local Dashboard and HUD: Provides a floating HUD (quick preview) and a full-screen dashboard. Supports comparison across multiple time ranges (today, 7 days, 30 days, this month). The dashboard includes paginated sections covering Display, Accounts, Gateway, Capabilities, Providers, and Costs.
  • Activity Tracking and History: Provides a 370-day activity heatmap and consecutive usage streak statistics. Usage is recorded in a local SQLite database (path: ${DSH_HOME}/storages/usage-stats-v1.sqlite), with dimensions of (session, turn, step).
  • Cost and Subscription Analysis: Supports cost estimation (based on user-defined prices and coverage rate) and a subscription expense ledger. Provides trend and forecast features calculated by hour, day, week, and month using linear extrapolation.
  • Account and Quota Adaptation: Provides account and quota adapters that display balances, reset times, etc., and set soft reminders.
  • Data Export: Supports export in CSV and JSON formats, with filtering criteria, daily or batch layouts.
  • Coding Subscription OAuth: Supports OAuth login to Grok Build, Codex, Kimi Code, and Claude Code via device code, browser, or PKCE. Supports multi-account storage (up to 8 accounts).
  • Optional Loopback API Gateway: Provides an OpenAI/Anthropic-compatible server disabled by default for local tool integration.
  • Local Monitoring and Status Probing: Provides optional read-only CLI identity snapshots and cross-tool token scanning. Supports GET probes for status pages of allowlisted provider services.
  • OpenCode Go Support: Connects to OpenCode Go through an isolated provider coding-opencode-go and supports external tool invocation.
  • Bilingual Interface: Supports switching between Chinese and English via the DSH localization service.

Installation and Enablement

Installing this plugin requires the DeepSeek Harness Web environment. The installation command is as follows:

dsh plugin --profile web add dsh-hub-oauth-gateway

After installation, restart the DSH Web process for changes to take effect. The plugin depends on the shared core library dsh-coding-oauth-core@0.1.2, which exists as an npm dependency and is not a standalone DSH plugin.

Typical Usage

  • View Usage: Quickly check today’s metrics and account quota chips via the floating HUD.
  • View Detailed Data: Click the link in the HUD to open the full-screen dashboard, and switch tabs to view trends, account details, or local data.
  • Manage Subscriptions: Configure OAuth for coding subscriptions in settings, supporting multi-account pool mode.
  • Data Export: Use the CSV/JSON export feature in the dashboard and filter data as needed.
  • CLI Operations:
    • dsh-hub-oauth: For OAuth-related operations.
    • dsh-hub-grok-build: Alias for Grok Build.
  • Database: All historical data is stored in ${DSH_HOME}/storages/usage-stats-v1.sqlite.

Notes

  • Permissions and Security: The plugin runs with the permissions of the current DSH process. Inspect the source code and license (MIT) before installation.
  • Token Privacy: Tokens will not appear in chat content. Local monitoring only performs snapshots and scanning and does not include conversation content.
  • Data Integrity: Missing prices are not treated as free, and missing session IDs are rejected.
  • Dependencies: This plugin no longer maintains the old npm package name. We recommend removing old entries before installation.

Conclusion

dsh-hub-oauth-gateway provides DSH users with a complete closed loop from usage statistics to subscription management. Through a local database and lightweight gateway design, it improves the user experience and cost control without relying on external services.