PeiQinyi/dsh-diary: A local Markdown diary in the DeepSeek Harness sidebar

Preface

When building sidebar tools in DSH (DeepSeek Harness), the common practice is to shove data into some backend and read/write via an interface. This approach is convenient to write but comes with the cost of extra services, accounts, and sync logic. If what you need is simply “saving today’s writing to a local file” — like a diary — the whole setup is overkill.

peiqinyi/dsh-diary takes a different route: it adds a diary to the Harness sidebar, one entry per day, navigable via a monthly calendar, and automatically saves as a plain text Markdown file upon completion. The plugin itself does not handle accounts, cloud sync, or AI ghostwriting; data lands in ~/Documents/日记/ and can be read without the plugin. Below is an introduction to its installation, usage, and data format.

What is this

A DeepSeek Harness plugin maintained by PeiQinyi. Repository: https://github.com/PeiQinyi/dsh-diary . Directory page: https://www.skillhub.cn/plugins/PeiQinyi/dsh-diary . Category: “Memory”. The problem solved is narrow: a handy diary entry in the Harness interface with a unified disk format where files belong to the user.

The version in package.json is 0.1.0, private: true. License is MIT (© 2026 Pei Qinyi).

Core Features

The README lists five capabilities:

  1. Write: Full-page writing, auto-saves 0.7 seconds after stopping, Enter is a normal line break (not a submit).
  2. Flip: Monthly calendar navigation, days with records are marked, “Today” returns to today with one click.
  3. Find: Ctrl+K full-text search.
  4. View: Consecutive record days, current month and cumulative counts, total word count.
  5. Portable: Data defaults to ~/Documents/日记/2026.md, one Markdown file per year.

Keybindings: Ctrl+K (macOS ⌘K) for full-text search, Ctrl+S for immediate save, Esc to close search. Top-right corner also has “Export” to download all diaries combined into a single Markdown file.

The sidebar icon appears under “Plugins” -> “Schedule” after installation.

Installation and Enabling

The repository root is the plugin package itself; no build is needed. The README provides three installation methods, all using plugin_manager’s install_bundle with the target filled accordingly.

First, install from GitHub (recommended to lock the commit to avoid upstream changes silently altering behavior):

git+https://github.com/PeiQinyi/dsh-diary.git#<commit>

Second, local directory: first git clone, then point install_bundle’s target to the absolute path of that directory.

Third, direct copy: put the whole directory anywhere, install using the absolute path.

There are two ways to configure the data directory: set the environment variable DSH_DIARY_DIR, or modify config.directory in cordis.patch.yml inside the plugin. The data directory is completely separate from the plugin code; uninstalling or upgrading the plugin will not affect the diary.

Note that this plugin runs with the permissions of the current DSH process and will read/write the local directory you specify. It is recommended to review the source code before installation to ensure index.js, lib/route.js, and cordis.patch.yml behave as expected.

Typical Usage

Process for opening the diary page:

  1. Click the notebook icon in the sidebar to open the diary page.
  2. The cursor lands directly in the body; start typing; auto-save after 0.7 seconds of stopping.
  3. Click a date on the left calendar to switch, use ‹ › to flip months, “Today” returns to today.
  4. When checking old content, press Ctrl+K for full-text search, and press Ctrl+S to immediately save after changes.

The data format is fixed, one file per year:

# 2026

## 2026-11-03

> ⛅ 多云 · 🥱 疲惫

今天……

Points to note:

  • ## YYYY-MM-DD is the unique structural anchor; remaining content is saved as-is.
  • Mood/Weather is a quote line immediately following the header, data is carried by emoji, the following Chinese is just decoration (changing it to rain · exhausted is also readable).
  • Old format <!-- {"mood":...} --> is still readable and will be rewritten to the quote line upon the next save.
  • Leading whitespace is removed upon saving; body content is flush left; blank lines on both sides and pure blank lines will be regularized.
  • Content before the first date title is considered “Prologue” and is preserved as-is when written.
  • Before each write, the previous version is left in <year>.md.bak; if the body is empty and no mood/weather is selected, that day’s entry is deleted entirely.
  • Writes are atomic: using temporary files + rename to avoid partial writes.

Code Structure and Development

The plugin is split into Host and Browser halves:

File Purpose
index.js Host entry: parses directory, registers routes
lib/store.js Year file read/write, parsing, search, stats, export (pure Node, can be tested independently)
lib/route.js POST /dsh-diary/api, dispatches by action, goes through host authentication
client.js Browser half: sidebar icon + full-page interface
test/store.test.mjs Storage layer tests
PLAN.md Product and format decision log

Verification and reinstall after code changes:

# Syntax check + Storage layer tests (30 items)
node --check index.js
node --check client.js
node --check lib/store.js
node test/store.test.mjs

# Reinstall after changes (takes effect within profile)
# plugin_manager install_bundle, target = current directory

Changing index.js (Host half) requires restarting Harness to reload; changing client.js generally only requires refreshing the page; if it still doesn’t work, restart.

Use Cases and Notes

Suitable for those who want to conveniently jot things down in Harness but do not want to hand over their diary to the cloud or AI ghostwriting. It handles only plain text and does not touch rich text, images, tags, or multiple notebooks. To sync, you can place the directory into OneDrive / iCloud yourself. A single yearly file will become slow at extreme volumes (hundreds of thousands of words a year), at which point splitting will be needed — this is listed as a known boundary in the README.

The README notes several explicit design trade-offs, which perfectly explain why it is simple: one file per year instead of one per day (hundreds of small files are hard to flip and backup); pure text first, the body is the original Markdown, no rich text or preview layer, readable without the plugin; no touch on content generation, only responsible for recording and recycling, no ghostwriting, polishing, or summarizing; atomic writes, old versions kept in .bak.

If you need a diary tool with a tag system, rich text, or cloud sync, this one is not suitable; if you just need a local spot to stay, with stable formatting, this one is sufficient.

Sources and Links

  • Directory page: https://www.skillhub.cn/plugins/PeiQinyi/dsh-diary
  • GitHub: https://github.com/PeiQinyi/dsh-diary
羽毛球分组比赛记分
小程序二维码

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

Xiaoye