Introduction¶
When working with knowledge bases, long-document Q&A, or RAG in DeepSeek Harness (DSH), the corpus often consists of Word, Excel, PDF, or images rather than ready-made Markdown. If an Agent can only read plain text, users are forced to either export files manually beforehand or repeatedly explain in the conversation “please convert this first.” This repository provides both the doc2md command-line tool (directory monitoring, batch conversion, OCR) and the npm package dsh-doc2md. The latter registers the doc2md tool within DSH, connecting conversion capabilities directly to the harness. The plugin itself does not parse documents; it simply makes deterministic calls to the locally installed doc2md CLI.
What is this¶
- Plugin ID:
github:jessehoo89/markdown_monitor - Maintainer: jessehoo89
- Category: Networked Tool (Directory page classification; the underlying doc2md can use multi-cloud OCR for scanned PDFs. Whether to connect to the network is determined by local
config.json/.env; the plugin does not make this choice for you) - npm Package Name:
dsh-doc2md(Current package.json version 1.0.1, MIT License) - Repository: https://github.com/jessehoo89/markdown_monitor
- Directory Page: https://www.skillhub.cn/plugins/jessehoo89/markdown_monitor
The project name is markdown_monitor, but the command-line tool and installation artifacts retain the doc2md naming. Already installed instances are unaffected.
Core Functions¶
What local doc2md can do (Capabilities passed through by the plugin)¶
In monitoring mode, watchdog listens for additions and modifications across multiple root directories, featuring write debouncing and self-triggering protection (generated .md files will not trigger conversion again). state.db records processed files, ensuring restarts or repeated file drops do not cause re-conversion. Modifying config.json allows for hot-loading of monitored directories, exclusion rules, extensions, debounce duration, output locations, PDF engines, etc. (Changes related to OCR require a restart).
Supported inputs include docx / doc / xls / xlsx / pdf / images. Local direct conversion paths include mammoth (docx), openpyxl (xlsx), Office COM or LibreOffice (legacy doc/xls), and pymupdf4llm (PDFs with a text layer). Scanned or text-layer-less PDFs go through multi-backend OCR (paddle, mineru, sf-deepseek-ocr, etc.); if quotas are exhausted or authentication fails, it will trip a circuit breaker and switch backends.
Batch conversion remains available via doc2md convert <directory>; continuous monitoring is done via doc2md watch.
Four actions exposed by the DSH plugin¶
The plugin registers the tool doc2md in the harness, providing the actions listed in the table below (parameters enter the session log, so do not treat paths containing secrets as confidential):
| action | Effect |
|---|---|
convert |
Converts the given absolute path (file or directory) and reports the destination for each “source file → md” |
read |
Reads back the body of a specific .md or the md with the same name next to the source document |
scan |
Dry run: Only lists routing and OCR volume; does not write any files |
status |
Prints conversion statistics (including today’s usage for each backend) |
The plugin only reads and writes the paths you specify; it does not parse documents, scrape web pages, or load remote resources. Document parsing and whether to upload to cloud OCR are executed by the local doc2md process according to its own configuration.
Finding local doc2md¶
Before installing the plugin, a working doc2md is required on the machine. The plugin resolves it in order, and you can also specify it via environment variables:
| Environment Variable | Meaning |
|---|---|
DOC2MD_BIN |
Absolute path to doc2md / doc2md.exe (Highest priority) |
DOC2MD_REPO |
Root of the source repository; switches to using <python> -m doc2md |
DOC2MD_PYTHON |
Interpreter used with DOC2MD_REPO |
If unset, it searches PATH and common installation directories (e.g., %LOCALAPPDATA%\Programs\doc2md, C:\Program Files\doc2md on Windows; ~/.local/bin, /opt/doc2md on Linux). Requires Node ≥ 22.19.
convert relies on --print-outputs introduced in doc2md 1.0.3 to obtain accurate output paths; older versions will downgrade to same-directory, same-name inference and note this in the results.
Installation and Enablement¶
1. Install doc2md (Local CLI, Plugin Prerequisite)¶
Linux (Recommended one-liner, installs to ~/.local by default, approx. 130M):
curl -fsSL https://raw.githubusercontent.com/jessehoo89/markdown_monitor/main/install.sh | bash
Legacy .doc / .xls files require LibreOffice on Debian/Ubuntu:
sudo apt install -y libreoffice-writer libreoffice-calc
bash install.sh
Windows: Download doc2md-*-win-x64-installer.exe from Releases to install, or extract *-win-x64.zip and run doc2md-gui.exe.
After installation, it is recommended to: generate config.json on the first run and change roots to your corpus directory; fill in cloud OCR credentials in .env (conversion of docx/xlsx/PDFs with text layers works without this); run doc2md scan once to check routing without writing files.
2. Install the plugin in DSH¶
dsh plugin --profile web add github:jessehoo89/markdown_monitor
Alternatively, select “Manual Input” in the DSH desktop marketplace and enter github:jessehoo89/markdown_monitor. Restart the profile after installation. The plugin has no build script and will not trigger allowBuilds. If pnpm is missing, run corepack enable pnpm first.
Typical Usage¶
On the Agent side, call via the harness’s doc2md tool; for local debugging, you can compare with the CLI:
doc2md scan --root ~/语料 # Dry run
doc2md run --root ~/语料 # Batch conversion
doc2md convert a.docx b.pdf # Convert only specified files
doc2md watch # Continuous directory monitoring
When monitoring a corpus directory, simply drop files into the roots configured in config.json to trigger conversion on drop; for DSH sessions, it is more suitable to use convert / scan / read / status to operate on explicit paths.
To specify a non-default doc2md, set the following before loading the plugin, for example:
export DOC2MD_BIN=/opt/doc2md/doc2md
The console output of the Windows packaged doc2md.exe is GBK, and the plugin will decode it compatibly.
Use Cases and Notes¶
Suitable for: Users already running agents in DSH where the corpus consists of Office/PDF/images, who want the agent to “convert → read md → continue reasoning,” and who are willing to maintain doc2md (and optionally OCR credentials) on their local machine.
Notes:
- The plugin runs with the permissions of the current dsh process user and can only access paths readable and writable by that user; please review the repository source code and MIT license yourself before installation.
- Whether scans are uploaded to the cloud and whether sensitive directories are marked as no-upload is controlled by doc2md’s
config.json(e.g.,sensitive_markers) and.env, independent of the plugin. - The community directory skillhub.cn is an independent site with no official affiliation with DeepSeek / High-Flyer; metadata such as stars are subject to what is displayed on each page at the time (the directory page indicates 0 stars).
Conclusion¶
markdown_monitor / dsh-doc2md connects local doc2md’s conversion, dry-run, read-back, and statistics capabilities to DSH, suitable for the workflow of “documents enter the directory, Agent uses Markdown to continue working.” Install doc2md first, configure the corpus directory, and then load it into the harness using the official command.