Introduction¶
The plugin model of DSH allows external capabilities to be attached to specific profiles. If you are using DeepSeek Harness (dsh) and want to aggregate AI coding activities, lines of code, and time spent into WakaTime, you need a plugin capable of reading dsh tool activities and invoking wakatime-cli.
The following introduces @dingyi222666/dsh-wakatime.
Plugin Positioning¶
@dingyi222666/dsh-wakatime is the WakaTime plugin for DeepSeek Harness (dsh), used to track AI coding activity, lines of code, and time spent.
- Maintainer:
dingyi222666 - License: MIT
- Source: ported logic from
opencode-wakatime(MIT)
It is suitable for installation on dsh profiles that run an agent loop, such as:
web
headless
tui
When installing from npm, the following is required:
dsh >= 0.1.2-alpha.5
The plugin declares zero runtime dependencies, only importing Node builtins and the @deepseek-ai/* peers provided by the host. The listed peer dependencies are:
@deepseek-ai/cordis >=4.0.0
@deepseek-ai/dsh-session >=0.1.0-rc.0
@deepseek-ai/schemastery >=3.0.0
Core Capabilities¶
- Automatic CLI management: Automatically downloads and updates
wakatime-cli; global installation is also supported. - Detailed file tracking: Tracks
edit,write,read,read_image, andstr_replace_editoroperations. - AI coding metrics: Sends
--ai-line-changes, calculated from diff hunks of fs tools. - Rate-limited heartbeats: One heartbeat per project per minute, persisted to disk.
- Session lifecycle flush: Flushes pending heartbeats during session disposal and plugin teardown, including one-shot headless runs.
- Batch tool support: When an edit involves multiple files, sends them via
--extra-heartbeatsin a singlewakatime-clicall. - Zero runtime dependencies: Relies only on Node builtins and the
@deepseek-ai/*peers provided by the host.
Prerequisites¶
First, ensure the WakaTime API key is configured in the [settings] section of ~/.wakatime.cfg:
[settings]
api_key = waka_your_api_key_here
wakatime-cli does not need to be installed manually; the plugin will download and update it if missing. To install manually, you can use:
brew install wakatime-cli
Or download from WakaTime releases.
Installation and Activation¶
First install to the web profile, then start/restart dsh web:
dsh plugin --profile web add @dingyi222666/dsh-wakatime
dsh web
If headless will be run, also install to the corresponding profile:
dsh plugin --profile headless add @dingyi222666/dsh-wakatime
It needs to be installed on every profile that runs an agent loop. When updating, re-run the same dsh plugin add command.
If using the dsh CLI started from source, you can run the bin directly:
node --import tsx/esm apps/cli/src/bin.ts plugin --profile web add @dingyi222666/dsh-wakatime
Installation from Source¶
First clone the repository and build, then add the local directory to the web profile:
git clone https://github.com/dingyi222666/dsh-wakatime
cd dsh-wakatime
pnpm install && pnpm run build
dsh plugin --profile web add .
dsh web
Configuration¶
Configuration fields are optional and validated by the schemastery schema upon loading. You can add id: wakatime in the profile’s user patch layer or via --patch. For example, to enable debug only:
- id: wakatime
config:
debug: true
Other optional fields include heartbeatIntervalMs, client, and timeoutMs, fill them as needed.
Use Cases and Notes¶
Suitable for developers who need to connect AI coding activities within dsh to WakaTime, especially scenarios using multiple profiles like web, headless, and tui simultaneously.
Notes:
- The plugin runs with the permissions of the current dsh process. Before installing, check the source code and license to ensure its behavior—calling
wakatime-cli, reading tool events, and using the configured WakaTime API key—is as expected. bashcommands are not attributed to specific files.- Tool calls in sandboxes or remote file systems might be recorded according to the
file_pathparameter visible to the model; if the sandbox resolution method differs, they might fall into project-relative entities. - When the plugin location cannot resolve
@deepseek-ai/dsh, the dsh host version in the--plugintag will appear asunknown.
Reference¶
GitHub: https://github.com/dingyi222666/dsh-wakatime
You can search for the plugin name @dingyi222666/dsh-wakatime on the community directory page; the community directory is a separate site, not an official app store. The directory page URL is not listed in the information provided in this article.